-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed message base and human message, and groq
- Loading branch information
Ishaan Gupta
committed
Oct 1, 2024
1 parent
7398ad0
commit 2a6d773
Showing
3 changed files
with
30 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 14 additions & 2 deletions
16
pkgs/swarmauri/swarmauri/messages/concrete/HumanMessage.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
from typing import Optional, Any, Literal | ||
from typing import Optional, Any, Literal, List | ||
from pydantic import Field | ||
from swarmauri.messages.base.MessageBase import MessageBase | ||
from typing import Union, Dict | ||
from typing_extensions import TypedDict | ||
# Define specific content types | ||
class TextContent(TypedDict): | ||
type: str | ||
text: str | ||
|
||
class ImageUrlContent(TypedDict): | ||
type: str | ||
image_url: Union[str, Dict] | ||
|
||
contentItem = Union[TextContent, ImageUrlContent] | ||
|
||
class HumanMessage(MessageBase): | ||
content: str | ||
content: Optional[Union[str, List[contentItem]]] | ||
role: str = Field(default='user') | ||
name: Optional[str] = None | ||
type: Literal['HumanMessage'] = 'HumanMessage' |