Skip to content

Conversation

@anishxyz
Copy link
Contributor

No description provided.

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"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 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 redundant sgp prefix: i.e. sgp_api_key --> api_key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants