Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vectorizer runtime config #981

Merged
merged 15 commits into from
May 6, 2024
Merged

Vectorizer runtime config #981

merged 15 commits into from
May 6, 2024

Conversation

dirkkul
Copy link
Collaborator

@dirkkul dirkkul commented Mar 26, 2024

Closes #382

Adds the possibility of typed input for runtime module configuration of api-keys, rate limits and other things that can be affected by headers at the request time.

Currently only adds this for OpenAI, Cohere and VoyageAI as these two are already supported by the batch vectorization and need the rate-limit input.

Also adds some tuning of the dynamic batching for low-rate-limit api keys

Syntax:

    collection = client.collections.create(
        name="Test",
        properties=[
            wvc.config.Property(name="url", data_type=wvc.config.DataType.TEXT),
            wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT),
            wvc.config.Property(name="raw", data_type=wvc.config.DataType.TEXT),
            wvc.config.Property(name="sha", data_type=wvc.config.DataType.TEXT),
        ],
        vectorizer_config=[
            wvc.config.Configure.NamedVectors.text2vec_cohere(name="cohereFirst"),
            wvc.config.Configure.NamedVectors.text2vec_cohere(name="cohereSecond"),
        ]
    )
integrations=[
            wvc.init.Integrations.cohere(
                api_key="KEY"
            ),
            wvc.init.Integrations.openai(
                api_key="KEY", base_url ="...."
            ),
            wvc.init.Integrations.voyageai(
                api_key="KEY",
            ),
        ]
client.integrations.configure(integrations)

@dirkkul dirkkul force-pushed the vectorizer_runtime_config branch from 78eb3db to da22527 Compare May 2, 2024 22:51
@dirkkul dirkkul requested a review from a team as a code owner May 2, 2024 22:51
@dirkkul dirkkul changed the base branch from 1.25-release to dev/1.25 May 3, 2024 22:33
@codecov-commenter
Copy link

codecov-commenter commented May 3, 2024

Codecov Report

Attention: Patch coverage is 75.11962% with 52 lines in your changes are missing coverage. Please review.

Project coverage is 94.63%. Comparing base (d604db8) to head (577a2c9).
Report is 227 commits behind head on main.

Files Patch % Lines
weaviate/collections/batch/base.py 39.02% 50 Missing ⚠️
weaviate/collections/batch/client.py 95.83% 1 Missing ⚠️
weaviate/collections/batch/collection.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #981      +/-   ##
==========================================
- Coverage   95.23%   94.63%   -0.61%     
==========================================
  Files         173      181       +8     
  Lines       17836    18641     +805     
==========================================
+ Hits        16986    17640     +654     
- Misses        850     1001     +151     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from dev/1.25 to main May 6, 2024 22:11
@dirkkul dirkkul force-pushed the vectorizer_runtime_config branch from 7faed15 to 3adf74f Compare May 6, 2024 22:17
@dirkkul dirkkul merged commit 302c887 into main May 6, 2024
43 checks passed
@dirkkul dirkkul deleted the vectorizer_runtime_config branch May 6, 2024 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Set external API keys through functions
2 participants