Home / Function/ get_system_message() — langchain Function Reference

get_system_message() — langchain Function Reference

Architecture documentation for the get_system_message() function in experimental.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  20030fef_5e64_fdb1_381b_8e6e638220f6["get_system_message()"]
  ce9a5118_b2cf_f25f_fad5_ea15575e8265["experimental.py"]
  20030fef_5e64_fdb1_381b_8e6e638220f6 -->|defined in| ce9a5118_b2cf_f25f_fad5_ea15575e8265
  d9058760_f9cc_3da0_3a92_1bff684072de["_get_type()"]
  20030fef_5e64_fdb1_381b_8e6e638220f6 -->|calls| d9058760_f9cc_3da0_3a92_1bff684072de
  style 20030fef_5e64_fdb1_381b_8e6e638220f6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/langchain_anthropic/experimental.py lines 53–82

def get_system_message(tools: list[dict]) -> str:
    """Generate a system message that describes the available tools."""
    tools_data: list[dict] = [
        {
            "tool_name": tool["name"],
            "tool_description": tool["description"],
            "formatted_parameters": "\n".join(
                [
                    TOOL_PARAMETER_FORMAT.format(
                        parameter_name=name,
                        parameter_type=_get_type(parameter),
                        parameter_description=parameter.get("description"),
                    )
                    for name, parameter in tool["parameters"]["properties"].items()
                ],
            ),
        }
        for tool in tools
    ]
    tools_formatted = "\n".join(
        [
            TOOL_FORMAT.format(
                tool_name=tool["tool_name"],
                tool_description=tool["tool_description"],
                formatted_parameters=tool["formatted_parameters"],
            )
            for tool in tools_data
        ],
    )
    return SYSTEM_PROMPT_FORMAT.format(formatted_tools=tools_formatted)

Domain

Subdomains

Calls

Frequently Asked Questions

What does get_system_message() do?
get_system_message() is a function in the langchain codebase, defined in libs/partners/anthropic/langchain_anthropic/experimental.py.
Where is get_system_message() defined?
get_system_message() is defined in libs/partners/anthropic/langchain_anthropic/experimental.py at line 53.
What does get_system_message() call?
get_system_message() calls 1 function(s): _get_type.

Analyze Your Own Codebase

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

Try Supermodel Free