AutoAgent
AutoAgent copied to clipboard
When running the examples in an anaconda dedicated env with gpt-4o-mini I get TypeError: cannot unpack non-iterable NoneType object, /path/to/metachain is not a valid editable requirement, and other minor issues
I'm running the code from a dedicated conda env, via COMPLETION_MODEL=gpt-4o-mini auto main. The coe starts i choose create agent editor and input the exact prompt in the example: "I want to create 'Financial Agent' that can help me to search the financial information online. You may help me to - get balance sheets for a given ticker over a given period. - get cash flow statements for a given ticker over a given period. - get income statements for a given ticker over a given period" get the json, press enter twice, and paste in the desired goal again, then the errors start. Multiple issues i believe.
AutoAgent$ COMPLETION_MODEL=gpt-4o-mini auto main
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ █████╗ ██╗ ██╗████████╗ ██████╗ █████╗ ██████╗ ███████╗███╗ ██╗████████╗ │
│ ██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝ │
│ ███████║██║ ██║ ██║ ██║ ██║███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ │
│ ██╔══██║██║ ██║ ██║ ██║ ██║██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ │
│ ██║ ██║╚██████╔╝ ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ │
│ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ │
│ ╔═══ 𝒞𝓇𝑒𝒶𝓉𝑒 𝒜𝑔𝑒𝓃𝓉𝒾𝒸 𝒜ℐ 𝓊𝓈𝒾𝓃𝑔 ℒ𝒶𝓃𝑔𝓊𝒶𝑔𝑒 ═══╗ │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╔═══════════════════════════════════════════════════╦════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║ Version ║ 0.2.0 ║
║ Author ║ AutoAgent Team@HKU ║
║ License ║ MIT ║
╚═══════════════════════════════════════════════════╩════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
╭───────────────────────────────────────────────────────────────────────── Important Notes ──────────────────────────────────────────────────────────────────────────╮
│ │
│ • Choose user mode if you just want to let a general yet powerful AI Assistant to help you │
│ • Choose agent editor to create your own AI Agent with language. │
│ • Choose workflow editor to create your own AI Workflow with language. │
│ • Choose exit to exit the program │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Tell me what do you want to create with `Agent Chain`? (type "exit" to quit, press "Enter" to continue): I want to create 'Financial Agent' that can help me to search
the financial information online. You may help me to - get balance sheets for a given ticker over a given period. - get cash flow statements for a given ticker over
a given period. - get income statements for a given ticker over a given period
Your request: I want to create 'Financial Agent' that can help me to search the financial information online. You may help me to - get balance sheets for a given
ticker over a given period. - get cash flow statements for a given ticker over a given period. - get income statements for a given ticker over a given period
@Agent Former Agent will help you, be patient...
@Agent Former Agent has created agent form successfully with the following details:
<agents>
<system_input>
Requests for financial information including balance sheets, cash flow statements, and income statements for a specified ticker over a given period.
</system_input>
<system_output>
<key>financial_data</key>
<description>The requested financial data based on the user's queries.</description>
</system_output>
<agent>
<name>Financial Agent</name>
<description>The financial agent is responsible for retrieving financial information such as balance sheets, cash flow statements, and income statements for
specified tickers.</description>
<instructions>You are a financial agent that helps the user with their financial information requests. Ensure you retrieve the correct data for the given
ticker and period.</instructions>
<tools category="existing">
<tool>
<name>get_balance_sheet</name>
<description>Retrieve the balance sheet for the specified ticker over the given period.</description>
</tool>
<tool>
<name>get_cash_flow_statement</name>
<description>Retrieve the cash flow statement for the specified ticker over the given period.</description>
</tool>
<tool>
<name>get_income_statement</name>
<description>Retrieve the income statement for the specified ticker over the given period.</description>
</tool>
</tools>
<agent_input>
<key>user_request</key>
<description>The request from the user for specific financial information regarding a ticker over a defined period.</description>
</agent_input>
<agent_output>
<key>financial_data</key>
<description>The financial data retrieved based on the user's request.</description>
</agent_output>
</agent>
</agents>
It is time to create the desired tools, do you have any suggestions for creating the tools? (type "exit" to quit, press "Enter" to continue):
Your request:
@Tool Editor Agent will help you, be patient...
@Tool Editor Agent has created tools successfully with the following details:
Case resolved. ALL desired tools are created and tested successfully.
It is time to create the desired agent(s), do you have any suggestions for creating the agent(s)? (type "exit" to quit, press "Enter" to continue):
Your request:
@Agent Creator Agent will help you, be patient...
It is time to create the desired agent(s), what task do you want to complete with the agent(s)? (Press Enter if none): I want to create 'Financial Agent' that can hel
p me to search the financial information online. You may help me to - get balance sheets for a given ticker over a given period. - get cash flow statements for a give
n ticker over a given period. - get income statements for a given ticker over a given period
Collecting autoagent
Downloading AutoAgent-0.0.2-py3-none-any.whl.metadata (14 kB)
Requirement already satisfied: requests>=2.17.0 in /root/miniconda3/lib/python3.12/site-packages (from autoagent) (2.32.3)
Collecting uuid>=1.30 (from autoagent)
Downloading uuid-1.30.tar.gz (5.8 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: charset-normalizer<4,>=2 in /root/miniconda3/lib/python3.12/site-packages (from requests>=2.17.0->autoagent) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /root/miniconda3/lib/python3.12/site-packages (from requests>=2.17.0->autoagent) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /root/miniconda3/lib/python3.12/site-packages (from requests>=2.17.0->autoagent) (2.2.3)
Requirement already satisfied: certifi>=2017.4.17 in /root/miniconda3/lib/python3.12/site-packages (from requests>=2.17.0->autoagent) (2024.8.30)
Downloading AutoAgent-0.0.2-py3-none-any.whl (13 kB)
Building wheels for collected packages: uuid
Building wheel for uuid (setup.py): started
Building wheel for uuid (setup.py): finished with status 'done'
Created wheel for uuid: filename=uuid-1.30-py3-none-any.whl size=6478 sha256=2254b8af048fe26ac639a1effa3303c6f738ef3f57a82d046337c147efdc2f92
Stored in directory: /root/.cache/pip/wheels/35/34/36/b9f3546da107cf37bab75cdb3ce1ebd8d744648985d0111ca1
Successfully built uuid
Installing collected packages: uuid, autoagent
Successfully installed autoagent-0.0.2 uuid-1.30
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system
unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing
and want to suppress this warning.
ERROR: /path/to/metachain is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https,
bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http,
svn+https, svn+svn, svn+file).
ERROR: Could not find a version that satisfies the requirement metachain (from versions: none)
ERROR: No matching distribution found for metachain
ERROR: Could not find a version that satisfies the requirement metachain (from versions: none)
ERROR: No matching distribution found for metachain
install: missing destination file operand after 'financial-tools-package'
Try 'install --help' for more information.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package financial-tools-package
ERROR: Could not find a version that satisfies the requirement financial-tools (from versions: none)
ERROR: No matching distribution found for financial-tools
/bin/bash: line 1: sudo: command not found
/bin/bash: line 1: yum: command not found
/bin/bash: line 1: brew: command not found
install: missing destination file operand after 'financial-tools'
Try 'install --help' for more information.
ERROR: Could not find a version that satisfies the requirement MetaChain (from versions: none)
ERROR: No matching distribution found for MetaChain
Usage:
pip install [options\] <requirement specifier> [package-index-options\] ...
pip install [options\] -r <requirements file> [package-index-options\] ...
pip install [options\] [-e\] <vcs project url> ...
pip install [options\] [-e\] <local project path> ...
pip install [options\] <archive url/path> ...
--editable option requires 1 argument
ERROR: Could not find a version that satisfies the requirement metachain (from versions: none)
ERROR: No matching distribution found for metachain
Traceback (most recent call last):
File "/home/luca/anaconda3/envs/auto_agent/bin/auto", line 8, in <module>
sys.exit(cli())
File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/home/luca/pymaindir/my_tools/autoagent/AutoAgent/autoagent/cli.py", line 209, in main
meta_agent(model, context_variables, False)
File "/home/luca/pymaindir/my_tools/autoagent/AutoAgent/autoagent/cli_utils/metachain_meta_agent.py", line 248, in meta_agent
agent_response, messages = agent_editing(agent_creator_agent, client, messages, context_variables, agent_form, output_xml_form, requirements, task, debug, suggestions)
TypeError: cannot unpack non-iterable NoneType object
I'm running the code from a dedicated conda env, via COMPLETION_MODEL=gpt-4o-mini auto main. The coe starts i choose create agent editor and input the exact prompt in the example: "I want to create 'Financial Agent' that can help me to search the financial information online. You may help me to - get balance sheets for a given ticker over a given period. - get cash flow statements for a given ticker over a given period. - get income statements for a given ticker over a given period" get the json, press enter twice, and paste in the desired goal again, then the errors start. Multiple issues i believe.
AutoAgent$ COMPLETION_MODEL=gpt-4o-mini auto main ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ █████╗ ██╗ ██╗████████╗ ██████╗ █████╗ ██████╗ ███████╗███╗ ██╗████████╗ │ │ ██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝ │ │ ███████║██║ ██║ ██║ ██║ ██║███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ │ │ ██╔══██║██║ ██║ ██║ ██║ ██║██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ │ │ ██║ ██║╚██████╔╝ ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ │ │ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ │ │ ╔═══ 𝒞𝓇𝑒𝒶𝓉𝑒 𝒜𝑔𝑒𝓃𝓉𝒾𝒸 𝒜ℐ 𝓊𝓈𝒾𝓃𝑔 ℒ𝒶𝓃𝑔𝓊𝒶𝑔𝑒 ═══╗ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╔═══════════════════════════════════════════════════╦════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗ ║ Version ║ 0.2.0 ║ ║ Author ║ AutoAgent Team@HKU ║ ║ License ║ MIT ║ ╚═══════════════════════════════════════════════════╩════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝ ╭───────────────────────────────────────────────────────────────────────── Important Notes ──────────────────────────────────────────────────────────────────────────╮ │ │ │ • Choose user mode if you just want to let a general yet powerful AI Assistant to help you │ │ • Choose agent editor to create your own AI Agent with language. │ │ • Choose workflow editor to create your own AI Workflow with language. │ │ • Choose exit to exit the program │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ Tell me what do you want to create with
Agent Chain? (type "exit" to quit, press "Enter" to continue): I want to create 'Financial Agent' that can help me to search the financial information online. You may help me to - get balance sheets for a given ticker over a given period. - get cash flow statements for a given ticker over a given period. - get income statements for a given ticker over a given period Your request: I want to create 'Financial Agent' that can help me to search the financial information online. You may help me to - get balance sheets for a given ticker over a given period. - get cash flow statements for a given ticker over a given period. - get income statements for a given ticker over a given period @Agent Former Agent will help you, be patient... @Agent Former Agent has created agent form successfully with the following details:<system_input> Requests for financial information including balance sheets, cash flow statements, and income statements for a specified ticker over a given period. </system_input> <system_output> It is time to create the desired tools, do you have any suggestions for creating the tools? (type "exit" to quit, press "Enter" to continue): Your request:financial_data The requested financial data based on the user's queries. </system_output>Financial Agent The financial agent is responsible for retrieving financial information such as balance sheets, cash flow statements, and income statements for specified tickers. You are a financial agent that helps the user with their financial information requests. Ensure you retrieve the correct data for the given ticker and period. <agent_input> get_balance_sheet Retrieve the balance sheet for the specified ticker over the given period. get_cash_flow_statement Retrieve the cash flow statement for the specified ticker over the given period. get_income_statement Retrieve the income statement for the specified ticker over the given period. user_request The request from the user for specific financial information regarding a ticker over a defined period. </agent_input> <agent_output>financial_data The financial data retrieved based on the user's request. </agent_output>
@Tool Editor Agent will help you, be patient... @Tool Editor Agent has created tools successfully with the following details: Case resolved. ALL desired tools are created and tested successfully. It is time to create the desired agent(s), do you have any suggestions for creating the agent(s)? (type "exit" to quit, press "Enter" to continue): Your request:
@Agent Creator Agent will help you, be patient... It is time to create the desired agent(s), what task do you want to complete with the agent(s)? (Press Enter if none): I want to create 'Financial Agent' that can hel p me to search the financial information online. You may help me to - get balance sheets for a given ticker over a given period. - get cash flow statements for a give n ticker over a given period. - get income statements for a given ticker over a given period Collecting autoagentDownloading AutoAgent-0.0.2-py3-none-any.whl.metadata (14 kB)
Requirement already satisfied: requests>=2.17.0 in /root/miniconda3/lib/python3.12/site-packages (from autoagent) (2.32.3)
Collecting uuid>=1.30 (from autoagent)
Downloading uuid-1.30.tar.gz (5.8 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: charset-normalizer<4,>=2 in /root/miniconda3/lib/python3.12/site-packages (from requests>=2.17.0->autoagent) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /root/miniconda3/lib/python3.12/site-packages (from requests>=2.17.0->autoagent) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /root/miniconda3/lib/python3.12/site-packages (from requests>=2.17.0->autoagent) (2.2.3)
Requirement already satisfied: certifi>=2017.4.17 in /root/miniconda3/lib/python3.12/site-packages (from requests>=2.17.0->autoagent) (2024.8.30)
Downloading AutoAgent-0.0.2-py3-none-any.whl (13 kB)
Building wheels for collected packages: uuid
Building wheel for uuid (setup.py): started
Building wheel for uuid (setup.py): finished with status 'done'
Created wheel for uuid: filename=uuid-1.30-py3-none-any.whl size=6478 sha256=2254b8af048fe26ac639a1effa3303c6f738ef3f57a82d046337c147efdc2f92
Stored in directory: /root/.cache/pip/wheels/35/34/36/b9f3546da107cf37bab75cdb3ce1ebd8d744648985d0111ca1
Successfully built uuid
Installing collected packages: uuid, autoagent
Successfully installed autoagent-0.0.2 uuid-1.30
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
ERROR: /path/to/metachain is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).
ERROR: Could not find a version that satisfies the requirement metachain (from versions: none)
ERROR: No matching distribution found for metachain
ERROR: Could not find a version that satisfies the requirement metachain (from versions: none)
ERROR: No matching distribution found for metachain
install: missing destination file operand after 'financial-tools-package'
Try 'install --help' for more information.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package financial-tools-package
ERROR: Could not find a version that satisfies the requirement financial-tools (from versions: none)
ERROR: No matching distribution found for financial-tools
/bin/bash: line 1: sudo: command not found
/bin/bash: line 1: yum: command not found
/bin/bash: line 1: brew: command not found
install: missing destination file operand after 'financial-tools'
Try 'install --help' for more information.
ERROR: Could not find a version that satisfies the requirement MetaChain (from versions: none)
ERROR: No matching distribution found for MetaChain
Usage:
pip install [options]
[package-index-options] ... pip install [options] -r
[package-index-options] ... pip install [options] [-e]
... pip install [options] [-e]
... pip install [options] <archive url/path> ...
--editable option requires 1 argument
ERROR: Could not find a version that satisfies the requirement metachain (from versions: none)
ERROR: No matching distribution found for metachain
Traceback (most recent call last): File "/home/luca/anaconda3/envs/auto_agent/bin/auto", line 8, in
sys.exit(cli()) File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/click/core.py", line 1161, in call return self.main(*args, **kwargs) File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/click/core.py", line 1082, in main rv = self.invoke(ctx) File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/click/core.py", line 1697, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/click/core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/click/core.py", line 788, in invoke return __callback(*args, **kwargs) File "/home/luca/pymaindir/my_tools/autoagent/AutoAgent/autoagent/cli.py", line 209, in main meta_agent(model, context_variables, False) File "/home/luca/pymaindir/my_tools/autoagent/AutoAgent/autoagent/cli_utils/metachain_meta_agent.py", line 248, in meta_agent agent_response, messages = agent_editing(agent_creator_agent, client, messages, context_variables, agent_form, output_xml_form, requirements, task, debug, suggestions) TypeError: cannot unpack non-iterable NoneType object
Hiiii, sorry for the late reply and thank you for your interests. Could you please set DEBUG=True to show more information for us to debug. Also, I am not sure if gpt-4o-mini is enough for agent creating task. I have tested gpt-4o-mini for user mode (aka Deep Research mode), but have not tested agent creating with it. I sugget yiu can also try gpt-4o with the agent creating.
Hi thanks for answering, unfortunately claude gives me rate limit, this is what happens in the same setup with 4o, with debug on right after the json output, ultimately with every model I tryied failed one way ot another:
It is time to create the desired tools, do you have any suggestions for creating the tools? (type "exit" to quit, press "Enter" to continue):
Your request:
@Tool Editor Agent will help you, be patient...
************************ Receive Task ************************
[2025-02-23 17:36:29]
Receiveing the task:
Your task is to create a list of new tools for me, the tools are:
1. Tool name: search_balance_sheets, Tool description: Retrieve balance sheets for a specified ticker over a specified period.
2. Tool name: search_cash_flow_statements, Tool description: Retrieve cash flow statements for a specified ticker over a specified period.
3. Tool name: search_income_statements, Tool description: Retrieve income statements for a specified ticker over a specified period.
Please create these new tools for me, note that you can NOT stop util you have created all the tools and tested them using `run_tool` successfully.
If ALL tools are created and tested successfully, you can stop and use `case_resolved` tool. Otherwise, you should continue to create the tools. After you have tried your best, you
can use `case_not_resolved` tool to give the reason why the tool is not created or tested successfully.
[IMPORTANT] ALL tools MUST be tested successfully by running the tools using `run_tool` before you stop.
********************* Assistant Message *********************
[2025-02-23 17:36:31]
Tool Editor Agent: None
************************* Tool Calls *************************
[2025-02-23 17:36:31]
list_tools()
*********************** Tool Execution ***********************
[2025-02-23 17:36:32]
Tool Execution: list_tools
Result:
---
Failed to list tools. Error: Failed to list tools. The MetaChain is not installed in editable mode.
---
********************* Assistant Message *********************
[2025-02-23 17:36:34]
Tool Editor Agent: None
************************* Tool Calls *************************
[2025-02-23 17:36:34]
get_api_plugin_tools_doc('query_text'='financial information, balance sheets, cash flow statements, income statements')
*********************** Tool Execution ***********************
[2025-02-23 17:36:38]
Tool Execution: get_api_plugin_tools_doc
Result:
---
The rank 1 referenced tool documentation is:
API Name: Company Income Statement
API Description: Get public company's **quarterly** or **annual** income statement. Supports the *stock* type only.
API Details: {'name': 'Company Income Statement', 'url': 'https://real-time-finance-data.p.rapidapi.com/company-income-statement', 'description': "Get public company's **quarterly**
or **annual** income statement. Supports the *stock* type only.", 'method': 'GET', 'required_parameters': [{'name': 'symbol', 'type': 'STRING', 'description': 'Stock symbol
(ticker).\n\n**e.g.** *`MSFT:NASDAQ`*\n**e.g.** *`MSFT`*\n**e.g.** *`AAPL`*', 'default': 'AAPL:NASDAQ'}, {'name': 'period', 'type': 'ENUM', 'description': "Period for which to get
company's income statement.\n\n**Periods**: *QUARTERLY*, *ANNUAL*.", 'default': ''}], 'optional_parameters': [{'name': 'language', 'type': 'STRING', 'description': 'The language to
use for the results, specified as a 2-letter language code - see [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).\n\n**Default**: *en*.', 'default': 'en'}],
'code': 'import requests\n\nurl = "https://real-time-finance-data.p.rapidapi.com/company-income-statement"\nquerystring = {"symbol": symbol, "language": language, "period":
period}\n\nheaders = {\n "X-RapidAPI-Key": "YOUR_RAPID_API_KEY",\n "X-RapidAPI-Host": "real-time-finance-data.p.rapidapi.com"\n}\n\nresponse = requests.get(url,
headers=headers, params=querystring)\n\nprint(response.json())\n', 'statuscode': 200, 'body': "{'key1': 'value', 'key2': 'value'}...", 'headers': {}, 'schema': {'type': 'object',
'properties': {'status': {'type': 'string'}, 'request_id': {'type': 'string'}, 'data': {'type': 'object', 'properties': {'symbol': {'type': 'string'}, 'type': {'type': 'string'},
'income_statement': {'type': 'array', 'items': {'type': 'object', 'properties': {'year': {'type': 'integer'}, 'quarter': {'type': 'integer'}, 'currency': {'type': 'string'},
'revenue': {'type': 'integer'}, 'operating_expense': {'type': 'integer'}, 'net_income': {'type': 'integer'}, 'net_profit_margin': {'type': 'number'}, 'earnings_per_share': {'type':
'number'}, 'EBITDA': {'type': 'integer'}, 'effective_task_rate_percent': {'type': 'number'}}}}, 'period': {'type': 'string'}}}}}}
Required API Key: {'SIGN-UP-FOR-KEY': 'YOUR_RAPID_API_KEY'}
Platform: RapidAPI
The rank 2 referenced tool documentation is:
API Name: Company Balance Sheet
API Description: Get public company's **quarterly** or **annual** balance sheet. Supports the *stock* type only.
API Details: {'name': 'Company Balance Sheet', 'url': 'https://real-time-finance-data.p.rapidapi.com/company-balance-sheet', 'description': "Get public company's **quarterly** or
**annual** balance sheet. Supports the *stock* type only.", 'method': 'GET', 'required_parameters': [{'name': 'period', 'type': 'ENUM', 'description': "Period for which to get
company's balance sheet.\n\n**Periods**: *QUARTERLY*, *ANNUAL*.", 'default': ''}, {'name': 'symbol', 'type': 'STRING', 'description': 'Stock symbol (ticker).\n\n**e.g.**
*`MSFT:NASDAQ`*\n**e.g.** *`MSFT`*\n**e.g.** *`AAPL`*', 'default': 'AAPL:NASDAQ'}], 'optional_parameters': [{'name': 'language', 'type': 'STRING', 'description': 'The language to
use for the results, specified as a 2-letter language code - see [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).\n\n**Default**: *en*.', 'default': 'en'}],
'code': 'import requests\n\nurl = "https://real-time-finance-data.p.rapidapi.com/company-balance-sheet"\nquerystring = {"language": language, "period": period, "symbol":
symbol}\n\nheaders = {\n "X-RapidAPI-Key": "YOUR_RAPID_API_KEY",\n "X-RapidAPI-Host": "real-time-finance-data.p.rapidapi.com"\n}\n\nresponse = requests.get(url,
headers=headers, params=querystring)\n\nprint(response.json())\n', 'statuscode': 200, 'body': "{'key1': 'value', 'key2': 'value'}...", 'headers': {}, 'schema': {'type': 'object',
'properties': {'status': {'type': 'string'}, 'request_id': {'type': 'string'}, 'data': {'type': 'object', 'properties': {'symbol': {'type': 'string'}, 'type': {'type': 'string'},
'balance_sheet': {'type': 'array', 'items': {'type': 'object', 'properties': {'year': {'type': 'integer'}, 'currency': {'type': 'string'}, 'cash_and_short_term_investments':
{'type': 'number'}, 'total_assets': {'type': 'integer'}, 'total_liabilities': {'type': 'integer'}, 'total_equity': {'type': 'integer'}, 'shares_outstanding': {'type': 'integer'},
'price_to_book': {'type': 'number'}, 'return_on_assets_percent': {'type': 'number'}, 'return_on_capital_percent': {'type': 'number'}}}}, 'period': {'type': 'string'}}}}}}
Required API Key: {'SIGN-UP-FOR-KEY': 'YOUR_RAPID_API_KEY'}
Platform: RapidAPI
The rank 3 referenced tool documentation is:
API Name: Company Cash Flow
API Description: Get public company's **quarterly** or **annual** cash flow information. Supports the *stock* type only.
API Details: {'name': 'Company Cash Flow', 'url': 'https://real-time-finance-data.p.rapidapi.com/company-cash-flow', 'description': "Get public company's **quarterly** or **annual**
cash flow information. Supports the *stock* type only.", 'method': 'GET', 'required_parameters': [{'name': 'period', 'type': 'ENUM', 'description': "Period for which to get
company's cash flow.\n\n**Periods**: *QUARTERLY*, *ANNUAL*.", 'default': ''}, {'name': 'symbol', 'type': 'STRING', 'description': 'Stock symbol (ticker).\n\n**e.g.**
*`MSFT:NASDAQ`*\n**e.g.** *`MSFT`*\n**e.g.** *`AAPL`*', 'default': 'AAPL:NASDAQ'}], 'optional_parameters': [{'name': 'language', 'type': 'STRING', 'description': 'The language to
use for the results, specified as a 2-letter language code - see [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).\n\n**Default**: *en*.', 'default': 'en'}],
'code': 'import requests\n\nurl = "https://real-time-finance-data.p.rapidapi.com/company-cash-flow"\nquerystring = {"period": period, "language": language, "symbol":
symbol}\n\nheaders = {\n "X-RapidAPI-Key": "YOUR_RAPID_API_KEY",\n "X-RapidAPI-Host": "real-time-finance-data.p.rapidapi.com"\n}\n\nresponse = requests.get(url,
headers=headers, params=querystring)\n\nprint(response.json())\n', 'statuscode': 200, 'body': "{'key1': 'value', 'key2': 'value'}...", 'headers': {}, 'schema': {'type': 'object',
'properties': {'status': {'type': 'string'}, 'request_id': {'type': 'string'}, 'data': {'type': 'object', 'properties': {'symbol': {'type': 'string'}, 'type': {'type': 'string'},
'cash_flow': {'type': 'array', 'items': {'type': 'object', 'properties': {'year': {'type': 'integer'}, 'quarter': {'type': 'integer'}, 'currency': {'type': 'string'}, 'net_income':
{'type': 'integer'}, 'cash_from_operations': {'type': 'integer'}, 'cash_from_investing': {'type': 'integer'}, 'cash_from_financing': {'type': 'integer'}, 'net_change_in_cash':
{'type': 'integer'}, 'free_cash_flow': {'type': 'integer'}}}}, 'period': {'type': 'string'}}}}}}
Required API Key: {'SIGN-UP-FOR-KEY': 'YOUR_RAPID_API_KEY'}
Platform: RapidAPI
The rank 4 referenced tool documentation is:
API Name: Stock / Company Overview
API Description: Get stock / public company details. Supports all stock types: *stock*, *index*, *mutual fund* and *futures*. Returns company details for the *stock* type.
API Details: {'name': 'Stock / Company Overview', 'url': 'https://real-time-finance-data.p.rapidapi.com/stock-overview', 'description': 'Get stock / public company details. Supports
all stock types: *stock*, *index*, *mutual fund* and *futures*. Returns company details for the *stock* type.', 'method': 'GET', 'required_parameters': [{'name': 'symbol', 'type':
'STRING', 'description': 'Stock symbol (ticker).\n\n**e.g.** *`MSFT:NASDAQ`*\n**e.g.** *`MSFT`*\n**e.g.** *`^DJI`*\n**e.g.** *`VTSAX`*', 'default': 'AAPL:NASDAQ'}],
'optional_parameters': [{'name': 'language', 'type': 'STRING', 'description': 'The language to use for the results, specified as a 2-letter language code - see [ISO
639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).\n\n**Default**: *en*.', 'default': 'en'}], 'code': 'import requests\n\nurl =
"https://real-time-finance-data.p.rapidapi.com/stock-overview"\nquerystring = {"symbol": symbol, "language": language}\n\nheaders = {\n "X-RapidAPI-Key": "YOUR_RAPID_API_KEY",\n
"X-RapidAPI-Host": "real-time-finance-data.p.rapidapi.com"\n}\n\nresponse = requests.get(url, headers=headers, params=querystring)\n\nprint(response.json())\n', 'statuscode': 200,
'body': "{'key1': 'value', 'key2': 'value'}...", 'headers': {}, 'schema': {'type': 'object', 'properties': {'status': {'type': 'string'}, 'request_id': {'type': 'string'}, 'data':
{'type': 'object', 'properties': {'symbol': {'type': 'string'}, 'name': {'type': 'string'}, 'type': {'type': 'string'}, 'price': {'type': 'number'}, 'open': {'type': 'number'},
'high': {'type': 'number'}, 'low': {'type': 'number'}, 'volume': {'type': 'integer'}, 'previous_close': {'type': 'number'}, 'change': {'type': 'number'}, 'change_percent': {'type':
'number'}, 'pre_or_post_market': {'type': 'number'}, 'pre_or_post_market_change': {'type': 'number'}, 'pre_or_post_market_change_percent': {'type': 'number'}, 'last_update_utc':
{'type': 'string'}, 'country_code': {'type': 'string'}, 'exchange': {'type': 'string'}, 'exchange_open': {'type': 'string'}, 'exchange_close': {'type': 'string'}, 'timezone':
{'type': 'string'}, 'utc_offset_sec': {'type': 'integer'}, 'currency': {'type': 'string'}, 'about': {'type': 'string'}, 'year_low': {'type': 'number'}, 'year_high': {'type':
'number'}, 'primary_exchange': {'type': 'string'}, 'company_website': {'type': 'string'}, 'company_country_code': {'type': 'string'}, 'company_country': {'type': 'string'},
'company_state': {'type': 'string'}, 'company_city': {'type': 'string'}, 'company_street_address': {'type': 'string'}, 'company_ceo': {'type': 'string'}, 'company_employees':
{'type': 'integer'}, 'company_cdp_score': {'type': 'string'}, 'company_founded_date': {'type': 'string'}, 'company_cdp_url': {'type': 'string'}, 'avg_volume': {'type': 'integer'},
'company_pe_ratio': {'type': 'number'}, 'company_market_cap': {'type': 'number'}, 'company_dividend_yield': {'type': 'number'}, 'wikipedia_url': {'type': 'string'}, 'google_mid':
{'type': 'string'}}}}}}
Required API Key: {'SIGN-UP-FOR-KEY': 'YOUR_RAPID_API_KEY'}
Platform: RapidAPI
The rank 5 referenced tool documentation is:
API Name: Currency Exchange Rate
API Description: Get currency / forex or crypto exchange rates.
API Details: {'name': 'Currency Exchange Rate', 'url': 'https://real-time-finance-data.p.rapidapi.com/currency-exchange-rate', 'description': 'Get currency / forex or crypto
exchange rates.', 'method': 'GET', 'required_parameters': [{'name': 'from_symbol', 'type': 'STRING', 'description': 'A 3-Letter currency code / symbol (ISO 4217) to convert. For
example: *USD*.', 'default': 'USD'}, {'name': 'to_symbol', 'type': 'STRING', 'description': 'A 3-Letter currency code / symbol (ISO 4217) to convert to. For example: *EUR*.',
'default': 'EUR'}], 'optional_parameters': [{'name': 'language', 'type': 'STRING', 'description': 'The language to use for the results, specified as a 2-letter language code - see
[ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).\n\n**Default**: *en*.', 'default': 'en'}], 'code': 'import requests\n\nurl =
"https://real-time-finance-data.p.rapidapi.com/currency-exchange-rate"\nquerystring = {"language": language, "from_symbol": from_symbol, "to_symbol": to_symbol}\n\nheaders = {\n
"X-RapidAPI-Key": "YOUR_RAPID_API_KEY",\n "X-RapidAPI-Host": "real-time-finance-data.p.rapidapi.com"\n}\n\nresponse = requests.get(url, headers=headers,
params=querystring)\n\nprint(response.json())\n', 'statuscode': 200, 'body': "{'key1': 'value', 'key2': 'value'}...", 'headers': {}, 'schema': {'type': 'object', 'properties':
{'status': {'type': 'string'}, 'request_id': {'type': 'string'}, 'data': {'type': 'object', 'properties': {'from_symbol': {'type': 'string'}, 'to_symbol': {'type': 'string'},
'type': {'type': 'string'}, 'exchange_rate': {'type': 'number'}, 'previous_close': {'type': 'number'}, 'last_update_utc': {'type': 'string'}}}}}}
Required API Key: {'SIGN-UP-FOR-KEY': 'YOUR_RAPID_API_KEY'}
Platform: RapidAPI
---
********************* Assistant Message *********************
[2025-02-23 17:36:46]
Tool Editor Agent: None
************************* Tool Calls *************************
[2025-02-23 17:36:46]
create_tool('tool_name'='search_income_statements', 'tool_code'='from autoagent.types import Result, Agent\nfrom typing import Union\nfrom autoagent.registry import
register_plugin_tool\nimport requests\n\n@register_plugin_tool("search_income_statements")\ndef search_income_statements(symbol: str, period: str, context_variables) -> Union[str,
Result]:\n """\n Retrieve income statements for a specified ticker over a specified period.\n\n Args:\n symbol: The stock symbol (ticker).\n period: The
period for which to get the company\'s income statement (\'QUARTERLY\' or \'ANNUAL\').\n context_variables: Additional context variables (if any).\n\n Returns:\n A
string representation of the company\'s income statement data.\n """\n url = "https://real-time-finance-data.p.rapidapi.com/company-income-statement"\n querystring =
{"symbol": symbol, "period": period, "language": "en"}\n\n headers = {\n "X-RapidAPI-Key": "YOUR_RAPID_API_KEY",\n "X-RapidAPI-Host":
"real-time-finance-data.p.rapidapi.com"\n }\n\n response = requests.get(url, headers=headers, params=querystring)\n\n if response.status_code == 200:\n return
response.json()\n else:\n return f"Error: {response.status_code} - {response.text}"')
*********************** Tool Execution ***********************
[2025-02-23 17:36:47]
Tool Execution: create_tool
Result:
---
[ERROR] Failed to list tools. Error: Failed to list tools. The MetaChain is not installed in editable mode.
This with gemini, same setup different error:
[2025-02-23 18:14:15]
Ending turn.
@Agent Former Agent has created agent form successfully with the following details:
<agents>
<system_input>
Request for financial information, including balance sheets, cash flow statements, and income statements for a given ticker over a given period.
</system_input>
<system_output>
<key>financial_data</key>
<description>The requested financial data, including balance sheets, cash flow statements, and income statements.</description>
</system_output>
<agent>
<name>Financial Agent</name>
<description>An agent that can retrieve financial information for a given ticker over a given period, including balance sheets, cash flow statements, and income
statements.</description>
<instructions>You are a financial agent that can help the user to search financial information online. You can get balance sheets, cash flow statements, and income
statements for a given ticker over a given period.</instructions>
<tools category="new">
<tool>
<name>get_balance_sheet</name>
<description>Get the balance sheet for a given ticker over a given period.</description>
</tool>
<tool>
<name>get_cash_flow_statement</name>
<description>Get the cash flow statement for a given ticker over a given period.</description>
</tool>
<tool>
<name>get_income_statement</name>
<description>Get the income statement for a given ticker over a given period.</description>
</tool>
<tool>
<name>search_financial_data</name>
<description>Search for financial data online.</description>
</tool>
</tools>
<agent_input>
<key>financial_request</key>
<description>A request for financial information, including the ticker and the period.</description>
</agent_input>
<agent_output>
<key>financial_data</key>
<description>The requested financial data, including balance sheets, cash flow statements, and income statements.</description>
</agent_output>
</agent>
</agents>
It is time to create the desired tools, do you have any suggestions for creating the tools? (type "exit" to quit, press "Enter" to continue):
Your request:
@Tool Editor Agent will help you, be patient...
************************ Receive Task ************************
[2025-02-23 18:14:17]
Receiveing the task:
Your task is to create a list of new tools for me, the tools are:
1. Tool name: get_balance_sheet, Tool description: Get the balance sheet for a given ticker over a given period.
2. Tool name: get_cash_flow_statement, Tool description: Get the cash flow statement for a given ticker over a given period.
3. Tool name: get_income_statement, Tool description: Get the income statement for a given ticker over a given period.
4. Tool name: search_financial_data, Tool description: Search for financial data online.
Please create these new tools for me, note that you can NOT stop util you have created all the tools and tested them using `run_tool` successfully.
If ALL tools are created and tested successfully, you can stop and use `case_resolved` tool. Otherwise, you should continue to create the tools. After you have tried your best, you
can use `case_not_resolved` tool to give the reason why the tool is not created or tested successfully.
[IMPORTANT] ALL tools MUST be tested successfully by running the tools using `run_tool` before you stop.
Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm.set_verbose=True'.
Provider List: https://docs.litellm.ai/docs/providers
Traceback (most recent call last):
File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py", line 1537, in completion
response = client.post(url=url, headers=headers, json=data) # type: ignore
File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/litellm/llms/custom_httpx/http_handler.py", line 471, in post
raise e
File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/litellm/llms/custom_httpx/http_handler.py", line 451, in post
response.raise_for_status()
File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/httpx/_models.py", line 763, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=this shit exosed my key damn'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/litellm/main.py", line 2200, in completion
response = vertex_chat_completion.completion( # type: ignore
File "/home/luca/anaconda3/envs/auto_agent/lib/python3.10/site-packages/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py", line 1541, in completion
raise VertexAIError(
litellm.llms.vertex_ai.common_utils.VertexAIError: {
"error": {
"code": 400,
"message": "* GenerateContentRequest.tools[0].function_declarations[0].parameters.properties: should be non-empty for OBJECT type\n* GenerateContentRequest.tools[0].function_declarations[6].parameters.properties: should be non-empty for OBJECT type\n* GenerateContentRequest.tools[0].function_declarations[7].parameters.properties: should be non-empty for OBJECT type\n",
"status": "INVALID_ARGUMENT"
}
}