praisonaiagents 0.0.89__py3-none-any.whl → 0.0.90__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/agents/autoagents.py +6 -4
- praisonaiagents/main.py +2 -1
- praisonaiagents/process/process.py +2 -1
- praisonaiagents/task/task.py +12 -1
- {praisonaiagents-0.0.89.dist-info → praisonaiagents-0.0.90.dist-info}/METADATA +2 -1
- {praisonaiagents-0.0.89.dist-info → praisonaiagents-0.0.90.dist-info}/RECORD +8 -8
- {praisonaiagents-0.0.89.dist-info → praisonaiagents-0.0.90.dist-info}/WHEEL +0 -0
- {praisonaiagents-0.0.89.dist-info → praisonaiagents-0.0.90.dist-info}/top_level.txt +0 -0
@@ -8,10 +8,10 @@ It automatically handles agent creation, task setup, and execution flow.
|
|
8
8
|
from .agents import PraisonAIAgents
|
9
9
|
from ..agent.agent import Agent
|
10
10
|
from ..task.task import Task
|
11
|
-
from typing import List, Any, Optional, Dict
|
11
|
+
from typing import List, Any, Optional, Dict, Tuple
|
12
12
|
import logging
|
13
13
|
import os
|
14
|
-
from pydantic import BaseModel
|
14
|
+
from pydantic import BaseModel, ConfigDict
|
15
15
|
from ..main import display_instruction, display_tool_call, display_interaction, client
|
16
16
|
|
17
17
|
# Define Pydantic models for structured output
|
@@ -22,6 +22,7 @@ class TaskConfig(BaseModel):
|
|
22
22
|
tools: List[str]
|
23
23
|
|
24
24
|
class AgentConfig(BaseModel):
|
25
|
+
model_config = ConfigDict(arbitrary_types_allowed=True)
|
25
26
|
name: str
|
26
27
|
role: str
|
27
28
|
goal: str
|
@@ -30,6 +31,7 @@ class AgentConfig(BaseModel):
|
|
30
31
|
tasks: List[TaskConfig]
|
31
32
|
|
32
33
|
class AutoAgentsConfig(BaseModel):
|
34
|
+
model_config = ConfigDict(arbitrary_types_allowed=True)
|
33
35
|
main_instruction: str
|
34
36
|
process_type: str
|
35
37
|
agents: List[AgentConfig]
|
@@ -255,7 +257,7 @@ Return the configuration in a structured JSON format matching the AutoAgentsConf
|
|
255
257
|
logging.error(f"Error generating configuration: {e}")
|
256
258
|
raise
|
257
259
|
|
258
|
-
def _create_agents_and_tasks(self, config: AutoAgentsConfig) ->
|
260
|
+
def _create_agents_and_tasks(self, config: AutoAgentsConfig) -> Tuple[List[Agent], List[Task]]:
|
259
261
|
"""Create agents and tasks from configuration"""
|
260
262
|
agents = []
|
261
263
|
tasks = []
|
@@ -283,7 +285,7 @@ Return the configuration in a structured JSON format matching the AutoAgentsConf
|
|
283
285
|
respect_context_window=self.respect_context_window,
|
284
286
|
code_execution_mode=self.code_execution_mode,
|
285
287
|
embedder_config=self.embedder_config,
|
286
|
-
|
288
|
+
knowledge=self.knowledge_sources,
|
287
289
|
use_system_prompt=self.use_system_prompt,
|
288
290
|
cache=self.cache,
|
289
291
|
allow_delegation=self.allow_delegation,
|
praisonaiagents/main.py
CHANGED
@@ -4,7 +4,7 @@ import json
|
|
4
4
|
import logging
|
5
5
|
from typing import List, Optional, Dict, Any, Union, Literal, Type
|
6
6
|
from openai import OpenAI
|
7
|
-
from pydantic import BaseModel
|
7
|
+
from pydantic import BaseModel, ConfigDict
|
8
8
|
from rich import print
|
9
9
|
from rich.console import Console
|
10
10
|
from rich.panel import Panel
|
@@ -365,6 +365,7 @@ class ReflectionOutput(BaseModel):
|
|
365
365
|
client = OpenAI(api_key=(os.environ["OPENAI_API_KEY"] if os.environ.get("OPENAI_API_KEY") else "xxxx"))
|
366
366
|
|
367
367
|
class TaskOutput(BaseModel):
|
368
|
+
model_config = ConfigDict(arbitrary_types_allowed=True)
|
368
369
|
description: str
|
369
370
|
summary: Optional[str] = None
|
370
371
|
raw: str
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import logging
|
2
2
|
import asyncio
|
3
3
|
from typing import Dict, Optional, List, Any, AsyncGenerator
|
4
|
-
from pydantic import BaseModel
|
4
|
+
from pydantic import BaseModel, ConfigDict
|
5
5
|
from ..agent.agent import Agent
|
6
6
|
from ..task.task import Task
|
7
7
|
from ..main import display_error, client
|
@@ -9,6 +9,7 @@ import csv
|
|
9
9
|
import os
|
10
10
|
|
11
11
|
class LoopItems(BaseModel):
|
12
|
+
model_config = ConfigDict(arbitrary_types_allowed=True)
|
12
13
|
items: List[Any]
|
13
14
|
|
14
15
|
class Process:
|
praisonaiagents/task/task.py
CHANGED
@@ -215,9 +215,20 @@ class Task:
|
|
215
215
|
logger.info(f"Task {self.id}: Calculating quality metrics for output: {task_output.raw[:100]}...")
|
216
216
|
|
217
217
|
# Get quality metrics from LLM
|
218
|
+
# Determine which LLM model to use based on agent configuration
|
219
|
+
llm_model = None
|
220
|
+
if self.agent:
|
221
|
+
if getattr(self.agent, '_using_custom_llm', False) and hasattr(self.agent, 'llm_instance'):
|
222
|
+
# For custom LLM instances (like Ollama)
|
223
|
+
llm_model = self.agent.llm_instance
|
224
|
+
elif hasattr(self.agent, 'llm') and self.agent.llm:
|
225
|
+
# For standard model strings
|
226
|
+
llm_model = self.agent.llm
|
227
|
+
|
218
228
|
metrics = self.memory.calculate_quality_metrics(
|
219
229
|
task_output.raw,
|
220
|
-
self.expected_output
|
230
|
+
self.expected_output,
|
231
|
+
llm=llm_model
|
221
232
|
)
|
222
233
|
logger.info(f"Task {self.id}: Quality metrics calculated: {metrics}")
|
223
234
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: praisonaiagents
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.90
|
4
4
|
Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
|
5
5
|
Author: Mervin Praison
|
6
|
+
Requires-Python: >=3.10
|
6
7
|
Requires-Dist: pydantic
|
7
8
|
Requires-Dist: rich
|
8
9
|
Requires-Dist: openai
|
@@ -1,11 +1,11 @@
|
|
1
1
|
praisonaiagents/__init__.py,sha256=Z2_rSA6mYozz0r3ioUgKzl3QV8uWRDS_QaqPg2oGjqg,1324
|
2
|
-
praisonaiagents/main.py,sha256=
|
2
|
+
praisonaiagents/main.py,sha256=EsMRCT1tYjHH7hgoXov5s1caIBeRkpIPK8EZQsMKlw4,15138
|
3
3
|
praisonaiagents/agent/__init__.py,sha256=j0T19TVNbfZcClvpbZDDinQxZ0oORgsMrMqx16jZ-bA,128
|
4
4
|
praisonaiagents/agent/agent.py,sha256=-zENKxcaAWH5KJOed4KmcpAeBDNtRlxqG58QHdLH6RA,86334
|
5
5
|
praisonaiagents/agent/image_agent.py,sha256=-5MXG594HVwSpFMcidt16YBp7udtik-Cp7eXlzLE1fY,8696
|
6
6
|
praisonaiagents/agents/__init__.py,sha256=_1d6Pqyk9EoBSo7E68sKyd1jDRlN1vxvVIRpoMc0Jcw,168
|
7
7
|
praisonaiagents/agents/agents.py,sha256=lFWJDZeWQcr6RttV-pxvny-jfAM3UWiYjMnYo8pZYe0,59429
|
8
|
-
praisonaiagents/agents/autoagents.py,sha256=
|
8
|
+
praisonaiagents/agents/autoagents.py,sha256=Lc_b9mO2MeefBrsHkHoqFxEr5iRGrYuzDhslyybXwdw,13649
|
9
9
|
praisonaiagents/knowledge/__init__.py,sha256=xL1Eh-a3xsHyIcU4foOWF-JdWYIYBALJH9bge0Ujuto,246
|
10
10
|
praisonaiagents/knowledge/chunking.py,sha256=G6wyHa7_8V0_7VpnrrUXbEmUmptlT16ISJYaxmkSgmU,7678
|
11
11
|
praisonaiagents/knowledge/knowledge.py,sha256=Po0JZsgjYJrXdNSggmUGOWidZEF0f8xo4nhsZZfh8tY,13217
|
@@ -16,9 +16,9 @@ praisonaiagents/mcp/mcp.py,sha256=-U6md6zHoJZCWF8XFq921Yy5CcSNaGqvjg3aRT737LM,16
|
|
16
16
|
praisonaiagents/mcp/mcp_sse.py,sha256=DLh3F_aoVRM1X-7hgIOWOw4FQ1nGmn9YNbQTesykzn4,6792
|
17
17
|
praisonaiagents/memory/memory.py,sha256=I8dOTkrl1i-GgQbDcrFOsSruzJ7MiI6Ys37DK27wrUs,35537
|
18
18
|
praisonaiagents/process/__init__.py,sha256=lkYbL7Hn5a0ldvJtkdH23vfIIZLIcanK-65C0MwaorY,52
|
19
|
-
praisonaiagents/process/process.py,sha256=
|
19
|
+
praisonaiagents/process/process.py,sha256=7nGV-d9lDlQO6d7X4nMb7f6pMKCYNfoFzTrVvPrUefo,60179
|
20
20
|
praisonaiagents/task/__init__.py,sha256=VL5hXVmyGjINb34AalxpBMl-YW9m5EDcRkMTKkSSl7c,80
|
21
|
-
praisonaiagents/task/task.py,sha256=
|
21
|
+
praisonaiagents/task/task.py,sha256=JShYyMkAC1_bhEt0s0CXwJtQFXY6bNu-rlb0mHyyoXM,15034
|
22
22
|
praisonaiagents/tools/__init__.py,sha256=CWOYV9SudYY82r45LnNgaVRV3cmsAFdasNRkPrLsgmI,9198
|
23
23
|
praisonaiagents/tools/arxiv_tools.py,sha256=1stb31zTjLTon4jCnpZG5de9rKc9QWgC0leLegvPXWo,10528
|
24
24
|
praisonaiagents/tools/calculator_tools.py,sha256=S1xPT74Geurvjm52QMMIG29zDXVEWJmM6nmyY7yF298,9571
|
@@ -40,7 +40,7 @@ praisonaiagents/tools/xml_tools.py,sha256=iYTMBEk5l3L3ryQ1fkUnNVYK-Nnua2Kx2S0dxN
|
|
40
40
|
praisonaiagents/tools/yaml_tools.py,sha256=uogAZrhXV9O7xvspAtcTfpKSQYL2nlOTvCQXN94-G9A,14215
|
41
41
|
praisonaiagents/tools/yfinance_tools.py,sha256=s2PBj_1v7oQnOobo2fDbQBACEHl61ftG4beG6Z979ZE,8529
|
42
42
|
praisonaiagents/tools/train/data/generatecot.py,sha256=H6bNh-E2hqL5MW6kX3hqZ05g9ETKN2-kudSjiuU_SD8,19403
|
43
|
-
praisonaiagents-0.0.
|
44
|
-
praisonaiagents-0.0.
|
45
|
-
praisonaiagents-0.0.
|
46
|
-
praisonaiagents-0.0.
|
43
|
+
praisonaiagents-0.0.90.dist-info/METADATA,sha256=HrNS7WT3LB14TVihEpeYTvisD7XGxmZve7dmkiN-GzU,1268
|
44
|
+
praisonaiagents-0.0.90.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
45
|
+
praisonaiagents-0.0.90.dist-info/top_level.txt,sha256=_HsRddrJ23iDx5TTqVUVvXG2HeHBL5voshncAMDGjtA,16
|
46
|
+
praisonaiagents-0.0.90.dist-info/RECORD,,
|
File without changes
|
File without changes
|