11# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22
33from __future__ import annotations
4+ import json
45
56import os
67from typing import Any , Union , Mapping
@@ -126,6 +127,7 @@ def __init__(
126127 # outlining your use-case to help us decide if it should be
127128 # part of our public interface in the future.
128129 _strict_response_validation : bool = False ,
130+ provider_data : Mapping [str , Any ] | None = None ,
129131 ) -> None :
130132 """Construct a new synchronous LlamaStackClient client instance.
131133
@@ -140,13 +142,18 @@ def __init__(
140142 if base_url is None :
141143 base_url = f"http://any-hosted-llama-stack.com"
142144
145+ custom_headers = default_headers or {}
146+ custom_headers ["X-LlamaStack-Client-Version" ] = __version__
147+ if provider_data is not None :
148+ custom_headers ["X-LlamaStack-Provider-Data" ] = json .dumps (provider_data )
149+
143150 super ().__init__ (
144151 version = __version__ ,
145152 base_url = base_url ,
146153 max_retries = max_retries ,
147154 timeout = timeout ,
148155 http_client = http_client ,
149- custom_headers = default_headers ,
156+ custom_headers = custom_headers ,
150157 custom_query = default_query ,
151158 _strict_response_validation = _strict_response_validation ,
152159 )
@@ -344,6 +351,7 @@ def __init__(
344351 # outlining your use-case to help us decide if it should be
345352 # part of our public interface in the future.
346353 _strict_response_validation : bool = False ,
354+ provider_data : Mapping [str , Any ] | None = None ,
347355 ) -> None :
348356 """Construct a new async AsyncLlamaStackClient client instance.
349357
@@ -358,13 +366,18 @@ def __init__(
358366 if base_url is None :
359367 base_url = f"http://any-hosted-llama-stack.com"
360368
369+ custom_headers = default_headers or {}
370+ custom_headers ["X-LlamaStack-Client-Version" ] = __version__
371+ if provider_data is not None :
372+ custom_headers ["X-LlamaStack-Provider-Data" ] = json .dumps (provider_data )
373+
361374 super ().__init__ (
362375 version = __version__ ,
363376 base_url = base_url ,
364377 max_retries = max_retries ,
365378 timeout = timeout ,
366379 http_client = http_client ,
367- custom_headers = default_headers ,
380+ custom_headers = custom_headers ,
368381 custom_query = default_query ,
369382 _strict_response_validation = _strict_response_validation ,
370383 )
0 commit comments