forked from phoenix/litellm-mirror
router - add acreate_assistants
This commit is contained in:
parent
e4ad792d5d
commit
f5eb862635
1 changed files with 19 additions and 0 deletions
|
@ -1970,6 +1970,25 @@ class Router:
|
||||||
|
|
||||||
#### ASSISTANTS API ####
|
#### ASSISTANTS API ####
|
||||||
|
|
||||||
|
async def acreate_assistants(
|
||||||
|
self,
|
||||||
|
custom_llm_provider: Optional[Literal["openai", "azure"]] = None,
|
||||||
|
client: Optional[AsyncOpenAI] = None,
|
||||||
|
**kwargs,
|
||||||
|
) -> Assistant:
|
||||||
|
if custom_llm_provider is None:
|
||||||
|
if self.assistants_config is not None:
|
||||||
|
custom_llm_provider = self.assistants_config["custom_llm_provider"]
|
||||||
|
kwargs.update(self.assistants_config["litellm_params"])
|
||||||
|
else:
|
||||||
|
raise Exception(
|
||||||
|
"'custom_llm_provider' must be set. Either via:\n `Router(assistants_config={'custom_llm_provider': ..})` \nor\n `router.arun_thread(custom_llm_provider=..)`"
|
||||||
|
)
|
||||||
|
|
||||||
|
return await litellm.acreate_assistants(
|
||||||
|
custom_llm_provider=custom_llm_provider, client=client, **kwargs
|
||||||
|
)
|
||||||
|
|
||||||
async def aget_assistants(
|
async def aget_assistants(
|
||||||
self,
|
self,
|
||||||
custom_llm_provider: Optional[Literal["openai", "azure"]] = None,
|
custom_llm_provider: Optional[Literal["openai", "azure"]] = None,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue