fix: Resolve pyright type errors in MCP server factories
- Add validation for Azure OpenAI API URL to ensure it's not None - Fix OpenAI embedder config to use 'embedding_model' instead of 'model' - Remove 'dimensions' parameter from OpenAIEmbedderConfig (not supported) - Add URL validation for both LLM and embedder Azure configurations All pyright type checks now pass with 0 errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c834c7b52d
commit
859af2e4d8
2 changed files with 10 additions and 2 deletions
|
|
@ -111,6 +111,9 @@ class LLMClientFactory:
|
|||
raise ValueError('Azure OpenAI provider configuration not found')
|
||||
azure_config = config.providers.azure_openai
|
||||
|
||||
if not azure_config.api_url:
|
||||
raise ValueError('Azure OpenAI API URL is required')
|
||||
|
||||
# Handle Azure AD authentication if enabled
|
||||
api_key: str | None = None
|
||||
azure_ad_token_provider = None
|
||||
|
|
@ -208,8 +211,7 @@ class EmbedderFactory:
|
|||
|
||||
embedder_config = OpenAIEmbedderConfig(
|
||||
api_key=config.providers.openai.api_key,
|
||||
model=config.model,
|
||||
dimensions=config.dimensions,
|
||||
embedding_model=config.model,
|
||||
)
|
||||
return OpenAIEmbedder(config=embedder_config)
|
||||
|
||||
|
|
@ -222,6 +224,9 @@ class EmbedderFactory:
|
|||
raise ValueError('Azure OpenAI provider configuration not found')
|
||||
azure_config = config.providers.azure_openai
|
||||
|
||||
if not azure_config.api_url:
|
||||
raise ValueError('Azure OpenAI API URL is required')
|
||||
|
||||
# Handle Azure AD authentication if enabled
|
||||
api_key: str | None = None
|
||||
azure_ad_token_provider = None
|
||||
|
|
|
|||
3
mcp_server/uv.lock
generated
3
mcp_server/uv.lock
generated
|
|
@ -671,6 +671,9 @@ requires-dist = [
|
|||
{ name = "voyageai", marker = "extra == 'voyageai'", specifier = ">=0.2.3" },
|
||||
]
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
dev = [{ name = "pyright", specifier = ">=1.1.404" }]
|
||||
|
||||
[[package]]
|
||||
name = "groq"
|
||||
version = "0.31.0"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue