Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions test/collection/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,42 @@ def test_config_with_vectorizer_and_properties(
}
},
),
(
Configure.Generative.google_vertex(project_id="project"),
{
"generative-palm": {
"projectId": "project",
}
},
),
(
Configure.Generative.google_vertex(
project_id="project",
api_endpoint="https://api.google.com",
region="europe-west4",
location="europe-west4",
max_output_tokens=100,
model_id="model",
endpoint_id="endpoint",
temperature=0.5,
top_k=10,
top_p=0.5,
),
{
"generative-palm": {
"projectId": "project",
"apiEndpoint": "https://api.google.com",
"region": "europe-west4",
"location": "europe-west4",
"maxOutputTokens": 100,
"modelId": "model",
"endpointId": "endpoint",
"temperature": 0.5,
"topK": 10,
"topP": 0.5,
}
},
),
(
Configure.Generative.aws(
model="cohere.command-light-text-v14",
Expand Down
7 changes: 7 additions & 0 deletions weaviate/collections/classes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ class _GenerativeGoogleConfig(_GenerativeProvider):
apiEndpoint: Optional[str]
endpointId: Optional[str]
region: Optional[str]
location: Optional[str]
maxOutputTokens: Optional[int]
modelId: Optional[str]
projectId: str
Expand Down Expand Up @@ -1082,6 +1083,7 @@ def palm(
return _GenerativeGoogleConfig(
apiEndpoint=api_endpoint,
region=None,
location=None,
maxOutputTokens=max_output_tokens,
modelId=model_id,
projectId=project_id,
Expand Down Expand Up @@ -1124,6 +1126,7 @@ def google(
return _GenerativeGoogleConfig(
apiEndpoint=api_endpoint,
region=None,
location=None,
maxOutputTokens=max_output_tokens,
modelId=model_id,
projectId=project_id,
Expand All @@ -1141,6 +1144,7 @@ def google_vertex(
project_id: str,
api_endpoint: Optional[str] = None,
region: Optional[str] = None,
location: Optional[str] = None,
max_output_tokens: Optional[int] = None,
model_id: Optional[str] = None,
endpoint_id: Optional[str] = None,
Expand All @@ -1157,6 +1161,7 @@ def google_vertex(
project_id: The Google Vertex project ID to use.
api_endpoint: The API endpoint to use without a leading scheme such as `http://`. Defaults to `None`, which uses the server-defined default
region: The region to use. Defaults to `None`, which uses the server-defined default
location: The location to use. Defaults to `None`, which uses the server-defined default of `us-central1`
max_output_tokens: The maximum number of tokens to generate. Defaults to `None`, which uses the server-defined default
model_id: The model ID to use. Defaults to `None`, which uses the server-defined default
endpoint_id: The endpoint ID to use. Defaults to `None`, which uses the server-defined default
Expand All @@ -1167,6 +1172,7 @@ def google_vertex(
return _GenerativeGoogleConfig(
apiEndpoint=api_endpoint,
region=region,
location=location,
maxOutputTokens=max_output_tokens,
modelId=model_id,
projectId=project_id,
Expand Down Expand Up @@ -1202,6 +1208,7 @@ def google_gemini(
return _GenerativeGoogleConfig(
apiEndpoint=None,
region=None,
location=None,
maxOutputTokens=max_output_tokens,
modelId=model,
projectId="",
Expand Down