Skip to content

Commit

Permalink
fix: allow system message with function usage (#163)
Browse files Browse the repository at this point in the history
Co-authored-by: Anton Dubovik <[email protected]>
  • Loading branch information
roman-romanov-o and adubovik authored Oct 21, 2024
1 parent ba7ccde commit 7f74bd3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
4 changes: 3 additions & 1 deletion aidial_adapter_bedrock/llm/model/claude/v3/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
from aidial_adapter_bedrock.llm.errors import ValidationError
from aidial_adapter_bedrock.llm.message import (
AIFunctionCallMessage,
AIRegularMessage,
AIToolCallMessage,
BaseMessage,
HumanFunctionResultMessage,
HumanRegularMessage,
HumanToolResultMessage,
SystemMessage,
ToolMessage,
)
from aidial_adapter_bedrock.llm.tools.tools_config import ToolsMode
Expand Down Expand Up @@ -73,7 +75,7 @@ def process_with_tools(
return message
elif tools_mode == ToolsMode.FUNCTIONS:
match message:
case HumanRegularMessage():
case SystemMessage() | HumanRegularMessage() | AIRegularMessage():
return message
case HumanToolResultMessage() | AIToolCallMessage():
raise ValidationError(
Expand Down
20 changes: 11 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ boto3 = "1.28.57"
botocore = "1.31.57"
aidial-sdk = {version = "0.13.0", extras = ["telemetry"]}
anthropic = {version = "0.28.1", extras = ["bedrock"]}
fastapi = "0.109.2"
fastapi = "0.115.2"
openai = "1.13.3"
uvicorn = "0.23.2"
pydantic = "1.10.13"
Expand Down

0 comments on commit 7f74bd3

Please sign in to comment.