Home / Function/ _get_assistants_tool() — langchain Function Reference

_get_assistants_tool() — langchain Function Reference

Architecture documentation for the _get_assistants_tool() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  5f87b6cf_7369_e43d_b38f_8a427415879c["_get_assistants_tool()"]
  0331239a_f3d1_a093_b494_8cbb257ab96b["base.py"]
  5f87b6cf_7369_e43d_b38f_8a427415879c -->|defined in| 0331239a_f3d1_a093_b494_8cbb257ab96b
  9b0b4c70_d21f_7b00_336a_51e3a1be614e["create_assistant()"]
  9b0b4c70_d21f_7b00_336a_51e3a1be614e -->|calls| 5f87b6cf_7369_e43d_b38f_8a427415879c
  0f5c9475_3691_d056_8802_a7822050a218["acreate_assistant()"]
  0f5c9475_3691_d056_8802_a7822050a218 -->|calls| 5f87b6cf_7369_e43d_b38f_8a427415879c
  ebbbd915_8064_69e2_bdea_3d5363731ea5["_is_assistants_builtin_tool()"]
  5f87b6cf_7369_e43d_b38f_8a427415879c -->|calls| ebbbd915_8064_69e2_bdea_3d5363731ea5
  style 5f87b6cf_7369_e43d_b38f_8a427415879c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/openai_assistant/base.py lines 118–128

def _get_assistants_tool(
    tool: dict[str, Any] | type[BaseModel] | Callable | BaseTool,
) -> dict[str, Any]:
    """Convert a raw function/class to an OpenAI tool.

    Note that OpenAI assistants supports several built-in tools,
    such as "code_interpreter" and "file_search".
    """
    if _is_assistants_builtin_tool(tool):
        return tool  # type: ignore[return-value]
    return convert_to_openai_tool(tool)

Subdomains

Frequently Asked Questions

What does _get_assistants_tool() do?
_get_assistants_tool() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/openai_assistant/base.py.
Where is _get_assistants_tool() defined?
_get_assistants_tool() is defined in libs/langchain/langchain_classic/agents/openai_assistant/base.py at line 118.
What does _get_assistants_tool() call?
_get_assistants_tool() calls 1 function(s): _is_assistants_builtin_tool.
What calls _get_assistants_tool()?
_get_assistants_tool() is called by 2 function(s): acreate_assistant, create_assistant.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free