praisonaiagents 0.0.71__py3-none-any.whl → 0.0.73__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.
- praisonaiagents/agent/agent.py +5 -5
- praisonaiagents/agents/agents.py +6 -4
- {praisonaiagents-0.0.71.dist-info → praisonaiagents-0.0.73.dist-info}/METADATA +5 -2
- {praisonaiagents-0.0.71.dist-info → praisonaiagents-0.0.73.dist-info}/RECORD +6 -6
- {praisonaiagents-0.0.71.dist-info → praisonaiagents-0.0.73.dist-info}/WHEEL +0 -0
- {praisonaiagents-0.0.71.dist-info → praisonaiagents-0.0.73.dist-info}/top_level.txt +0 -0
praisonaiagents/agent/agent.py
CHANGED
@@ -770,7 +770,7 @@ Your Goal: {self.goal}
|
|
770
770
|
display_error(f"Error in chat completion: {e}")
|
771
771
|
return None
|
772
772
|
|
773
|
-
def chat(self, prompt, temperature=0.2, tools=None, output_json=None, output_pydantic=None, reasoning_steps=False):
|
773
|
+
def chat(self, prompt, temperature=0.2, tools=None, output_json=None, output_pydantic=None, reasoning_steps=False, stream=True):
|
774
774
|
# Log all parameter values when in debug mode
|
775
775
|
if logging.getLogger().getEffectiveLevel() == logging.DEBUG:
|
776
776
|
param_info = {
|
@@ -912,7 +912,7 @@ Your Goal: {self.goal}
|
|
912
912
|
agent_tools=agent_tools
|
913
913
|
)
|
914
914
|
|
915
|
-
response = self._chat_completion(messages, temperature=temperature, tools=tools if tools else None, reasoning_steps=reasoning_steps)
|
915
|
+
response = self._chat_completion(messages, temperature=temperature, tools=tools if tools else None, reasoning_steps=reasoning_steps, stream=stream)
|
916
916
|
if not response:
|
917
917
|
return None
|
918
918
|
|
@@ -949,7 +949,7 @@ Your Goal: {self.goal}
|
|
949
949
|
"content": "Function returned an empty output"
|
950
950
|
})
|
951
951
|
|
952
|
-
response = self._chat_completion(messages, temperature=temperature)
|
952
|
+
response = self._chat_completion(messages, temperature=temperature, stream=stream)
|
953
953
|
if not response:
|
954
954
|
return None
|
955
955
|
response_text = response.choices[0].message.content.strip()
|
@@ -1019,7 +1019,7 @@ Output MUST be JSON with 'reflection' and 'satisfactory'.
|
|
1019
1019
|
|
1020
1020
|
logging.debug(f"{self.name} reflection count {reflection_count + 1}, continuing reflection process")
|
1021
1021
|
messages.append({"role": "user", "content": "Now regenerate your response using the reflection you made"})
|
1022
|
-
response = self._chat_completion(messages, temperature=temperature, tools=None, stream=
|
1022
|
+
response = self._chat_completion(messages, temperature=temperature, tools=None, stream=stream)
|
1023
1023
|
response_text = response.choices[0].message.content.strip()
|
1024
1024
|
reflection_count += 1
|
1025
1025
|
continue # Continue the loop for more reflections
|
@@ -1199,7 +1199,7 @@ Your Goal: {self.goal}
|
|
1199
1199
|
model=self.llm,
|
1200
1200
|
messages=messages,
|
1201
1201
|
temperature=temperature,
|
1202
|
-
tools=formatted_tools
|
1202
|
+
tools=formatted_tools,
|
1203
1203
|
)
|
1204
1204
|
result = await self._achat_completion(response, tools)
|
1205
1205
|
if logging.getLogger().getEffectiveLevel() == logging.DEBUG:
|
praisonaiagents/agents/agents.py
CHANGED
@@ -45,7 +45,7 @@ def process_video(video_path: str, seconds_per_frame=2):
|
|
45
45
|
return base64_frames
|
46
46
|
|
47
47
|
class PraisonAIAgents:
|
48
|
-
def __init__(self, agents, tasks=None, verbose=0, completion_checker=None, max_retries=5, process="sequential", manager_llm=None, memory=False, memory_config=None, embedder=None, user_id=None, max_iter=10):
|
48
|
+
def __init__(self, agents, tasks=None, verbose=0, completion_checker=None, max_retries=5, process="sequential", manager_llm=None, memory=False, memory_config=None, embedder=None, user_id=None, max_iter=10, stream=True):
|
49
49
|
# Add check at the start if memory is requested
|
50
50
|
if memory:
|
51
51
|
try:
|
@@ -68,8 +68,8 @@ class PraisonAIAgents:
|
|
68
68
|
for agent in agents:
|
69
69
|
agent.user_id = self.user_id
|
70
70
|
|
71
|
-
self.agents = agents
|
72
|
-
self.tasks = {}
|
71
|
+
self.agents: List[Agent] = agents
|
72
|
+
self.tasks: Dict[int, Task] = {}
|
73
73
|
if max_retries < 3:
|
74
74
|
max_retries = 3
|
75
75
|
self.completion_checker = completion_checker if completion_checker else self.default_completion_checker
|
@@ -77,6 +77,7 @@ class PraisonAIAgents:
|
|
77
77
|
self.verbose = verbose
|
78
78
|
self.max_retries = max_retries
|
79
79
|
self.process = process
|
80
|
+
self.stream = stream
|
80
81
|
|
81
82
|
# Check for manager_llm in environment variable if not provided
|
82
83
|
self.manager_llm = manager_llm or os.getenv('OPENAI_MODEL_NAME', 'gpt-4o')
|
@@ -665,7 +666,8 @@ Context:
|
|
665
666
|
task_prompt,
|
666
667
|
tools=task.tools,
|
667
668
|
output_json=task.output_json,
|
668
|
-
output_pydantic=task.output_pydantic
|
669
|
+
output_pydantic=task.output_pydantic,
|
670
|
+
stream=self.stream,
|
669
671
|
)
|
670
672
|
|
671
673
|
if agent_output:
|
@@ -1,12 +1,14 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: praisonaiagents
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.73
|
4
4
|
Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
|
5
5
|
Author: Mervin Praison
|
6
6
|
Requires-Dist: pydantic
|
7
7
|
Requires-Dist: rich
|
8
8
|
Requires-Dist: openai
|
9
|
-
Requires-Dist: mcp
|
9
|
+
Requires-Dist: mcp>=1.6.0
|
10
|
+
Provides-Extra: mcp
|
11
|
+
Requires-Dist: mcp>=1.6.0; extra == "mcp"
|
10
12
|
Provides-Extra: memory
|
11
13
|
Requires-Dist: chromadb>=0.5.23; extra == "memory"
|
12
14
|
Provides-Extra: knowledge
|
@@ -21,3 +23,4 @@ Provides-Extra: all
|
|
21
23
|
Requires-Dist: praisonaiagents[memory]; extra == "all"
|
22
24
|
Requires-Dist: praisonaiagents[knowledge]; extra == "all"
|
23
25
|
Requires-Dist: praisonaiagents[llm]; extra == "all"
|
26
|
+
Requires-Dist: praisonaiagents[mcp]; extra == "all"
|
@@ -1,10 +1,10 @@
|
|
1
1
|
praisonaiagents/__init__.py,sha256=Z2_rSA6mYozz0r3ioUgKzl3QV8uWRDS_QaqPg2oGjqg,1324
|
2
2
|
praisonaiagents/main.py,sha256=l29nGEbV2ReBi4szURbnH0Fk0w2F_QZTmECysyZjYcA,15066
|
3
3
|
praisonaiagents/agent/__init__.py,sha256=j0T19TVNbfZcClvpbZDDinQxZ0oORgsMrMqx16jZ-bA,128
|
4
|
-
praisonaiagents/agent/agent.py,sha256=
|
4
|
+
praisonaiagents/agent/agent.py,sha256=nxi_39Zr75IEdb7Iv6cofZICYwEbD9Jritw_R6cQHGk,65851
|
5
5
|
praisonaiagents/agent/image_agent.py,sha256=-5MXG594HVwSpFMcidt16YBp7udtik-Cp7eXlzLE1fY,8696
|
6
6
|
praisonaiagents/agents/__init__.py,sha256=_1d6Pqyk9EoBSo7E68sKyd1jDRlN1vxvVIRpoMc0Jcw,168
|
7
|
-
praisonaiagents/agents/agents.py,sha256=
|
7
|
+
praisonaiagents/agents/agents.py,sha256=uAOHyn77noFvg3sYVFRhQUuc1LDpCMpfLND8CKOXAd4,37971
|
8
8
|
praisonaiagents/agents/autoagents.py,sha256=olYDn--rlJp-SckxILqmREkkgNlzCgEEcAUzfMj-54E,13518
|
9
9
|
praisonaiagents/knowledge/__init__.py,sha256=xL1Eh-a3xsHyIcU4foOWF-JdWYIYBALJH9bge0Ujuto,246
|
10
10
|
praisonaiagents/knowledge/chunking.py,sha256=FzoNY0q8MkvG4gADqk4JcRhmH3lcEHbRdonDgitQa30,6624
|
@@ -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.
|
43
|
-
praisonaiagents-0.0.
|
44
|
-
praisonaiagents-0.0.
|
45
|
-
praisonaiagents-0.0.
|
42
|
+
praisonaiagents-0.0.73.dist-info/METADATA,sha256=6Cwjw1SNW5j4ribad7S2mOlXZKW9o_6HRJhFSBVKmPY,970
|
43
|
+
praisonaiagents-0.0.73.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
44
|
+
praisonaiagents-0.0.73.dist-info/top_level.txt,sha256=_HsRddrJ23iDx5TTqVUVvXG2HeHBL5voshncAMDGjtA,16
|
45
|
+
praisonaiagents-0.0.73.dist-info/RECORD,,
|
File without changes
|
File without changes
|