Skip to content
Snippets Groups Projects
Unverified Commit c94505ab authored by Logan's avatar Logan Committed by GitHub
Browse files

anthropic system prompt (#13131)

parent 71ed6f1f
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,7 @@ def messages_to_anthropic_messages(
system_prompt = ""
for message in messages:
if message.role == MessageRole.SYSTEM:
system_prompt = message.content
system_prompt += message.content + "\n"
elif message.role == MessageRole.FUNCTION or message.role == MessageRole.TOOL:
content = ToolResultBlockParam(
tool_use_id=message.additional_kwargs["tool_call_id"],
......@@ -105,7 +105,7 @@ def messages_to_anthropic_messages(
)
anthropic_messages.append(anth_message)
return __merge_common_role_msgs(anthropic_messages), system_prompt
return __merge_common_role_msgs(anthropic_messages), system_prompt.strip()
# Function used in bedrock
......
......@@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
license = "MIT"
name = "llama-index-llms-anthropic"
readme = "README.md"
version = "0.1.10"
version = "0.1.11"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment