Home / Class/ FunctionMessage Class — langchain Architecture

FunctionMessage Class — langchain Architecture

Architecture documentation for the FunctionMessage class in function.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  a35a7515_a449_3a02_0fd1_f8dca85deb8a["FunctionMessage"]
  abb7c122_ee7b_4c8f_ffaa_3d3d63c4fab7["BaseMessage"]
  a35a7515_a449_3a02_0fd1_f8dca85deb8a -->|extends| abb7c122_ee7b_4c8f_ffaa_3d3d63c4fab7
  8adc15f5_9ee8_45b7_b522_1efcda6042a1["function.py"]
  a35a7515_a449_3a02_0fd1_f8dca85deb8a -->|defined in| 8adc15f5_9ee8_45b7_b522_1efcda6042a1

Relationship Graph

Source Code

libs/core/langchain_core/messages/function.py lines 15–31

class FunctionMessage(BaseMessage):
    """Message for passing the result of executing a tool back to a model.

    `FunctionMessage` are an older version of the `ToolMessage` schema, and
    do not contain the `tool_call_id` field.

    The `tool_call_id` field is used to associate the tool call request with the
    tool call response. Useful in situations where a chat model is able
    to request multiple tool calls in parallel.

    """

    name: str
    """The name of the function that was executed."""

    type: Literal["function"] = "function"
    """The type of the message (used for serialization)."""

Extends

Frequently Asked Questions

What is the FunctionMessage class?
FunctionMessage is a class in the langchain codebase, defined in libs/core/langchain_core/messages/function.py.
Where is FunctionMessage defined?
FunctionMessage is defined in libs/core/langchain_core/messages/function.py at line 15.
What does FunctionMessage extend?
FunctionMessage extends BaseMessage.

Analyze Your Own Codebase

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

Try Supermodel Free