forked from phoenix-oss/llama-stack-mirror
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:
parent
6964510dc1
commit
314806cde3
10 changed files with 49 additions and 19 deletions
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue