Home / Function/ _create_thread_and_run() — langchain Function Reference

_create_thread_and_run() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  7e21132d_9efa_50c9_67b3_696161b058a8["_create_thread_and_run()"]
  40171661_732e_8178_c8ae_92254ace13fe["OpenAIAssistantRunnable"]
  7e21132d_9efa_50c9_67b3_696161b058a8 -->|defined in| 40171661_732e_8178_c8ae_92254ace13fe
  addd6899_a5cd_0e3e_74c7_bb99653507b2["invoke()"]
  addd6899_a5cd_0e3e_74c7_bb99653507b2 -->|calls| 7e21132d_9efa_50c9_67b3_696161b058a8
  style 7e21132d_9efa_50c9_67b3_696161b058a8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/openai_assistant/base.py lines 566–587

    def _create_thread_and_run(self, input_dict: dict, thread: dict) -> Any:
        params = {
            k: v
            for k, v in input_dict.items()
            if k
            in (
                "instructions",
                "model",
                "tools",
                "parallel_tool_calls",
                "top_p",
                "temperature",
                "max_completion_tokens",
                "max_prompt_tokens",
                "run_metadata",
            )
        }
        return self.client.beta.threads.create_and_run(
            assistant_id=self.assistant_id,
            thread=thread,
            **params,
        )

Subdomains

Called By

Frequently Asked Questions

What does _create_thread_and_run() do?
_create_thread_and_run() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/openai_assistant/base.py.
Where is _create_thread_and_run() defined?
_create_thread_and_run() is defined in libs/langchain/langchain_classic/agents/openai_assistant/base.py at line 566.
What calls _create_thread_and_run()?
_create_thread_and_run() is called by 1 function(s): invoke.

Analyze Your Own Codebase

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

Try Supermodel Free