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
30 changes: 26 additions & 4 deletions clients/brain_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,16 @@ def build_brain_runtime_context(
.to_runtime_xml()
)

runtime_memory = ""
search_result = ""
search_result_id = ""

if context is not None:
runtime_memory = getattr(
context,
"runtime_memory",
"",
)
search_result = getattr(
context,
"runtime_search_result",
Expand All @@ -497,8 +503,21 @@ def build_brain_runtime_context(
"",
)

runtime_context_parts = [
runtime_xml
]

if runtime_memory.strip():
runtime_context_parts.append(
"<RUNTIME_MEMORY>\n"
f"{indent_xml(escape(runtime_memory))}\n"
"</RUNTIME_MEMORY>"
)

if not search_result:
return runtime_xml
return "\n".join(
runtime_context_parts
)

search_result = strip_empty_results_xml(
search_result
Expand All @@ -523,9 +542,12 @@ def build_brain_runtime_context(
)

return (
runtime_xml
+ "\n"
+ tool_results_xml
"\n".join(
runtime_context_parts
+ [
tool_results_xml
]
)
)


Expand Down
98 changes: 0 additions & 98 deletions memory/local_json_memory.py

This file was deleted.

37 changes: 0 additions & 37 deletions memory/memory_base.py

This file was deleted.

Loading