fix(call_model): add memories parameter to ensure memories are passed to agent
Browse files- workflow/tasks.py +6 -2
workflow/tasks.py
CHANGED
@@ -20,10 +20,14 @@ agent_with_tools = main_model.bind_tools(tools)
|
|
20 |
output_formatter = output_formatter_model.with_structured_output(OutputFormat)
|
21 |
|
22 |
@task
|
23 |
-
def call_model(messages: list[BaseMessage]):
|
24 |
"""Call model with a sequence of messages."""
|
25 |
response = agent_with_tools.invoke(
|
26 |
-
[
|
|
|
|
|
|
|
|
|
27 |
)
|
28 |
return response
|
29 |
|
|
|
20 |
output_formatter = output_formatter_model.with_structured_output(OutputFormat)
|
21 |
|
22 |
@task
|
23 |
+
def call_model(messages: list[BaseMessage], memories: str):
|
24 |
"""Call model with a sequence of messages."""
|
25 |
response = agent_with_tools.invoke(
|
26 |
+
[
|
27 |
+
SystemMessage(
|
28 |
+
content=MAKHFI_AI_PROMPT.format(memories=memories)
|
29 |
+
)
|
30 |
+
] + messages
|
31 |
)
|
32 |
return response
|
33 |
|