acreate_assistant() — langchain Function Reference
Architecture documentation for the acreate_assistant() function in base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 0f5c9475_3691_d056_8802_a7822050a218["acreate_assistant()"] 09337f8e_7eda_ea1a_ab7c_b599191c842b["OpenAIAssistantRunnable"] 0f5c9475_3691_d056_8802_a7822050a218 -->|defined in| 09337f8e_7eda_ea1a_ab7c_b599191c842b d6532dd4_8f84_ba8d_106d_016c747876a7["_get_openai_async_client()"] 0f5c9475_3691_d056_8802_a7822050a218 -->|calls| d6532dd4_8f84_ba8d_106d_016c747876a7 5f87b6cf_7369_e43d_b38f_8a427415879c["_get_assistants_tool()"] 0f5c9475_3691_d056_8802_a7822050a218 -->|calls| 5f87b6cf_7369_e43d_b38f_8a427415879c style 0f5c9475_3691_d056_8802_a7822050a218 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/agents/openai_assistant/base.py lines 386–418
async def acreate_assistant(
cls,
name: str,
instructions: str,
tools: Sequence[BaseTool | dict],
model: str,
*,
async_client: openai.AsyncOpenAI | openai.AsyncAzureOpenAI | None = None,
**kwargs: Any,
) -> OpenAIAssistantRunnable:
"""Async create an AsyncOpenAI Assistant and instantiate the Runnable.
Args:
name: Assistant name.
instructions: Assistant instructions.
tools: Assistant tools. Can be passed in OpenAI format or as BaseTools.
model: Assistant model to use.
async_client: AsyncOpenAI client.
Will create default async_client if not specified.
**kwargs: Additional arguments.
Returns:
AsyncOpenAIAssistantRunnable configured to run using the created assistant.
"""
async_client = async_client or _get_openai_async_client()
openai_tools = [_get_assistants_tool(tool) for tool in tools]
assistant = await async_client.beta.assistants.create(
name=name,
instructions=instructions,
tools=openai_tools,
model=model,
)
return cls(assistant_id=assistant.id, async_client=async_client, **kwargs)
Domain
Subdomains
Source
Frequently Asked Questions
What does acreate_assistant() do?
acreate_assistant() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/openai_assistant/base.py.
Where is acreate_assistant() defined?
acreate_assistant() is defined in libs/langchain/langchain_classic/agents/openai_assistant/base.py at line 386.
What does acreate_assistant() call?
acreate_assistant() calls 2 function(s): _get_assistants_tool, _get_openai_async_client.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free