Home / Function/ test_func_call_invalid() — langchain Function Reference

test_func_call_invalid() — langchain Function Reference

Architecture documentation for the test_func_call_invalid() function in test_openai_functions.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  11990c47_df45_9c40_61ca_472adbb49b31["test_func_call_invalid()"]
  1fe72b94_a8cc_d072_fc0a_71824fccb3c3["test_openai_functions.py"]
  11990c47_df45_9c40_61ca_472adbb49b31 -->|defined in| 1fe72b94_a8cc_d072_fc0a_71824fccb3c3
  style 11990c47_df45_9c40_61ca_472adbb49b31 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/agents/output_parsers/test_openai_functions.py lines 87–99

def test_func_call_invalid() -> None:
    parser = OpenAIFunctionsAgentOutputParser()
    msg = AIMessage(
        content="LLM thoughts.",
        additional_kwargs={"function_call": {"name": "foo", "arguments": "{42]"}},
    )

    err = (
        "Could not parse tool input: {'name': 'foo', 'arguments': '{42]'} "
        "because the `arguments` is not valid JSON."
    )
    with pytest.raises(OutputParserException, match=err):
        parser.invoke(msg)

Domain

Subdomains

Frequently Asked Questions

What does test_func_call_invalid() do?
test_func_call_invalid() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/output_parsers/test_openai_functions.py.
Where is test_func_call_invalid() defined?
test_func_call_invalid() is defined in libs/langchain/tests/unit_tests/agents/output_parsers/test_openai_functions.py at line 87.

Analyze Your Own Codebase

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

Try Supermodel Free