Home / Function/ _get_openai_async_client() — langchain Function Reference

_get_openai_async_client() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  d6532dd4_8f84_ba8d_106d_016c747876a7["_get_openai_async_client()"]
  0331239a_f3d1_a093_b494_8cbb257ab96b["base.py"]
  d6532dd4_8f84_ba8d_106d_016c747876a7 -->|defined in| 0331239a_f3d1_a093_b494_8cbb257ab96b
  0f5c9475_3691_d056_8802_a7822050a218["acreate_assistant()"]
  0f5c9475_3691_d056_8802_a7822050a218 -->|calls| d6532dd4_8f84_ba8d_106d_016c747876a7
  style d6532dd4_8f84_ba8d_106d_016c747876a7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/openai_assistant/base.py lines 90–103

def _get_openai_async_client() -> openai.AsyncOpenAI:
    try:
        import openai

        return openai.AsyncOpenAI()
    except ImportError as e:
        msg = "Unable to import openai, please install with `pip install openai`."
        raise ImportError(msg) from e
    except AttributeError as e:
        msg = (
            "Please make sure you are using a v1.1-compatible version of openai. You "
            'can install with `pip install "openai>=1.1"`.'
        )
        raise AttributeError(msg) from e

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free