Open
Conversation
chakrris
reviewed
Aug 13, 2025
| raise ValueError(f"Expected user message, got {params.content.author}") | ||
|
|
||
| if not os.environ.get("OPENAI_API_KEY"): | ||
| if not os.environ.get("SGP_API_KEY"): |
Contributor
There was a problem hiding this comment.
Do we need these checks here or will the SGPClient already raise SGPClientError exceptions when these keys are missing? Just wondering b/c it adds a lot of boilerplate to each project. Are you trying to protect against error message propagation issues?
| ######################################################### | ||
|
|
||
| # Call an LLM to respond to the user's message | ||
| chat_completion = await adk.providers.litellm.chat_completion( |
Contributor
There was a problem hiding this comment.
Nit for the future:
Is the goal for each of these providers to be drop in replacements for each other? If so, for the future, would you want to consider some type of "LLMProviderInterface" spec that these providers adhere to? And then have a providers.auto option which checks env vars and initializes the appropriate one instead of hard coding the selection in the tutorials?
| def __init__(self, sgp_api_key: str | None = None): | ||
| self.sync_client = SGPClient(api_key=os.environ.get("SGP_API_KEY", sgp_api_key)) | ||
| def __init__(self, sgp_api_key: str | None = None, sgp_account_id: str | None = None): | ||
| self.sync_client = SGPClient( |
Contributor
There was a problem hiding this comment.
- The SGP client accepts a variety of configuration args (like number of retries, timeout). Wouldn't those need to be propagated from some
llm_config(or at least timeout seems to be a runtime arg)? - Nit: maybe mirror the arg names of
SGPClient/ remove redundantsgpprefix: i.e.sgp_api_key-->api_key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.