swarms 7.6.0__tar.gz → 7.6.1__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.
- swarms-7.6.0/README.md → swarms-7.6.1/PKG-INFO +119 -0
- swarms-7.6.0/PKG-INFO → swarms-7.6.1/README.md +78 -41
- {swarms-7.6.0 → swarms-7.6.1}/pyproject.toml +2 -2
- {swarms-7.6.0 → swarms-7.6.1}/swarms/agents/__init__.py +5 -0
- swarms-7.6.1/swarms/agents/agent_judge.py +119 -0
- swarms-7.6.1/swarms/agents/flexion_agent.py +625 -0
- swarms-7.6.1/swarms/agents/gkp_agent.py +581 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/agents/reasoning_agents.py +22 -0
- swarms-7.6.1/swarms/prompts/agent_judge_prompt.py +38 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/__init__.py +2 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/agent_builder.py +6 -8
- swarms-7.6.1/swarms/structs/deep_research_swarm.py +482 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/swarm_router.py +11 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/swarms_api.py +1 -1
- swarms-7.6.1/swarms/tools/mcp_integration.py +554 -0
- {swarms-7.6.0 → swarms-7.6.1}/LICENSE +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/__init__.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/agents/agent_print.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/agents/ape_agent.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/agents/auto_generate_swarm_config.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/agents/consistency_agent.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/agents/create_agents_from_yaml.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/agents/i_agent.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/agents/openai_assistant.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/agents/reasoning_duo.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/agents/tool_agent.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/artifacts/__init__.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/artifacts/main_artifact.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/cli/__init__.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/cli/create_agent.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/cli/main.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/cli/onboarding_process.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/__init__.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/accountant_swarm_prompts.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/ag_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/aga.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/agent_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/agent_prompts.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/agent_system_prompts.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/ai_research_team.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/aot_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/autobloggen.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/autoswarm.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/chat_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/code_interpreter.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/code_spawner.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/debate.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/documentation.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/education.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/finance_agent_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/finance_agent_sys_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/growth_agent_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/idea2img.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/legal_agent_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/logistics.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/meta_system_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/multi_modal_autonomous_instruction_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/multi_modal_prompts.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/multi_modal_visual_prompts.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/operations_agent_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/personal_stylist.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/product_agent_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/programming.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/project_manager.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/prompt_generator.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/prompt_generator_optimizer.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/python.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/react.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/reasoning_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/refiner_agent_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/sales.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/sales_prompts.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/security_team.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/self_operating_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/sop_generator_agent_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/summaries_prompts.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/support_agent_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/swarm_manager_agent.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/task_assignment_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/tests.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/tools.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/urban_planning.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/visual_cot.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/worker_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/prompts/xray_swarm_prompt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/schemas/__init__.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/schemas/agent_input_schema.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/schemas/agent_step_schemas.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/schemas/base_schemas.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/agent.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/agent_registry.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/agent_roles.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/agent_router.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/agent_security.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/agents_available.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/airflow_swarm.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/async_workflow.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/auto_swarm.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/auto_swarm_builder.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/base_structure.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/base_swarm.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/base_workflow.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/concat.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/concurrent_workflow.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/conversation.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/csv_to_agent.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/de_hallucination_swarm.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/graph_swarm.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/graph_workflow.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/groupchat.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/hiearchical_swarm.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/majority_voting.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/malt.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/matrix_swarm.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/meme_agent_persona_generator.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/mixture_of_agents.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/model_router.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/multi_agent_collab.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/multi_agent_exec.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/multi_agent_orchestrator.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/octotools.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/omni_agent_types.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/output_type.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/output_types.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/pulsar_swarm.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/queue_swarm.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/rearrange.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/round_robin.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/safe_loading.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/sequential_workflow.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/spreadsheet_swarm.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/stopping_conditions.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/swarm_arange.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/swarm_builder.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/swarm_eval.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/swarm_id_generator.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/swarm_load_balancer.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/swarm_matcher.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/swarm_output_type.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/swarm_registry.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/swarming_architectures.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/talk_hier.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/tree_swarm.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/utils.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/various_alt_swarms.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/structs/workspace_manager.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/telemetry/__init__.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/telemetry/bootup.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/telemetry/main.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/__init__.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/base_tool.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/cohere_func_call_schema.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/func_calling_utils.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/func_to_str.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/function_util.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/json_former.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/json_utils.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/logits_processor.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/openai_func_calling_schema_pydantic.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/openai_tool_creator_decorator.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/py_func_to_openai_func_str.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/pydantic_to_json.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/tool_parse_exec.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/tool_registry.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/tools/tool_utils.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/__init__.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/agent_ops_check.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/any_to_str.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/auto_download_check_packages.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/calculate_func_metrics.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/data_to_text.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/disable_logging.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/file_processing.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/formatter.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/function_caller_model.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/history_output_formatter.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/litellm_tokenizer.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/litellm_wrapper.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/loguru_logger.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/markdown_message.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/pandas_utils.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/parse_code.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/pdf_to_text.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/str_to_dict.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/swarm_reliability_checks.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/try_except_wrapper.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/visualizer.py +0 -0
- {swarms-7.6.0 → swarms-7.6.1}/swarms/utils/wrapper_clusterop.py +0 -0
@@ -1,3 +1,43 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: swarms
|
3
|
+
Version: 7.6.1
|
4
|
+
Summary: Swarms - TGSC
|
5
|
+
Home-page: https://github.com/kyegomez/swarms
|
6
|
+
License: MIT
|
7
|
+
Keywords: artificial intelligence,deep learning,optimizers,Prompt Engineering,swarms,agents,llms,transformers,multi-agent,swarms of agents,Enterprise-Grade Agents,Production-Grade Agents,Agents,Multi-Grade-Agents,Swarms,Transformers,LLMs,Prompt Engineering,Agents,Generative Agents,Generative AI,Agent Marketplace,Agent Store,quant,finance,algorithmic trading,portfolio optimization,risk management,financial modeling,machine learning for finance,natural language processing for finance
|
8
|
+
Author: Kye Gomez
|
9
|
+
Author-email: kye@apac.ai
|
10
|
+
Requires-Python: >=3.10,<4.0
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
12
|
+
Classifier: Intended Audience :: Developers
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
19
|
+
Requires-Dist: PyYAML
|
20
|
+
Requires-Dist: aiofiles
|
21
|
+
Requires-Dist: asyncio (>=3.4.3,<4.0)
|
22
|
+
Requires-Dist: docstring_parser (==0.16)
|
23
|
+
Requires-Dist: httpx
|
24
|
+
Requires-Dist: litellm
|
25
|
+
Requires-Dist: loguru
|
26
|
+
Requires-Dist: networkx
|
27
|
+
Requires-Dist: numpy
|
28
|
+
Requires-Dist: psutil
|
29
|
+
Requires-Dist: pydantic
|
30
|
+
Requires-Dist: pypdf (==5.1.0)
|
31
|
+
Requires-Dist: python-dotenv
|
32
|
+
Requires-Dist: rich
|
33
|
+
Requires-Dist: setuptools
|
34
|
+
Requires-Dist: tenacity
|
35
|
+
Requires-Dist: toml
|
36
|
+
Requires-Dist: torch
|
37
|
+
Project-URL: Documentation, https://docs.swarms.world
|
38
|
+
Project-URL: Repository, https://github.com/kyegomez/swarms
|
39
|
+
Description-Content-Type: text/markdown
|
40
|
+
|
1
41
|
<div align="center">
|
2
42
|
<a href="https://swarms.world">
|
3
43
|
<img src="https://github.com/kyegomez/swarms/blob/master/images/swarmslogobanner.png" style="margin: 15px; max-width: 300px" width="50%" alt="Logo">
|
@@ -325,6 +365,84 @@ agent.run(
|
|
325
365
|
```
|
326
366
|
|
327
367
|
|
368
|
+
## Structured Outputs
|
369
|
+
|
370
|
+
1. Create a tool schema
|
371
|
+
2. Create a function schema
|
372
|
+
3. Create a tool list dictionary
|
373
|
+
4. Initialize the agent
|
374
|
+
5. Run the agent
|
375
|
+
6. Print the output
|
376
|
+
7. Convert the output to a dictionary
|
377
|
+
|
378
|
+
```python
|
379
|
+
|
380
|
+
from dotenv import load_dotenv
|
381
|
+
|
382
|
+
from swarms import Agent
|
383
|
+
from swarms.prompts.finance_agent_sys_prompt import (
|
384
|
+
FINANCIAL_AGENT_SYS_PROMPT,
|
385
|
+
)
|
386
|
+
from swarms.utils.str_to_dict import str_to_dict
|
387
|
+
|
388
|
+
load_dotenv()
|
389
|
+
|
390
|
+
tools = [
|
391
|
+
{
|
392
|
+
"type": "function",
|
393
|
+
"function": {
|
394
|
+
"name": "get_stock_price",
|
395
|
+
"description": "Retrieve the current stock price and related information for a specified company.",
|
396
|
+
"parameters": {
|
397
|
+
"type": "object",
|
398
|
+
"properties": {
|
399
|
+
"ticker": {
|
400
|
+
"type": "string",
|
401
|
+
"description": "The stock ticker symbol of the company, e.g. AAPL for Apple Inc.",
|
402
|
+
},
|
403
|
+
"include_history": {
|
404
|
+
"type": "boolean",
|
405
|
+
"description": "Indicates whether to include historical price data along with the current price.",
|
406
|
+
},
|
407
|
+
"time": {
|
408
|
+
"type": "string",
|
409
|
+
"format": "date-time",
|
410
|
+
"description": "Optional parameter to specify the time for which the stock data is requested, in ISO 8601 format.",
|
411
|
+
},
|
412
|
+
},
|
413
|
+
"required": [
|
414
|
+
"ticker",
|
415
|
+
"include_history",
|
416
|
+
"time",
|
417
|
+
],
|
418
|
+
},
|
419
|
+
},
|
420
|
+
}
|
421
|
+
]
|
422
|
+
|
423
|
+
|
424
|
+
# Initialize the agent
|
425
|
+
agent = Agent(
|
426
|
+
agent_name="Financial-Analysis-Agent",
|
427
|
+
agent_description="Personal finance advisor agent",
|
428
|
+
system_prompt=FINANCIAL_AGENT_SYS_PROMPT,
|
429
|
+
max_loops=1,
|
430
|
+
tools_list_dictionary=tools,
|
431
|
+
)
|
432
|
+
|
433
|
+
out = agent.run(
|
434
|
+
"What is the current stock price for Apple Inc. (AAPL)? Include historical price data.",
|
435
|
+
)
|
436
|
+
|
437
|
+
print(out)
|
438
|
+
|
439
|
+
print(type(out))
|
440
|
+
|
441
|
+
print(str_to_dict(out))
|
442
|
+
|
443
|
+
print(type(str_to_dict(out)))
|
444
|
+
```
|
445
|
+
|
328
446
|
-------
|
329
447
|
|
330
448
|
### Misc Agent Settings
|
@@ -2191,3 +2309,4 @@ Join our growing community around the world, for real-time support, ideas, and d
|
|
2191
2309
|
# License
|
2192
2310
|
|
2193
2311
|
APACHE
|
2312
|
+
|
@@ -1,43 +1,3 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: swarms
|
3
|
-
Version: 7.6.0
|
4
|
-
Summary: Swarms - TGSC
|
5
|
-
Home-page: https://github.com/kyegomez/swarms
|
6
|
-
License: MIT
|
7
|
-
Keywords: artificial intelligence,deep learning,optimizers,Prompt Engineering,swarms,agents,llms,transformers,multi-agent,swarms of agents,Enterprise-Grade Agents,Production-Grade Agents,Agents,Multi-Grade-Agents,Swarms,Transformers,LLMs,Prompt Engineering,Agents,Generative Agents,Generative AI,Agent Marketplace,Agent Store,quant,finance,algorithmic trading,portfolio optimization,risk management,financial modeling,machine learning for finance,natural language processing for finance
|
8
|
-
Author: Kye Gomez
|
9
|
-
Author-email: kye@apac.ai
|
10
|
-
Requires-Python: >=3.10,<4.0
|
11
|
-
Classifier: Development Status :: 4 - Beta
|
12
|
-
Classifier: Intended Audience :: Developers
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
16
|
-
Classifier: Programming Language :: Python :: 3.11
|
17
|
-
Classifier: Programming Language :: Python :: 3.12
|
18
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
19
|
-
Requires-Dist: PyYAML
|
20
|
-
Requires-Dist: aiofiles
|
21
|
-
Requires-Dist: asyncio (>=3.4.3,<4.0)
|
22
|
-
Requires-Dist: docstring_parser (==0.16)
|
23
|
-
Requires-Dist: httpx
|
24
|
-
Requires-Dist: litellm
|
25
|
-
Requires-Dist: loguru
|
26
|
-
Requires-Dist: networkx
|
27
|
-
Requires-Dist: numpy
|
28
|
-
Requires-Dist: psutil
|
29
|
-
Requires-Dist: pydantic
|
30
|
-
Requires-Dist: pypdf (==5.1.0)
|
31
|
-
Requires-Dist: python-dotenv
|
32
|
-
Requires-Dist: rich
|
33
|
-
Requires-Dist: setuptools
|
34
|
-
Requires-Dist: tenacity
|
35
|
-
Requires-Dist: toml
|
36
|
-
Requires-Dist: torch
|
37
|
-
Project-URL: Documentation, https://docs.swarms.world
|
38
|
-
Project-URL: Repository, https://github.com/kyegomez/swarms
|
39
|
-
Description-Content-Type: text/markdown
|
40
|
-
|
41
1
|
<div align="center">
|
42
2
|
<a href="https://swarms.world">
|
43
3
|
<img src="https://github.com/kyegomez/swarms/blob/master/images/swarmslogobanner.png" style="margin: 15px; max-width: 300px" width="50%" alt="Logo">
|
@@ -365,6 +325,84 @@ agent.run(
|
|
365
325
|
```
|
366
326
|
|
367
327
|
|
328
|
+
## Structured Outputs
|
329
|
+
|
330
|
+
1. Create a tool schema
|
331
|
+
2. Create a function schema
|
332
|
+
3. Create a tool list dictionary
|
333
|
+
4. Initialize the agent
|
334
|
+
5. Run the agent
|
335
|
+
6. Print the output
|
336
|
+
7. Convert the output to a dictionary
|
337
|
+
|
338
|
+
```python
|
339
|
+
|
340
|
+
from dotenv import load_dotenv
|
341
|
+
|
342
|
+
from swarms import Agent
|
343
|
+
from swarms.prompts.finance_agent_sys_prompt import (
|
344
|
+
FINANCIAL_AGENT_SYS_PROMPT,
|
345
|
+
)
|
346
|
+
from swarms.utils.str_to_dict import str_to_dict
|
347
|
+
|
348
|
+
load_dotenv()
|
349
|
+
|
350
|
+
tools = [
|
351
|
+
{
|
352
|
+
"type": "function",
|
353
|
+
"function": {
|
354
|
+
"name": "get_stock_price",
|
355
|
+
"description": "Retrieve the current stock price and related information for a specified company.",
|
356
|
+
"parameters": {
|
357
|
+
"type": "object",
|
358
|
+
"properties": {
|
359
|
+
"ticker": {
|
360
|
+
"type": "string",
|
361
|
+
"description": "The stock ticker symbol of the company, e.g. AAPL for Apple Inc.",
|
362
|
+
},
|
363
|
+
"include_history": {
|
364
|
+
"type": "boolean",
|
365
|
+
"description": "Indicates whether to include historical price data along with the current price.",
|
366
|
+
},
|
367
|
+
"time": {
|
368
|
+
"type": "string",
|
369
|
+
"format": "date-time",
|
370
|
+
"description": "Optional parameter to specify the time for which the stock data is requested, in ISO 8601 format.",
|
371
|
+
},
|
372
|
+
},
|
373
|
+
"required": [
|
374
|
+
"ticker",
|
375
|
+
"include_history",
|
376
|
+
"time",
|
377
|
+
],
|
378
|
+
},
|
379
|
+
},
|
380
|
+
}
|
381
|
+
]
|
382
|
+
|
383
|
+
|
384
|
+
# Initialize the agent
|
385
|
+
agent = Agent(
|
386
|
+
agent_name="Financial-Analysis-Agent",
|
387
|
+
agent_description="Personal finance advisor agent",
|
388
|
+
system_prompt=FINANCIAL_AGENT_SYS_PROMPT,
|
389
|
+
max_loops=1,
|
390
|
+
tools_list_dictionary=tools,
|
391
|
+
)
|
392
|
+
|
393
|
+
out = agent.run(
|
394
|
+
"What is the current stock price for Apple Inc. (AAPL)? Include historical price data.",
|
395
|
+
)
|
396
|
+
|
397
|
+
print(out)
|
398
|
+
|
399
|
+
print(type(out))
|
400
|
+
|
401
|
+
print(str_to_dict(out))
|
402
|
+
|
403
|
+
print(type(str_to_dict(out)))
|
404
|
+
```
|
405
|
+
|
368
406
|
-------
|
369
407
|
|
370
408
|
### Misc Agent Settings
|
@@ -2231,4 +2269,3 @@ Join our growing community around the world, for real-time support, ideas, and d
|
|
2231
2269
|
# License
|
2232
2270
|
|
2233
2271
|
APACHE
|
2234
|
-
|
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
|
|
5
5
|
|
6
6
|
[tool.poetry]
|
7
7
|
name = "swarms"
|
8
|
-
version = "7.6.
|
8
|
+
version = "7.6.1"
|
9
9
|
description = "Swarms - TGSC"
|
10
10
|
license = "MIT"
|
11
11
|
authors = ["Kye Gomez <kye@apac.ai>"]
|
@@ -83,7 +83,7 @@ swarms = "swarms.cli.main:main"
|
|
83
83
|
|
84
84
|
[tool.poetry.group.lint.dependencies]
|
85
85
|
black = ">=23.1,<26.0"
|
86
|
-
ruff = ">=0.5.1,<0.
|
86
|
+
ruff = ">=0.5.1,<0.11.1"
|
87
87
|
types-toml = "^0.10.8.1"
|
88
88
|
types-pytz = ">=2023.3,<2026.0"
|
89
89
|
types-chardet = "^5.0.4.6"
|
@@ -23,6 +23,9 @@ from swarms.structs.stopping_conditions import (
|
|
23
23
|
check_success,
|
24
24
|
)
|
25
25
|
|
26
|
+
from swarms.agents.flexion_agent import ReflexionAgent
|
27
|
+
from swarms.agents.gkp_agent import GKPAgent
|
28
|
+
|
26
29
|
__all__ = [
|
27
30
|
# "ToolAgent",
|
28
31
|
"check_done",
|
@@ -41,4 +44,6 @@ __all__ = [
|
|
41
44
|
"ReasoningDuo",
|
42
45
|
"ReasoningAgentRouter",
|
43
46
|
"agent_types",
|
47
|
+
"ReflexionAgent",
|
48
|
+
"GKPAgent",
|
44
49
|
]
|
@@ -0,0 +1,119 @@
|
|
1
|
+
from typing import List
|
2
|
+
|
3
|
+
from swarms.prompts.agent_judge_prompt import AGENT_JUDGE_PROMPT
|
4
|
+
from swarms.structs.agent import Agent
|
5
|
+
from swarms.structs.conversation import Conversation
|
6
|
+
from swarms.utils.any_to_str import any_to_str
|
7
|
+
|
8
|
+
from loguru import logger
|
9
|
+
|
10
|
+
|
11
|
+
class AgentJudge:
|
12
|
+
"""
|
13
|
+
A class to represent an agent judge that processes tasks and generates responses.
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
agent_name (str): The name of the agent judge.
|
17
|
+
system_prompt (str): The system prompt for the agent.
|
18
|
+
model_name (str): The model name used for generating responses.
|
19
|
+
conversation (Conversation): An instance of the Conversation class to manage conversation history.
|
20
|
+
max_loops (int): The maximum number of iterations to run the tasks.
|
21
|
+
agent (Agent): An instance of the Agent class that performs the task execution.
|
22
|
+
|
23
|
+
Methods:
|
24
|
+
step(tasks: List[str]) -> str:
|
25
|
+
Processes a list of tasks and returns the agent's response.
|
26
|
+
|
27
|
+
run(tasks: List[str]) -> List[str]:
|
28
|
+
Executes the tasks in a loop, updating context and collecting responses.
|
29
|
+
"""
|
30
|
+
|
31
|
+
def __init__(
|
32
|
+
self,
|
33
|
+
agent_name: str = "agent-judge-01",
|
34
|
+
system_prompt: str = AGENT_JUDGE_PROMPT,
|
35
|
+
model_name: str = "openai/o1",
|
36
|
+
max_loops: int = 1,
|
37
|
+
) -> None:
|
38
|
+
"""
|
39
|
+
Initializes the AgentJudge with the specified parameters.
|
40
|
+
|
41
|
+
Args:
|
42
|
+
agent_name (str): The name of the agent judge.
|
43
|
+
system_prompt (str): The system prompt for the agent.
|
44
|
+
model_name (str): The model name used for generating responses.
|
45
|
+
max_loops (int): The maximum number of iterations to run the tasks.
|
46
|
+
"""
|
47
|
+
self.agent_name = agent_name
|
48
|
+
self.system_prompt = system_prompt
|
49
|
+
self.model_name = model_name
|
50
|
+
self.conversation = Conversation(time_enabled=False)
|
51
|
+
self.max_loops = max_loops
|
52
|
+
|
53
|
+
self.agent = Agent(
|
54
|
+
agent_name=agent_name,
|
55
|
+
agent_description="You're the agent judge",
|
56
|
+
system_prompt=AGENT_JUDGE_PROMPT,
|
57
|
+
model_name=model_name,
|
58
|
+
max_loops=1,
|
59
|
+
)
|
60
|
+
|
61
|
+
def step(self, tasks: List[str]) -> str:
|
62
|
+
"""
|
63
|
+
Processes a list of tasks and returns the agent's response.
|
64
|
+
|
65
|
+
Args:
|
66
|
+
tasks (List[str]): A list of tasks to be processed.
|
67
|
+
|
68
|
+
Returns:
|
69
|
+
str: The response generated by the agent.
|
70
|
+
"""
|
71
|
+
prompt = any_to_str(tasks)
|
72
|
+
logger.debug(f"Running step with prompt: {prompt}")
|
73
|
+
|
74
|
+
print(prompt)
|
75
|
+
|
76
|
+
response = self.agent.run(
|
77
|
+
task=f"Evaluate the following output or outputs: {prompt}"
|
78
|
+
)
|
79
|
+
logger.debug(f"Received response: {response}")
|
80
|
+
|
81
|
+
return response
|
82
|
+
|
83
|
+
def run(self, tasks: List[str]) -> List[str]:
|
84
|
+
"""
|
85
|
+
Executes the tasks in a loop, updating context and collecting responses.
|
86
|
+
|
87
|
+
Args:
|
88
|
+
tasks (List[str]): A list of tasks to be executed.
|
89
|
+
|
90
|
+
Returns:
|
91
|
+
List[str]: A list of responses generated by the agent for each iteration.
|
92
|
+
"""
|
93
|
+
responses = []
|
94
|
+
context = ""
|
95
|
+
|
96
|
+
for _ in range(self.max_loops):
|
97
|
+
# Add context to the tasks if available
|
98
|
+
if context:
|
99
|
+
contextualized_tasks = [
|
100
|
+
f"Previous context: {context}\nTask: {task}"
|
101
|
+
for task in tasks
|
102
|
+
]
|
103
|
+
else:
|
104
|
+
contextualized_tasks = tasks
|
105
|
+
|
106
|
+
# Get response for current iteration
|
107
|
+
current_response = self.step(contextualized_tasks)
|
108
|
+
responses.append(current_response)
|
109
|
+
logger.debug(
|
110
|
+
f"Current response added: {current_response}"
|
111
|
+
)
|
112
|
+
|
113
|
+
# Update context for next iteration
|
114
|
+
context = current_response
|
115
|
+
|
116
|
+
# Add to conversation history
|
117
|
+
logger.debug("Added message to conversation history.")
|
118
|
+
|
119
|
+
return responses
|