forked from va/knowledge-search-mcp
Update MCP defaults
This commit is contained in:
10
main.py
10
main.py
@@ -244,7 +244,10 @@ class GoogleCloudVectorSearch:
|
||||
json=payload,
|
||||
headers=headers,
|
||||
) as response:
|
||||
response.raise_for_status()
|
||||
if not response.ok:
|
||||
body = await response.text()
|
||||
msg = f"findNeighbors returned {response.status}: {body}"
|
||||
raise RuntimeError(msg)
|
||||
data = await response.json()
|
||||
|
||||
neighbors = data.get("nearestNeighbors", [{}])[0].get("neighbors", [])
|
||||
@@ -281,6 +284,8 @@ class GoogleCloudVectorSearch:
|
||||
class Settings(BaseSettings):
|
||||
"""Server configuration populated from environment variables."""
|
||||
|
||||
model_config = {"env_file": ".env"}
|
||||
|
||||
project_id: str
|
||||
location: str
|
||||
bucket: str
|
||||
@@ -288,7 +293,7 @@ class Settings(BaseSettings):
|
||||
deployed_index_id: str
|
||||
endpoint_name: str
|
||||
endpoint_domain: str
|
||||
embedding_model: str = "text-embedding-005"
|
||||
embedding_model: str = "gemini-embedding-001"
|
||||
search_limit: int = 10
|
||||
|
||||
|
||||
@@ -359,6 +364,7 @@ async def knowledge_search(
|
||||
contents=query,
|
||||
config=genai_types.EmbedContentConfig(
|
||||
task_type="RETRIEVAL_QUERY",
|
||||
|
||||
),
|
||||
)
|
||||
embedding = response.embeddings[0].values
|
||||
|
||||
Reference in New Issue
Block a user