Add provider data passing for library client (#750)

# What does this PR do?

This PR adds the provider data passing for the library client and
changes the provider's api keys be unique


## Test Plan

LLAMA_STACK_CONFIG="/Users/dineshyv/.llama/distributions/llamastack-fireworks/fireworks-run.yaml"
pytest -v tests/client-sdk/agents/test_agents.py

run.yaml:
https://gist.github.com/dineshyv/0c10b5c7d0a2fb7ba4f0ecc8dcf860d1
This commit is contained in:
Dinesh Yeduguru 2025-01-13 15:12:10 -08:00 committed by GitHub
parent 6964510dc1
commit 314806cde3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 49 additions and 19 deletions

View file

@ -13,7 +13,7 @@ __all__ = ["WolframAlphaToolConfig", "WolframAlphaToolRuntimeImpl"]
class WolframAlphaToolProviderDataValidator(BaseModel):
api_key: str
wolfram_alpha_api_key: str
async def get_adapter_impl(config: WolframAlphaToolConfig, _deps):

View file

@ -44,11 +44,11 @@ class WolframAlphaToolRuntimeImpl(
return self.config.api_key
provider_data = self.get_request_provider_data()
if provider_data is None or not provider_data.api_key:
if provider_data is None or not provider_data.wolfram_alpha_api_key:
raise ValueError(
'Pass WolframAlpha API Key in the header X-LlamaStack-Provider-Data as { "api_key": <your api key>}'
'Pass WolframAlpha API Key in the header X-LlamaStack-Provider-Data as { "wolfram_alpha_api_key": <your api key>}'
)
return provider_data.api_key
return provider_data.wolfram_alpha_api_key
async def list_runtime_tools(
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None