mirror of
https://github.com/mruwnik/memory.git
synced 2025-11-13 00:04:05 +01:00
properly handle bot prompts
This commit is contained in:
parent
afdff1708b
commit
9182f15c45
@ -260,11 +260,13 @@ def call_llm(
|
||||
if allowed_tools is not None:
|
||||
tools = {name: tool for name, tool in tools.items() if name in allowed_tools}
|
||||
|
||||
if bot_user.system_prompt:
|
||||
system_prompt = bot_user.system_prompt + "\n\n" + (system_prompt or "")
|
||||
message_content = [m.as_content() for m in prev_messages] + messages
|
||||
return provider.run_with_tools(
|
||||
messages=provider.as_messages(message_content),
|
||||
tools=tools,
|
||||
system_prompt=bot_user.system_prompt + "\n\n" + system_prompt,
|
||||
system_prompt=system_prompt,
|
||||
max_iterations=settings.DISCORD_MAX_TOOL_CALLS,
|
||||
).response
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user