Add X-LlamaStack-Client-Version, rename ProviderData -> Provider-Data (#735)

Add another header so client SDKs can identify their versions which can
be used for immediate detection of possible compatibility issues. A
semver mismatch against the wrong server should be immediately flagged
and requests should be denied.

Also change `X-LlamaStack-ProviderData` to `X-LlamaStack-Provider-Data`
since that hyphenation is better.
This commit is contained in:
Ashwin Bharambe 2025-01-09 11:51:36 -08:00 committed by GitHub
parent a5c57cd381
commit ffc6bd4805
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 1281 additions and 152 deletions

View file

@ -145,6 +145,6 @@ class GroqInferenceAdapter(Inference, ModelRegistryHelper, NeedsRequestProviderD
provider_data = self.get_request_provider_data()
if provider_data is None or not provider_data.groq_api_key:
raise ValueError(
'Pass Groq API Key in the header X-LlamaStack-ProviderData as { "groq_api_key": "<your api key>" }'
'Pass Groq API Key in the header X-LlamaStack-Provider-Data as { "groq_api_key": "<your api key>" }'
)
return Groq(api_key=provider_data.groq_api_key)