Asst
AssistantAPI
Bases: OpenAIConfig
Methods:
api_type
api_type: str = Field(
default="openai",
description="The api type from openai for calling models.",
examples=["openai", "azure"],
validation_alias=AliasChoices("OPENAI_API_TYPE"),
frozen=False,
deprecated=False,
)
base_url
base_url: str = Field(
...,
description="The base url from openai for calling models.",
examples=["https://api.openai.com/v1", "https://xxxx.openai.azure.com"],
validation_alias=AliasChoices("OPENAI_BASE_URL", "AZURE_OPENAI_ENDPOINT"),
frozen=False,
deprecated=False,
)
api_key
api_key: str = Field(
...,
description="The api key from openai for calling models.",
examples=["sk-proj-...", "141698ac..."],
validation_alias=AliasChoices("OPENAI_API_KEY", "AZURE_OPENAI_API_KEY"),
frozen=False,
deprecated=False,
)
api_version
api_version: str = Field(
default="2025-04-01-preview",
description="The api version from openai for calling models.",
examples=["2025-04-01-preview"],
validation_alias=AliasChoices("OPENAI_API_VERSION"),
frozen=False,
deprecated=False,
)
create_or_retrieve_thread
retrieve_assistant_by_settings
retrieve_assistant_by_settings(
name: str, model: str, description: str, instructions: str
) -> Assistant
Source code in src/sdk/asst.py
delete_thread
create_or_retrieve_assistant
create_or_retrieve_assistant(
name: str, model: str, description: str, instructions: str
) -> Assistant