Home / Function/ test_func_call() — langchain Function Reference

test_func_call() — langchain Function Reference

Architecture documentation for the test_func_call() function in test_openai_functions_multi.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c69a3e4d_fa4a_7304_56d3_028afc0d8367["test_func_call()"]
  744eb6ed_e970_902c_3b2f_989585354200["TestParseAIMessage"]
  c69a3e4d_fa4a_7304_56d3_028afc0d8367 -->|defined in| 744eb6ed_e970_902c_3b2f_989585354200
  style c69a3e4d_fa4a_7304_56d3_028afc0d8367 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/agents/test_openai_functions_multi.py lines 32–53

    def test_func_call(self) -> None:
        act = json.dumps([{"action_name": "foo", "action": {"param": 42}}])

        msg = AIMessage(
            content="LLM thoughts.",
            additional_kwargs={
                "function_call": {"name": "foo", "arguments": f'{{"actions": {act}}}'},
            },
        )
        result = _parse_ai_message(msg)

        assert isinstance(result, list)
        assert len(result) == 1

        action = result[0]
        assert isinstance(action, _FunctionsAgentAction)
        assert action.tool == "foo"
        assert action.tool_input == {"param": 42}
        assert action.log == (
            "\nInvoking: `foo` with `{'param': 42}`\nresponded: LLM thoughts.\n\n"
        )
        assert action.message_log == [msg]

Domain

Subdomains

Frequently Asked Questions

What does test_func_call() do?
test_func_call() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/test_openai_functions_multi.py.
Where is test_func_call() defined?
test_func_call() is defined in libs/langchain/tests/unit_tests/agents/test_openai_functions_multi.py at line 32.

Analyze Your Own Codebase

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

Try Supermodel Free