Home / Function/ _lc_tool_call_to_hf_tool_call() — langchain Function Reference

_lc_tool_call_to_hf_tool_call() — langchain Function Reference

Architecture documentation for the _lc_tool_call_to_hf_tool_call() function in huggingface.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  41b39e2b_8d97_4cd7_2e4c_48ac19f2d8e7["_lc_tool_call_to_hf_tool_call()"]
  d84d1503_7d4c_e393_0d48_409c5faa5e2d["huggingface.py"]
  41b39e2b_8d97_4cd7_2e4c_48ac19f2d8e7 -->|defined in| d84d1503_7d4c_e393_0d48_409c5faa5e2d
  afa2f960_1285_3e53_3b4d_ef08d41d03d1["_convert_message_to_dict()"]
  afa2f960_1285_3e53_3b4d_ef08d41d03d1 -->|calls| 41b39e2b_8d97_4cd7_2e4c_48ac19f2d8e7
  style 41b39e2b_8d97_4cd7_2e4c_48ac19f2d8e7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/huggingface/langchain_huggingface/chat_models/huggingface.py lines 101–109

def _lc_tool_call_to_hf_tool_call(tool_call: ToolCall) -> dict:
    return {
        "type": "function",
        "id": tool_call["id"],
        "function": {
            "name": tool_call["name"],
            "arguments": json.dumps(tool_call["args"], ensure_ascii=False),
        },
    }

Domain

Subdomains

Frequently Asked Questions

What does _lc_tool_call_to_hf_tool_call() do?
_lc_tool_call_to_hf_tool_call() is a function in the langchain codebase, defined in libs/partners/huggingface/langchain_huggingface/chat_models/huggingface.py.
Where is _lc_tool_call_to_hf_tool_call() defined?
_lc_tool_call_to_hf_tool_call() is defined in libs/partners/huggingface/langchain_huggingface/chat_models/huggingface.py at line 101.
What calls _lc_tool_call_to_hf_tool_call()?
_lc_tool_call_to_hf_tool_call() is called by 1 function(s): _convert_message_to_dict.

Analyze Your Own Codebase

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

Try Supermodel Free