converting to pydantic-settings
This commit is contained in:
@@ -29,7 +29,7 @@ def request_embeddings(texts: Sequence[str], config: EbookSearchConfig) -> list[
|
||||
f"{config.embedding_base_url.rstrip('/')}/embeddings",
|
||||
headers=auth_headers(config.embedding_api_key),
|
||||
json={"model": config.embedding_model, "input": list(texts)},
|
||||
timeout=60,
|
||||
timeout=config.embedding_timeout_seconds,
|
||||
)
|
||||
response.raise_for_status()
|
||||
return embedding_vectors_from_response(response.json())
|
||||
@@ -106,7 +106,7 @@ def request_chat_completion(
|
||||
"messages": list(messages),
|
||||
"temperature": 0,
|
||||
},
|
||||
timeout=60,
|
||||
timeout=config.chat_timeout_seconds,
|
||||
)
|
||||
response.raise_for_status()
|
||||
return chat_content_from_response(response.json())
|
||||
|
||||
Reference in New Issue
Block a user