weaviate-python-client
weaviate-python-client copied to clipboard
[DX] Proposal: Provider configuration
Some of our users find additional imports of classes & namespaces challenging.
So, we propose to update how the integrations (e.g. Google, Cohere, OpenAI, etc.) are provided in the client, through an API like this:
client.configure_provider.cohere(
api_key=os.getenv("COHERE_KEY")
requests_per_minute_embeddings=1000
requests_per_minute_generative=500,
)
client.configure_provider.aws(
secret="aws_s",
access="aws_a"
)
client.configure_provider.view_all() # <-- A potential method for users to see what is configured. Could return all configs set, with partially redacted API keys?
from:
from weaviate.classes.config import Integrations
integrations = [
# Each model provider may expose different parameters
Integrations.cohere(
api_key=cohere_key,
requests_per_minute_embeddings=rpm_embeddings,
),
Integrations.openai(
api_key=openai_key,
requests_per_minute_embeddings=rpm_embeddings,
tokens_per_minute_embeddings=tpm_embeddings, # e.g. OpenAI also exposes tokens per minute for embeddings
),
]
client.integrations.configure(integrations)
@sebawita @dirkkul