praisonaiagents 0.0.70__py3-none-any.whl → 0.0.71__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.
@@ -520,8 +520,16 @@ class LLM:
520
520
  if ('name' in json_response or 'function' in json_response) and not any(word in response_text.lower() for word in ['summary', 'option', 'result', 'found']):
521
521
  logging.debug("Detected Ollama returning only tool call JSON, making follow-up call to process results")
522
522
 
523
- # Create a prompt that asks the model to process the tool results
524
- follow_up_prompt = f"I've searched for apartments and found these results. Please analyze them and provide a summary of the best options:\n\n{json.dumps(tool_result, indent=2)}\n\nPlease format your response as a nice summary with the top options."
523
+ # Create a prompt that asks the model to process the tool results based on original context
524
+ # Extract the original user query from messages
525
+ original_query = ""
526
+ for msg in messages:
527
+ if msg.get("role") == "user":
528
+ original_query = msg.get("content", "")
529
+ break
530
+
531
+ # Create a shorter follow-up prompt
532
+ follow_up_prompt = f"Results:\n{json.dumps(tool_result, indent=2)}\nProvide Answer to this Original Question based on the above results: '{original_query}'"
525
533
 
526
534
  # Make a follow-up call to process the results
527
535
  follow_up_messages = [
@@ -1091,8 +1099,16 @@ Output MUST be JSON with 'reflection' and 'satisfactory'.
1091
1099
  if ('name' in json_response or 'function' in json_response) and not any(word in response_text.lower() for word in ['summary', 'option', 'result', 'found']):
1092
1100
  logging.debug("Detected Ollama returning only tool call JSON in async mode, making follow-up call to process results")
1093
1101
 
1094
- # Create a prompt that asks the model to process the tool results
1095
- follow_up_prompt = f"I've searched for apartments and found these results. Please analyze them and provide a summary of the best options:\n\n{json.dumps(tool_result, indent=2)}\n\nPlease format your response as a nice summary with the top options."
1102
+ # Create a prompt that asks the model to process the tool results based on original context
1103
+ # Extract the original user query from messages
1104
+ original_query = ""
1105
+ for msg in messages:
1106
+ if msg.get("role") == "user":
1107
+ original_query = msg.get("content", "")
1108
+ break
1109
+
1110
+ # Create a shorter follow-up prompt
1111
+ follow_up_prompt = f"Results:\n{json.dumps(tool_result, indent=2)}\nProvide Answer to this Original Question based on the above results: '{original_query}'"
1096
1112
 
1097
1113
  # Make a follow-up call to process the results
1098
1114
  follow_up_messages = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: praisonaiagents
3
- Version: 0.0.70
3
+ Version: 0.0.71
4
4
  Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
5
5
  Author: Mervin Praison
6
6
  Requires-Dist: pydantic
@@ -10,7 +10,7 @@ praisonaiagents/knowledge/__init__.py,sha256=xL1Eh-a3xsHyIcU4foOWF-JdWYIYBALJH9b
10
10
  praisonaiagents/knowledge/chunking.py,sha256=FzoNY0q8MkvG4gADqk4JcRhmH3lcEHbRdonDgitQa30,6624
11
11
  praisonaiagents/knowledge/knowledge.py,sha256=fQNREDiwdoisfIxJBLVkteXgq_8Gbypfc3UaZbxf5QY,13210
12
12
  praisonaiagents/llm/__init__.py,sha256=ttPQQJQq6Tah-0updoEXDZFKWtJAM93rBWRoIgxRWO8,689
13
- praisonaiagents/llm/llm.py,sha256=tOdTbssYSBe-o0mA03Ocq_nJPisDZyD1K71qtzCoBRA,87065
13
+ praisonaiagents/llm/llm.py,sha256=1WjHumxzuc8sj81NQ4uVEIetUOrb-i58HYLQW7vjV3M,87921
14
14
  praisonaiagents/mcp/__init__.py,sha256=IkYdrAK1bDQDm_0t3Wjt63Zwv3_IJgqz84Wqz9GH2iQ,111
15
15
  praisonaiagents/mcp/mcp.py,sha256=BPPf5AIPXx28PaJJqOg6T3NRyymQH9YAD-Km7Ma9-KA,13681
16
16
  praisonaiagents/memory/memory.py,sha256=I8dOTkrl1i-GgQbDcrFOsSruzJ7MiI6Ys37DK27wrUs,35537
@@ -39,7 +39,7 @@ praisonaiagents/tools/xml_tools.py,sha256=iYTMBEk5l3L3ryQ1fkUnNVYK-Nnua2Kx2S0dxN
39
39
  praisonaiagents/tools/yaml_tools.py,sha256=uogAZrhXV9O7xvspAtcTfpKSQYL2nlOTvCQXN94-G9A,14215
40
40
  praisonaiagents/tools/yfinance_tools.py,sha256=s2PBj_1v7oQnOobo2fDbQBACEHl61ftG4beG6Z979ZE,8529
41
41
  praisonaiagents/tools/train/data/generatecot.py,sha256=H6bNh-E2hqL5MW6kX3hqZ05g9ETKN2-kudSjiuU_SD8,19403
42
- praisonaiagents-0.0.70.dist-info/METADATA,sha256=tHQAMvxoSDYguBJ3YDzjkHhHU1vUV6EzdPZ9btlk_Lo,856
43
- praisonaiagents-0.0.70.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
44
- praisonaiagents-0.0.70.dist-info/top_level.txt,sha256=_HsRddrJ23iDx5TTqVUVvXG2HeHBL5voshncAMDGjtA,16
45
- praisonaiagents-0.0.70.dist-info/RECORD,,
42
+ praisonaiagents-0.0.71.dist-info/METADATA,sha256=JepummUjGdEF74We-x0puLxcLsYmKL_BFVePXr-6Vr8,856
43
+ praisonaiagents-0.0.71.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
44
+ praisonaiagents-0.0.71.dist-info/top_level.txt,sha256=_HsRddrJ23iDx5TTqVUVvXG2HeHBL5voshncAMDGjtA,16
45
+ praisonaiagents-0.0.71.dist-info/RECORD,,