mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
add delete assistant SDK
This commit is contained in:
parent
e201b06d9c
commit
5bf430f201
2 changed files with 116 additions and 0 deletions
|
@ -2440,6 +2440,38 @@ class OpenAIAssistantsAPI(BaseLLM):
|
|||
response = openai_client.beta.assistants.create(**create_assistant_data)
|
||||
return response
|
||||
|
||||
def delete_assistant(
|
||||
self,
|
||||
api_key: Optional[str],
|
||||
api_base: Optional[str],
|
||||
timeout: Union[float, httpx.Timeout],
|
||||
max_retries: Optional[int],
|
||||
organization: Optional[str],
|
||||
assistant_id: str,
|
||||
client=None,
|
||||
async_create_assistants=None,
|
||||
):
|
||||
# if async_create_assistants is not None and async_create_assistants == True:
|
||||
# return self.async_create_assistants(
|
||||
# api_key=api_key,
|
||||
# api_base=api_base,
|
||||
# timeout=timeout,
|
||||
# max_retries=max_retries,
|
||||
# organization=organization,
|
||||
# client=client,
|
||||
# )
|
||||
openai_client = self.get_openai_client(
|
||||
api_key=api_key,
|
||||
api_base=api_base,
|
||||
timeout=timeout,
|
||||
max_retries=max_retries,
|
||||
organization=organization,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = openai_client.beta.assistants.delete(assistant_id=assistant_id)
|
||||
return response
|
||||
|
||||
### MESSAGES ###
|
||||
|
||||
async def a_add_message(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue