feat(backend): Improve SmartDecisionMaker Agent-loop capability & add Anthropics support

This commit is contained in:
Zamil Majdy
2025-03-06 15:42:54 +07:00
parent b0f6b93d86
commit 8cba27c7c4
2 changed files with 7 additions and 2 deletions

View File

@@ -381,7 +381,6 @@ def llm_call(
client = anthropic.Anthropic(api_key=credentials.api_key.get_secret_value())
try:
print(">>>>>> messages", json.dumps(messages))
resp = client.messages.create(
model=llm_model.value,
system=sysprompt,

View File

@@ -145,7 +145,13 @@ class SmartDecisionMakerBlock(Block):
credentials: llm.AICredentials = llm.AICredentialsField()
sys_prompt: str = SchemaField(
title="System Prompt",
default="Thinking carefully step by step decide which function to call. Always choose a function call from the list of function signatures, and always provide the complete argument provided with the type matching the required jsonschema signature, no missing argument is allowed. If you have already completed the task objective, you can end the task by providing the end result of your work as a finish message.",
default="Thinking carefully step by step decide which function to call. "
"Always choose a function call from the list of function signatures, "
"and always provide the complete argument provided with the type "
"matching the required jsonschema signature, no missing argument is allowed. "
"If you have already completed the task objective, you can end the task "
"by providing the end result of your work as a finish message. "
"Only provide EXACTLY one function call, multiple tool calls is strictly prohibited.",
description="The system prompt to provide additional context to the model.",
)
conversation_history: list[dict] = SchemaField(