Home / Function/ _lc_tool_call_to_openai_tool_call() — langchain Function Reference

_lc_tool_call_to_openai_tool_call() — langchain Function Reference

Architecture documentation for the _lc_tool_call_to_openai_tool_call() function in chat_models.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  02cfbd90_3b04_1f57_a91d_7ca895ebd98c["_lc_tool_call_to_openai_tool_call()"]
  5b41b5a0_b415_2ecd_9522_191ca69202ca["chat_models.py"]
  02cfbd90_3b04_1f57_a91d_7ca895ebd98c -->|defined in| 5b41b5a0_b415_2ecd_9522_191ca69202ca
  24455ecf_f2a0_74af_3dc1_500c0b6a35fa["_convert_messages_to_ollama_messages()"]
  24455ecf_f2a0_74af_3dc1_500c0b6a35fa -->|calls| 02cfbd90_3b04_1f57_a91d_7ca895ebd98c
  style 02cfbd90_3b04_1f57_a91d_7ca895ebd98c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/ollama/langchain_ollama/chat_models.py lines 228–237

def _lc_tool_call_to_openai_tool_call(tool_call_: ToolCall) -> dict:
    """Convert a LangChain tool call to an OpenAI tool call format."""
    return {
        "type": "function",
        "id": tool_call_["id"],
        "function": {
            "name": tool_call_["name"],
            "arguments": tool_call_["args"],
        },
    }

Domain

Subdomains

Frequently Asked Questions

What does _lc_tool_call_to_openai_tool_call() do?
_lc_tool_call_to_openai_tool_call() is a function in the langchain codebase, defined in libs/partners/ollama/langchain_ollama/chat_models.py.
Where is _lc_tool_call_to_openai_tool_call() defined?
_lc_tool_call_to_openai_tool_call() is defined in libs/partners/ollama/langchain_ollama/chat_models.py at line 228.
What calls _lc_tool_call_to_openai_tool_call()?
_lc_tool_call_to_openai_tool_call() is called by 1 function(s): _convert_messages_to_ollama_messages.

Analyze Your Own Codebase

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

Try Supermodel Free