This commit is contained in:
Mason Daugherty
2025-08-25 14:22:47 -04:00
parent 4d19be3ec9
commit ee7391ba79
4 changed files with 30 additions and 9 deletions

View File

@@ -184,10 +184,16 @@ class AIMessage(BaseMessage):
**kwargs: Any,
) -> None: ...
def __init__(
self,
content: Union[str, list[Union[str, dict]]],
**kwargs: Any,
) -> None:
"""Initialize AIMessage.
Args:
content: The content of the message.
kwargs: Additional arguments to pass to the parent class.
"""
super().__init__(content=content, **kwargs)

View File

@@ -74,9 +74,15 @@ class BaseMessage(Serializable):
**kwargs: Any,
) -> None: ...
def __init__(
self,
content: Union[str, list[Union[str, dict]]],
**kwargs: Any,
) -> None:
"""Initialize BaseMessage.
Args:
content: The string contents of the message.
"""
super().__init__(content=content, **kwargs)

View File

@@ -1,8 +1,7 @@
"""Human message."""
from typing import Any, Literal, Optional, Union, cast, overload
from typing import Any, Literal, Union, overload
from langchain_core.messages import content as types
from langchain_core.messages.base import BaseMessage, BaseMessageChunk
@@ -54,10 +53,16 @@ class HumanMessage(BaseMessage):
**kwargs: Any,
) -> None: ...
def __init__(
self,
content: Union[str, list[Union[str, dict]]],
**kwargs: Any,
) -> None:
"""Initialize HumanMessage.
Args:
content: The string contents of the message.
kwargs: Additional fields to pass to the message.
"""
super().__init__(content=content, **kwargs)

View File

@@ -1,15 +1,13 @@
"""Messages for tools."""
import json
from typing import Any, Literal, Optional, Union, cast, overload
from typing import Any, Literal, Optional, Union, overload
from uuid import UUID
from pydantic import Field, model_validator
from typing_extensions import NotRequired, TypedDict, override
from langchain_core.messages import content as types
from langchain_core.messages.base import BaseMessage, BaseMessageChunk, merge_content
from langchain_core.messages.content import InvalidToolCall as InvalidToolCall
from langchain_core.utils._merge import merge_dicts, merge_obj
@@ -150,10 +148,16 @@ class ToolMessage(BaseMessage, ToolOutputMixin):
**kwargs: Any,
) -> None: ...
def __init__(
self,
content: Union[str, list[Union[str, dict]]],
**kwargs: Any,
) -> None:
"""Initialize ToolMessage.
Args:
content: The string contents of the message.
**kwargs: Additional fields.
"""
super().__init__(content=content, **kwargs)