Home / Function/ test_groq_translate_content_with_executed_tools() — langchain Function Reference

test_groq_translate_content_with_executed_tools() — langchain Function Reference

Architecture documentation for the test_groq_translate_content_with_executed_tools() function in test_groq.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  f1659b41_99a1_d8ca_c65a_0f4f20c4876c["test_groq_translate_content_with_executed_tools()"]
  9858a811_d607_0538_c702_16bcd3e0f2c7["test_groq.py"]
  f1659b41_99a1_d8ca_c65a_0f4f20c4876c -->|defined in| 9858a811_d607_0538_c702_16bcd3e0f2c7
  style f1659b41_99a1_d8ca_c65a_0f4f20c4876c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/block_translators/test_groq.py lines 86–125

def test_groq_translate_content_with_executed_tools() -> None:
    """Test groq content translation with executed tools (built-in tools)."""
    # Test with executed_tools in additional_kwargs (Groq built-in tools)
    message = AIMessage(
        content="",
        additional_kwargs={
            "executed_tools": [
                {
                    "type": "python",
                    "arguments": '{"code": "print(\\"hello\\")"}',
                    "output": "hello\\n",
                }
            ]
        },
    )
    blocks = translate_content(message)

    assert isinstance(blocks, list)
    # Should have server_tool_call and server_tool_result
    assert len(blocks) >= 2

    # Check for server_tool_call
    tool_call_blocks = [
        cast("types.ServerToolCall", b)
        for b in blocks
        if b.get("type") == "server_tool_call"
    ]
    assert len(tool_call_blocks) == 1
    assert tool_call_blocks[0]["name"] == "code_interpreter"
    assert "code" in tool_call_blocks[0]["args"]

    # Check for server_tool_result
    tool_result_blocks = [
        cast("types.ServerToolResult", b)
        for b in blocks
        if b.get("type") == "server_tool_result"
    ]
    assert len(tool_result_blocks) == 1
    assert tool_result_blocks[0]["output"] == "hello\\n"
    assert tool_result_blocks[0]["status"] == "success"

Domain

Subdomains

Frequently Asked Questions

What does test_groq_translate_content_with_executed_tools() do?
test_groq_translate_content_with_executed_tools() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/block_translators/test_groq.py.
Where is test_groq_translate_content_with_executed_tools() defined?
test_groq_translate_content_with_executed_tools() is defined in libs/core/tests/unit_tests/messages/block_translators/test_groq.py at line 86.

Analyze Your Own Codebase

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

Try Supermodel Free