Home / Function/ _await_for_run() — langchain Function Reference

_await_for_run() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  6853da8c_eafe_9e24_6bf3_38874b677745["_await_for_run()"]
  09337f8e_7eda_ea1a_ab7c_b599191c842b["OpenAIAssistantRunnable"]
  6853da8c_eafe_9e24_6bf3_38874b677745 -->|defined in| 09337f8e_7eda_ea1a_ab7c_b599191c842b
  666ede5f_25fb_4c54_fe54_dfae6937ed57["ainvoke()"]
  666ede5f_25fb_4c54_fe54_dfae6937ed57 -->|calls| 6853da8c_eafe_9e24_6bf3_38874b677745
  style 6853da8c_eafe_9e24_6bf3_38874b677745 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/openai_assistant/base.py lines 821–831

    async def _await_for_run(self, run_id: str, thread_id: str) -> Any:
        in_progress = True
        while in_progress:
            run = await self.async_client.beta.threads.runs.retrieve(
                run_id,
                thread_id=thread_id,
            )
            in_progress = run.status in ("in_progress", "queued")
            if in_progress:
                await asyncio.sleep(self.check_every_ms / 1000)
        return run

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free