Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow system message with function usage #163

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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