mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-15 22:47:59 +00:00
fix openapi generator
This commit is contained in:
parent
4067038f74
commit
fc66131fea
4 changed files with 67 additions and 452 deletions
|
@ -36,7 +36,13 @@ def extract_async_iterator_type(type_hint):
|
|||
return None
|
||||
|
||||
|
||||
_CLIENT_CLASSES = {}
|
||||
|
||||
|
||||
def create_api_client_class(protocol) -> Type:
|
||||
if protocol in _CLIENT_CLASSES:
|
||||
return _CLIENT_CLASSES[protocol]
|
||||
|
||||
class APIClient:
|
||||
def __init__(self, base_url: str):
|
||||
self.base_url = base_url.rstrip("/")
|
||||
|
@ -124,7 +130,6 @@ def create_api_client_class(protocol) -> Type:
|
|||
else:
|
||||
data.update(convert(kwargs))
|
||||
|
||||
print(f"{data=}")
|
||||
return dict(
|
||||
method=webmethod.method or "POST",
|
||||
url=url,
|
||||
|
@ -148,6 +153,7 @@ def create_api_client_class(protocol) -> Type:
|
|||
|
||||
# Name the class after the protocol
|
||||
APIClient.__name__ = f"{protocol.__name__}Client"
|
||||
_CLIENT_CLASSES[protocol] = APIClient
|
||||
return APIClient
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue