praisonaiagents 0.0.121__tar.gz → 0.0.122__tar.gz
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-0.0.121 → praisonaiagents-0.0.122}/PKG-INFO +1 -1
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/agent/agent.py +36 -21
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/agents/autoagents.py +181 -73
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents.egg-info/PKG-INFO +1 -1
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/pyproject.toml +1 -1
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/README.md +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/__init__.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/agent/__init__.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/agent/handoff.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/agent/image_agent.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/agents/__init__.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/agents/agents.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/approval.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/guardrails/__init__.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/guardrails/guardrail_result.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/guardrails/llm_guardrail.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/knowledge/__init__.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/knowledge/chunking.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/knowledge/knowledge.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/llm/__init__.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/llm/llm.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/llm/openai_client.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/main.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/mcp/__init__.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/mcp/mcp.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/mcp/mcp_sse.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/memory/__init__.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/memory/memory.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/process/__init__.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/process/process.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/session.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/task/__init__.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/task/task.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/telemetry/__init__.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/telemetry/integration.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/telemetry/telemetry.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/README.md +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/__init__.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/arxiv_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/calculator_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/csv_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/duckdb_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/duckduckgo_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/excel_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/file_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/json_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/newspaper_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/pandas_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/python_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/searxng_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/shell_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/spider_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/test.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/train/data/generatecot.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/wikipedia_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/xml_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/yaml_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/yfinance_tools.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents.egg-info/SOURCES.txt +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents.egg-info/dependency_links.txt +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents.egg-info/requires.txt +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents.egg-info/top_level.txt +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/setup.cfg +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/tests/test-graph-memory.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/tests/test.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/tests/test_handoff_compatibility.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/tests/test_ollama_async_fix.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/tests/test_ollama_fix.py +0 -0
- {praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/tests/test_posthog_fixed.py +0 -0
@@ -1274,27 +1274,40 @@ Output MUST be JSON with 'reflection' and 'satisfactory'.
|
|
1274
1274
|
messages.append({"role": "user", "content": reflection_prompt})
|
1275
1275
|
|
1276
1276
|
try:
|
1277
|
-
# Check if
|
1278
|
-
if self._openai_client is None:
|
1279
|
-
# For custom LLMs,
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1277
|
+
# Check if we're using a custom LLM (like Gemini)
|
1278
|
+
if self._using_custom_llm or self._openai_client is None:
|
1279
|
+
# For custom LLMs, we need to handle reflection differently
|
1280
|
+
# Use non-streaming to get complete JSON response
|
1281
|
+
reflection_response = self._chat_completion(messages, temperature=temperature, tools=None, stream=False, reasoning_steps=False)
|
1282
|
+
|
1283
|
+
if not reflection_response or not reflection_response.choices:
|
1284
|
+
raise Exception("No response from reflection request")
|
1285
|
+
|
1286
|
+
reflection_text = reflection_response.choices[0].message.content.strip()
|
1287
|
+
|
1288
|
+
# Clean the JSON output
|
1289
|
+
cleaned_json = self.clean_json_output(reflection_text)
|
1290
|
+
|
1291
|
+
# Parse the JSON manually
|
1292
|
+
reflection_data = json.loads(cleaned_json)
|
1293
|
+
|
1294
|
+
# Create a reflection output object manually
|
1295
|
+
class CustomReflectionOutput:
|
1296
|
+
def __init__(self, data):
|
1297
|
+
self.reflection = data.get('reflection', '')
|
1298
|
+
self.satisfactory = data.get('satisfactory', 'no').lower()
|
1299
|
+
|
1300
|
+
reflection_output = CustomReflectionOutput(reflection_data)
|
1301
|
+
else:
|
1302
|
+
# Use OpenAI's structured output for OpenAI models
|
1303
|
+
reflection_response = self._openai_client.sync_client.beta.chat.completions.parse(
|
1304
|
+
model=self.reflect_llm if self.reflect_llm else self.llm,
|
1305
|
+
messages=messages,
|
1306
|
+
temperature=temperature,
|
1307
|
+
response_format=ReflectionOutput
|
1308
|
+
)
|
1296
1309
|
|
1297
|
-
|
1310
|
+
reflection_output = reflection_response.choices[0].message.parsed
|
1298
1311
|
|
1299
1312
|
if self.verbose:
|
1300
1313
|
display_self_reflection(f"Agent {self.name} self reflection (using {self.reflect_llm if self.reflect_llm else self.llm}): reflection='{reflection_output.reflection}' satisfactory='{reflection_output.satisfactory}'", console=self.console)
|
@@ -1337,7 +1350,9 @@ Output MUST be JSON with 'reflection' and 'satisfactory'.
|
|
1337
1350
|
|
1338
1351
|
logging.debug(f"{self.name} reflection count {reflection_count + 1}, continuing reflection process")
|
1339
1352
|
messages.append({"role": "user", "content": "Now regenerate your response using the reflection you made"})
|
1340
|
-
|
1353
|
+
# For custom LLMs during reflection, always use non-streaming to ensure complete responses
|
1354
|
+
use_stream = self.stream if not self._using_custom_llm else False
|
1355
|
+
response = self._chat_completion(messages, temperature=temperature, tools=None, stream=use_stream)
|
1341
1356
|
response_text = response.choices[0].message.content.strip()
|
1342
1357
|
reflection_count += 1
|
1343
1358
|
continue # Continue the loop for more reflections
|
@@ -214,9 +214,37 @@ Tools: {', '.join(agent_tools)}"""
|
|
214
214
|
|
215
215
|
return assigned_tools
|
216
216
|
|
217
|
+
def _validate_config(self, config: AutoAgentsConfig) -> tuple[bool, str]:
|
218
|
+
"""
|
219
|
+
Validate that the configuration has proper TaskConfig objects.
|
220
|
+
|
221
|
+
Returns:
|
222
|
+
Tuple of (is_valid, error_message)
|
223
|
+
"""
|
224
|
+
for agent_idx, agent in enumerate(config.agents):
|
225
|
+
if not hasattr(agent, 'tasks') or not agent.tasks:
|
226
|
+
return False, f"Agent '{agent.name}' has no tasks defined"
|
227
|
+
|
228
|
+
for task_idx, task in enumerate(agent.tasks):
|
229
|
+
# Check if task is a proper TaskConfig instance
|
230
|
+
if not isinstance(task, TaskConfig):
|
231
|
+
return False, f"Task at index {task_idx} for agent '{agent.name}' is not a proper TaskConfig object"
|
232
|
+
|
233
|
+
# Check required fields
|
234
|
+
if not task.name:
|
235
|
+
return False, f"Task at index {task_idx} for agent '{agent.name}' has no name"
|
236
|
+
if not task.description:
|
237
|
+
return False, f"Task at index {task_idx} for agent '{agent.name}' has no description"
|
238
|
+
if not task.expected_output:
|
239
|
+
return False, f"Task at index {task_idx} for agent '{agent.name}' has no expected_output"
|
240
|
+
if task.tools is None:
|
241
|
+
return False, f"Task at index {task_idx} for agent '{agent.name}' has no tools field"
|
242
|
+
|
243
|
+
return True, ""
|
244
|
+
|
217
245
|
def _generate_config(self) -> AutoAgentsConfig:
|
218
|
-
"""Generate the configuration for agents and tasks"""
|
219
|
-
|
246
|
+
"""Generate the configuration for agents and tasks with retry logic"""
|
247
|
+
base_prompt = f"""
|
220
248
|
Generate a configuration for AI agents to accomplish this task: "{self.instructions}"
|
221
249
|
|
222
250
|
The configuration should include:
|
@@ -237,84 +265,164 @@ Requirements:
|
|
237
265
|
4. The process type should match the task requirements
|
238
266
|
5. Generate maximum {self.max_agents} agents to handle this task efficiently
|
239
267
|
|
240
|
-
Return the configuration in a structured JSON format matching
|
268
|
+
Return the configuration in a structured JSON format matching this exact schema:
|
269
|
+
{{
|
270
|
+
"main_instruction": "Overall goal description",
|
271
|
+
"process_type": "sequential|workflow|hierarchical",
|
272
|
+
"agents": [
|
273
|
+
{{
|
274
|
+
"name": "Agent Name",
|
275
|
+
"role": "Agent Role",
|
276
|
+
"goal": "Agent Goal",
|
277
|
+
"backstory": "Agent Backstory",
|
278
|
+
"tools": ["tool1", "tool2"],
|
279
|
+
"tasks": [
|
280
|
+
{{
|
281
|
+
"name": "Task Name",
|
282
|
+
"description": "Detailed task description",
|
283
|
+
"expected_output": "What the task should produce",
|
284
|
+
"tools": ["tool1", "tool2"]
|
285
|
+
}}
|
286
|
+
]
|
287
|
+
}}
|
288
|
+
]
|
289
|
+
}}
|
290
|
+
|
291
|
+
IMPORTANT: Each task MUST be an object with name, description, expected_output, and tools fields, NOT a simple string.
|
241
292
|
"""
|
242
293
|
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
294
|
+
max_retries = 3
|
295
|
+
last_response = None
|
296
|
+
last_error = None
|
297
|
+
|
298
|
+
for attempt in range(max_retries):
|
299
|
+
# Prepare prompt for this attempt
|
300
|
+
if attempt > 0 and last_response and last_error:
|
301
|
+
# On retry, include the previous response and error
|
302
|
+
prompt = f"""{base_prompt}
|
303
|
+
|
304
|
+
PREVIOUS ATTEMPT FAILED!
|
305
|
+
Your previous response was:
|
306
|
+
```json
|
307
|
+
{last_response}
|
308
|
+
```
|
309
|
+
|
310
|
+
Error: {last_error}
|
311
|
+
|
312
|
+
REMEMBER: Tasks MUST be objects with the following structure:
|
313
|
+
{{
|
314
|
+
"name": "Task Name",
|
315
|
+
"description": "Task Description",
|
316
|
+
"expected_output": "Expected Output",
|
317
|
+
"tools": ["tool1", "tool2"]
|
318
|
+
}}
|
319
|
+
|
320
|
+
DO NOT use strings for tasks. Each task MUST be a complete object with all four fields."""
|
321
|
+
else:
|
322
|
+
prompt = base_prompt
|
247
323
|
|
248
324
|
try:
|
249
|
-
#
|
250
|
-
|
251
|
-
|
252
|
-
if self.api_key or self.base_url:
|
253
|
-
client = OpenAIClient(api_key=self.api_key, base_url=self.base_url)
|
254
|
-
else:
|
255
|
-
client = get_openai_client()
|
256
|
-
use_openai_structured = True
|
257
|
-
except:
|
258
|
-
# If OpenAI client is not available, we'll use the LLM class
|
259
|
-
pass
|
260
|
-
|
261
|
-
if use_openai_structured and client:
|
262
|
-
# Use OpenAI's structured output for OpenAI models (backward compatibility)
|
263
|
-
config = client.parse_structured_output(
|
264
|
-
messages=[
|
265
|
-
{"role": "system", "content": "You are a helpful assistant designed to generate AI agent configurations."},
|
266
|
-
{"role": "user", "content": prompt}
|
267
|
-
],
|
268
|
-
response_format=AutoAgentsConfig,
|
269
|
-
model=self.llm
|
270
|
-
)
|
271
|
-
else:
|
272
|
-
# Use LLM class for all other providers (Gemini, Anthropic, etc.)
|
273
|
-
llm_instance = LLM(
|
274
|
-
model=self.llm,
|
275
|
-
base_url=self.base_url,
|
276
|
-
api_key=self.api_key
|
277
|
-
)
|
325
|
+
# Try to use OpenAI's structured output if available
|
326
|
+
use_openai_structured = False
|
327
|
+
client = None
|
278
328
|
|
279
|
-
response_text = llm_instance.response(
|
280
|
-
prompt=prompt,
|
281
|
-
system_prompt="You are a helpful assistant designed to generate AI agent configurations.",
|
282
|
-
output_pydantic=AutoAgentsConfig,
|
283
|
-
temperature=0.7,
|
284
|
-
stream=False,
|
285
|
-
verbose=False
|
286
|
-
)
|
287
|
-
|
288
|
-
# Parse the JSON response
|
289
329
|
try:
|
290
|
-
#
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
330
|
+
# Check if we have OpenAI API and the model supports structured output
|
331
|
+
if self.llm and (self.llm.startswith('gpt-') or self.llm.startswith('o1-') or self.llm.startswith('o3-')):
|
332
|
+
# Create a new client instance if custom parameters are provided
|
333
|
+
if self.api_key or self.base_url:
|
334
|
+
client = OpenAIClient(api_key=self.api_key, base_url=self.base_url)
|
335
|
+
else:
|
336
|
+
client = get_openai_client()
|
337
|
+
use_openai_structured = True
|
338
|
+
except:
|
339
|
+
# If OpenAI client is not available, we'll use the LLM class
|
340
|
+
pass
|
341
|
+
|
342
|
+
if use_openai_structured and client:
|
343
|
+
# Use OpenAI's structured output for OpenAI models (backward compatibility)
|
344
|
+
config = client.parse_structured_output(
|
345
|
+
messages=[
|
346
|
+
{"role": "system", "content": "You are a helpful assistant designed to generate AI agent configurations."},
|
347
|
+
{"role": "user", "content": prompt}
|
348
|
+
],
|
349
|
+
response_format=AutoAgentsConfig,
|
350
|
+
model=self.llm
|
351
|
+
)
|
352
|
+
# Store the response for potential retry
|
353
|
+
last_response = json.dumps(config.model_dump(), indent=2)
|
354
|
+
else:
|
355
|
+
# Use LLM class for all other providers (Gemini, Anthropic, etc.)
|
356
|
+
llm_instance = LLM(
|
357
|
+
model=self.llm,
|
358
|
+
base_url=self.base_url,
|
359
|
+
api_key=self.api_key
|
360
|
+
)
|
304
361
|
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
362
|
+
response_text = llm_instance.response(
|
363
|
+
prompt=prompt,
|
364
|
+
system_prompt="You are a helpful assistant designed to generate AI agent configurations.",
|
365
|
+
output_pydantic=AutoAgentsConfig,
|
366
|
+
temperature=0.7,
|
367
|
+
stream=False,
|
368
|
+
verbose=False
|
369
|
+
)
|
370
|
+
|
371
|
+
# Store the raw response for potential retry
|
372
|
+
last_response = response_text
|
373
|
+
|
374
|
+
# Parse the JSON response
|
375
|
+
try:
|
376
|
+
# First try to parse as is
|
377
|
+
config_dict = json.loads(response_text)
|
378
|
+
config = AutoAgentsConfig(**config_dict)
|
379
|
+
except json.JSONDecodeError:
|
380
|
+
# If that fails, try to extract JSON from the response
|
381
|
+
# Handle cases where the model might wrap JSON in markdown blocks
|
382
|
+
cleaned_response = response_text.strip()
|
383
|
+
if cleaned_response.startswith("```json"):
|
384
|
+
cleaned_response = cleaned_response[7:]
|
385
|
+
if cleaned_response.startswith("```"):
|
386
|
+
cleaned_response = cleaned_response[3:]
|
387
|
+
if cleaned_response.endswith("```"):
|
388
|
+
cleaned_response = cleaned_response[:-3]
|
389
|
+
cleaned_response = cleaned_response.strip()
|
390
|
+
|
391
|
+
config_dict = json.loads(cleaned_response)
|
392
|
+
config = AutoAgentsConfig(**config_dict)
|
393
|
+
|
394
|
+
# Validate the configuration
|
395
|
+
is_valid, error_msg = self._validate_config(config)
|
396
|
+
if not is_valid:
|
397
|
+
last_error = error_msg
|
398
|
+
if attempt < max_retries - 1:
|
399
|
+
logging.warning(f"Configuration validation failed (attempt {attempt + 1}/{max_retries}): {error_msg}")
|
400
|
+
continue
|
401
|
+
else:
|
402
|
+
raise ValueError(f"Configuration validation failed after {max_retries} attempts: {error_msg}")
|
403
|
+
|
404
|
+
# Ensure we have exactly max_agents number of agents
|
405
|
+
if len(config.agents) > self.max_agents:
|
406
|
+
config.agents = config.agents[:self.max_agents]
|
407
|
+
elif len(config.agents) < self.max_agents:
|
408
|
+
logging.warning(f"Generated {len(config.agents)} agents, expected {self.max_agents}")
|
409
|
+
|
410
|
+
return config
|
411
|
+
|
412
|
+
except ValueError as e:
|
413
|
+
# Re-raise validation errors
|
414
|
+
raise
|
415
|
+
except Exception as e:
|
416
|
+
last_error = str(e)
|
417
|
+
if attempt < max_retries - 1:
|
418
|
+
logging.warning(f"Error generating configuration (attempt {attempt + 1}/{max_retries}): {e}")
|
419
|
+
continue
|
420
|
+
else:
|
421
|
+
logging.error(f"Error generating configuration after {max_retries} attempts: {e}")
|
422
|
+
raise
|
423
|
+
|
424
|
+
# This should never be reached due to the raise statements above
|
425
|
+
raise RuntimeError(f"Failed to generate valid configuration after {max_retries} attempts")
|
318
426
|
|
319
427
|
def _create_agents_and_tasks(self, config: AutoAgentsConfig) -> Tuple[List[Agent], List[Task]]:
|
320
428
|
"""Create agents and tasks from configuration"""
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/guardrails/guardrail_result.py
RENAMED
File without changes
|
{praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/guardrails/llm_guardrail.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/telemetry/integration.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/calculator_tools.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/duckduckgo_tools.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/newspaper_tools.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/train/data/generatecot.py
RENAMED
File without changes
|
{praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents/tools/wikipedia_tools.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{praisonaiagents-0.0.121 → praisonaiagents-0.0.122}/praisonaiagents.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|