-
-
Notifications
You must be signed in to change notification settings - Fork 324
fix(config): skip API key validation for Vertex AI provider type #349
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
Changes from all commits
5ef22d1
258981e
4650c02
8e0d270
d5aebe6
11c34db
85903b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -94,6 +94,9 @@ def format_missing_api_key_errors( | |||||
| return error_msg | ||||||
|
|
||||||
|
|
||||||
| LOCAL_PROVIDERS = frozenset({cs.Provider.OLLAMA, cs.Provider.LOCAL, cs.Provider.VLLM}) | ||||||
|
|
||||||
|
|
||||||
| @dataclass | ||||||
| class ModelConfig: | ||||||
| provider: str | ||||||
|
|
@@ -102,7 +105,7 @@ class ModelConfig: | |||||
| endpoint: str | None = None | ||||||
| project_id: str | None = None | ||||||
| region: str | None = None | ||||||
| provider_type: str | None = None | ||||||
| provider_type: cs.GoogleProviderType | None = None | ||||||
vitali87 marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| thinking_budget: int | None = None | ||||||
| service_account_file: str | None = None | ||||||
|
|
||||||
|
|
@@ -113,8 +116,11 @@ def to_update_kwargs(self) -> ModelConfigKwargs: | |||||
| return ModelConfigKwargs(**result) | ||||||
|
|
||||||
| def validate_api_key(self, role: str = cs.DEFAULT_MODEL_ROLE) -> None: | ||||||
| local_providers = {cs.Provider.OLLAMA, cs.Provider.LOCAL, cs.Provider.VLLM} | ||||||
| if self.provider.lower() in local_providers: | ||||||
| provider_lower = self.provider.lower() | ||||||
| if provider_lower in LOCAL_PROVIDERS or ( | ||||||
| provider_lower == cs.Provider.GOOGLE | ||||||
| and self.provider_type == cs.GoogleProviderType.VERTEX | ||||||
| ): | ||||||
| return | ||||||
| if ( | ||||||
| not self.api_key | ||||||
|
|
@@ -150,7 +156,7 @@ class AppConfig(BaseSettings): | |||||
| ORCHESTRATOR_ENDPOINT: str | None = None | ||||||
| ORCHESTRATOR_PROJECT_ID: str | None = None | ||||||
| ORCHESTRATOR_REGION: str = cs.DEFAULT_REGION | ||||||
| ORCHESTRATOR_PROVIDER_TYPE: str | None = None | ||||||
| ORCHESTRATOR_PROVIDER_TYPE: cs.GoogleProviderType | None = None | ||||||
| ORCHESTRATOR_THINKING_BUDGET: int | None = None | ||||||
| ORCHESTRATOR_SERVICE_ACCOUNT_FILE: str | None = None | ||||||
|
|
||||||
|
|
@@ -160,7 +166,7 @@ class AppConfig(BaseSettings): | |||||
| CYPHER_ENDPOINT: str | None = None | ||||||
| CYPHER_PROJECT_ID: str | None = None | ||||||
| CYPHER_REGION: str = cs.DEFAULT_REGION | ||||||
| CYPHER_PROVIDER_TYPE: str | None = None | ||||||
| CYPHER_PROVIDER_TYPE: cs.GoogleProviderType | None = None | ||||||
| CYPHER_THINKING_BUDGET: int | None = None | ||||||
| CYPHER_SERVICE_ACCOUNT_FILE: str | None = None | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,12 @@ | |
|
|
||
| from prompt_toolkit.styles import Style | ||
|
|
||
| from .constants import NodeLabel, RelationshipType, SupportedLanguage | ||
| from .constants import ( | ||
| GoogleProviderType, | ||
| NodeLabel, | ||
| RelationshipType, | ||
| SupportedLanguage, | ||
| ) | ||
|
|
||
| if TYPE_CHECKING: | ||
| from tree_sitter import Language, Node, Parser, Query | ||
|
|
@@ -148,7 +153,7 @@ class ModelConfigKwargs(TypedDict, total=False): | |
| endpoint: str | None | ||
| project_id: str | None | ||
| region: str | None | ||
| provider_type: str | None | ||
| provider_type: GoogleProviderType | None | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| thinking_budget: int | None | ||
| service_account_file: str | None | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.