Skip to content
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
3 changes: 3 additions & 0 deletions ex_app/lib/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ async def call_model(
system_prompt_text += "Use the find_person_in_contacts tool to find a person's email address and location.\n"
if tool_enabled("find_details_of_current_user"):
system_prompt_text += "Use the find_details_of_current_user tool to find the current user's location.\n"

if task['input'].get('memories', None) is not None:
system_prompt_text += "You can remember things from other conversations with the user. If relevant, take into account the following memories:\n\n" + "\n".join(task['input']['memories']) + "\n\n"
# this is similar to customizing the create_react_agent with state_modifier, but is a lot more flexible
system_prompt = SystemMessage(
system_prompt_text.replace("{CURRENT_DATE}", current_date)
Expand Down
2 changes: 1 addition & 1 deletion ex_app/lib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ async def background_thread_task():
task = response["task"]
log(nc, LogLvl.INFO, 'New Task incoming')
log(nc, LogLvl.DEBUG, str(task))
log(nc, LogLvl.INFO, str({'input': task['input']['input'], 'confirmation': task['input']['confirmation'], 'conversation_token': '<skipped>'}))
log(nc, LogLvl.INFO, str({'input': task['input']['input'], 'confirmation': task['input']['confirmation'], 'conversation_token': '<skipped>', 'memories': task['input'].get('memories', None)}))
asyncio.create_task(handle_task(task, nc))


Expand Down
7 changes: 7 additions & 0 deletions ex_app/lib/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,12 @@
description="Used tools",
shape_type=ShapeType.LIST_OF_TEXTS
)
],
optional_input_shape= [
ShapeDescriptor(
name="memories",
description="Injected memories",
shape_type=ShapeType.LIST_OF_TEXTS
)
]
)
Loading