langchain_core.messages.function
.FunctionMessageChunk¶
- class langchain_core.messages.function.FunctionMessageChunk[source]¶
Bases:
FunctionMessage
,BaseMessageChunk
Function Message chunk.
Pass in content as positional arg.
- Parameters
content – The string contents of the message.
kwargs – Additional fields to pass to the
- param additional_kwargs: dict [Optional]¶
Reserved for additional payload data associated with the message.
For example, for a message from an AI, this could include tool calls as encoded by the model provider.
- param content: Union[str, List[Union[str, Dict]]] [Required]¶
The string contents of the message.
- param id: Optional[str] = None¶
An optional unique identifier for the message. This should ideally be provided by the provider/model which created the message.
- param name: str [Required]¶
The name of the function that was executed.
- param response_metadata: dict [Optional]¶
Response metadata. For example: response headers, logprobs, token counts.
- param type: Literal['FunctionMessageChunk'] = 'FunctionMessageChunk'¶
The type of the message (used for serialization). Defaults to “FunctionMessageChunk”.
- pretty_print() None ¶
- Return type
None
- pretty_repr(html: bool = False) str ¶
Get a pretty representation of the message.
- Parameters
html (bool) – Whether to format the message as HTML. If True, the message will be formatted with HTML tags. Default is False.
- Returns
A pretty representation of the message.
- Return type
str