quantalogic 0.50.28__py3-none-any.whl → 0.50.29__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- quantalogic/agent.py +9 -11
- quantalogic/prompts/memory_compaction_prompt.j2 +16 -0
- {quantalogic-0.50.28.dist-info → quantalogic-0.50.29.dist-info}/METADATA +1 -1
- {quantalogic-0.50.28.dist-info → quantalogic-0.50.29.dist-info}/RECORD +7 -6
- {quantalogic-0.50.28.dist-info → quantalogic-0.50.29.dist-info}/LICENSE +0 -0
- {quantalogic-0.50.28.dist-info → quantalogic-0.50.29.dist-info}/WHEEL +0 -0
- {quantalogic-0.50.28.dist-info → quantalogic-0.50.29.dist-info}/entry_points.txt +0 -0
quantalogic/agent.py
CHANGED
@@ -562,17 +562,7 @@ class Agent(BaseModel):
|
|
562
562
|
Returns:
|
563
563
|
Generated summary text
|
564
564
|
"""
|
565
|
-
|
566
|
-
"Summarize the conversation concisely:\n"
|
567
|
-
"format in markdown:\n"
|
568
|
-
"<thinking>\n"
|
569
|
-
" - 1. **Completed Steps**: Briefly describe the steps.\n"
|
570
|
-
" - 2. **Variables Used**: List the variables.\n"
|
571
|
-
" - 3. **Progress Analysis**: Assess progress.\n"
|
572
|
-
"</thinking>\n"
|
573
|
-
"Keep the summary clear and actionable.\n"
|
574
|
-
)
|
575
|
-
|
565
|
+
# Format conversation history for the template
|
576
566
|
memory_copy = self.memory.memory.copy()
|
577
567
|
|
578
568
|
if len(memory_copy) < 3:
|
@@ -581,6 +571,14 @@ class Agent(BaseModel):
|
|
581
571
|
|
582
572
|
user_message = memory_copy.pop()
|
583
573
|
assistant_message = memory_copy.pop()
|
574
|
+
|
575
|
+
# Create summarization prompt using template
|
576
|
+
prompt_summary = self._render_template('memory_compaction_prompt.j2',
|
577
|
+
conversation_history="\n\n".join(
|
578
|
+
f"[{msg.role.upper()}]: {msg.content}"
|
579
|
+
for msg in memory_copy
|
580
|
+
))
|
581
|
+
|
584
582
|
summary = await self.model.async_generate_with_history(messages_history=memory_copy, prompt=prompt_summary)
|
585
583
|
|
586
584
|
# Remove last system message if present
|
@@ -0,0 +1,16 @@
|
|
1
|
+
You are an AI assistant tasked with summarizing a conversation history.
|
2
|
+
|
3
|
+
Create a concise summary that captures the essential information from the conversation, focusing on:
|
4
|
+
1. The main task or problem being solved
|
5
|
+
2. Key information discovered or shared
|
6
|
+
3. Important decisions made
|
7
|
+
4. Current status or progress
|
8
|
+
|
9
|
+
Guidelines:
|
10
|
+
- Be factual and objective
|
11
|
+
- Preserve critical details and context
|
12
|
+
- Focus on information that would be needed to continue the task
|
13
|
+
- Aim for a summary that is about 20% of the original length
|
14
|
+
|
15
|
+
Conversation History:
|
16
|
+
{{ conversation_history }}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
quantalogic/__init__.py,sha256=BcM0DKB86DijMFtht9YTBdWyzh81zU7E5fhNLFiP260,869
|
2
|
-
quantalogic/agent.py,sha256=
|
2
|
+
quantalogic/agent.py,sha256=4XKUVAW4tnNwmdcwWbz9HjWe5CRWeouaC7Xlq-7CSHU,41129
|
3
3
|
quantalogic/agent_config.py,sha256=fPyMfm77BzimyfyFkTzb2ZdyZtGlr2fq5aTRETu77Vs,8202
|
4
4
|
quantalogic/agent_factory.py,sha256=LO0qsFtHxU7lcEi8dn-nDHhkh6Dl8Is6sP_3f1ap_Vg,6251
|
5
5
|
quantalogic/coding_agent.py,sha256=A-firiPWQjMC56B329Ne606_v2GsoF5-nxcuz3rVbYM,5496
|
@@ -25,6 +25,7 @@ quantalogic/model_info.py,sha256=j7QqvjEFQDGpDOgQs8uTkVyI3a50Oa_nrsQjyxizTLc,272
|
|
25
25
|
quantalogic/model_info_list.py,sha256=Xeeb7QS4xEpe9ke7Guh0CxEx-Hl59U4kC-qzVts-eAU,2437
|
26
26
|
quantalogic/model_info_litellm.py,sha256=Uoo8ZATjqH6POnTE3Ee3kfHfFllPYp8LkvJwlJjFZH8,2089
|
27
27
|
quantalogic/model_names.py,sha256=UZlz25zG9B2dpfwdw_e1Gw5qFsKQ7iME9FJh9Ts4u6s,938
|
28
|
+
quantalogic/prompts/memory_compaction_prompt.j2,sha256=Xsy9XKN7zxL4wNnNjWWlUjYjmtktgtee5dDG4dSvRW8,569
|
28
29
|
quantalogic/prompts/observation_response_format.j2,sha256=lvyveAJbXbc94aIvHgppKyaD9Tf7X5bCTGWjh51BDjI,1655
|
29
30
|
quantalogic/prompts/repeated_tool_call_error.j2,sha256=IRENR3a3D28Dtys-kGDP-x_uSkJnxeQZ5-jYHWv_3G4,319
|
30
31
|
quantalogic/prompts/system_prompt.j2,sha256=L2yBvUhCnKs25VJ4FuC_9sRyR4biVxbiHGvDVMJUclE,2767
|
@@ -160,8 +161,8 @@ quantalogic/version_check.py,sha256=JyQFTNMDWtpHCLnN-BiakzB2cyXf6kUFsTjvmSruZi4,
|
|
160
161
|
quantalogic/welcome_message.py,sha256=o4tHdgabNuIV9kbIDPgS3_2yzJhayK30oKad2UouYDc,3020
|
161
162
|
quantalogic/xml_parser.py,sha256=AKuMdJC3QAX3Z_tErHVlZ-msjPemWaZUFiTwkHz76jg,11614
|
162
163
|
quantalogic/xml_tool_parser.py,sha256=Vz4LEgDbelJynD1siLOVkJ3gLlfHsUk65_gCwbYJyGc,3784
|
163
|
-
quantalogic-0.50.
|
164
|
-
quantalogic-0.50.
|
165
|
-
quantalogic-0.50.
|
166
|
-
quantalogic-0.50.
|
167
|
-
quantalogic-0.50.
|
164
|
+
quantalogic-0.50.29.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
165
|
+
quantalogic-0.50.29.dist-info/METADATA,sha256=tqXwFAeuCEdNr3gA2-rqG_xUk8nEh1QtbQ7A_5p4GKs,23848
|
166
|
+
quantalogic-0.50.29.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
167
|
+
quantalogic-0.50.29.dist-info/entry_points.txt,sha256=h74O_Q3qBRCrDR99qvwB4BpBGzASPUIjCfxHq6Qnups,183
|
168
|
+
quantalogic-0.50.29.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|