openbmb / xagent Goto Github PK
View Code? Open in Web Editor NEWAn Autonomous LLM Agent for Complex Task Solving
Home Page: https://blog.x-agent.net/blog/xagent/
License: Apache License 2.0
An Autonomous LLM Agent for Complex Task Solving
Home Page: https://blog.x-agent.net/blog/xagent/
License: Apache License 2.0
After I spent a prolong time in auto reflection and burneda lot of tokens, it reached max context lenght, then tried to acess gpt-4-32k and couldnt, then it just broke.
max context length reached, retrying with gpt-4-32k
Traceback (most recent call last):
File "D:\AI\XAgent\XAgent\ai_functions\request\openai.py", line 86, in openai_chatcompletion_request
raise InvalidRequestError('maximum context length exceeded',None)
openai.error.InvalidRequestError: maximum context length exceeded
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\AI\XAgent\XAgentServer\server.py", line 104, in interact
await task_handler.outer_loop_async()
File "D:\AI\XAgent\XAgent\workflow\task_handler.py", line 146, in outer_loop_async
search_method = await self.inner_loop_async(self.now_dealing_task)
File "D:\AI\XAgent\XAgent\workflow\task_handler.py", line 292, in inner_loop_async
await search_method.run_async(config=self.config,
File "D:\AI\XAgent\XAgent\inner_loop_search_algorithms\ReACT.py", line 64, in run_async
await self.generate_chain_async(config, agent, task_handler, function_list, tool_functions_description_list, task_id)
File "D:\AI\XAgent\XAgent\inner_loop_search_algorithms\ReACT.py", line 290, in generate_chain_async
LLM_code, new_message, tokens = agent.parse(
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init_.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init_.py", line 379, in call
do = self.iter(retry_state=retry_state)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init_.py", line 325, in iter
raise retry_exc.reraise()
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init_.py", line 158, in reraise
raise self.last_attempt.result()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 438, in result
return self.__get_result()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 390, in get_result
raise self.exception
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 382, in call
result = fn(*args, **kwargs)
File "D:\AI\XAgent\XAgent\agent\tool_agent\agent.py", line 38, in parse
response = chat_completion_request(
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 379, in call
do = self.iter(retry_state=retry_state)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 314, in iter
return fut.result()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 438, in result
return self.__get_result()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 390, in get_result
raise self.exception
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 382, in call
result = fn(*args, **kwargs)
File "D:\AI\XAgent\XAgent\agent\utils.py", line 48, in chat_completion_request
response = openai_chatcompletion_request(**json_data)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 379, in call
do = self.iter(retry_state=retry_state)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 314, in iter
return fut.result()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 438, in result
return self.__get_result()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 390, in __get_result
raise self.exception
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 382, in call
result = fn(*args, **kwargs)
File "D:\AI\XAgent\XAgent\ai_functions\request\openai.py", line 103, in openai_chatcompletion_request
response = openai.ChatCompletion.create(**chatcompletion_kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 155, in create
response, _, api_key = requestor.request(
File "D:\AI\XAgent\myenv\lib\site-packages\openai\api_requestor.py", line 299, in request
resp, got_stream = self._interpret_response(result, stream)
File "D:\AI\XAgent\myenv\lib\site-packages\openai\api_requestor.py", line 710, in _interpret_response
self._interpret_response_line(
File "D:\AI\XAgent\myenv\lib\site-packages\openai\api_requestor.py", line 775, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: The model gpt-4-32k
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.
Traceback (most recent call last):
File "D:\AI\XAgent\XAgent\ai_functions\request\openai.py", line 86, in openai_chatcompletion_request
raise InvalidRequestError('maximum context length exceeded',None)
openai.error.InvalidRequestError: maximum context length exceeded
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\AI\XAgent\run.py", line 48, in
cmd.start(
File "D:\AI\XAgent\command.py", line 163, in start
self.run({
File "D:\AI\XAgent\command.py", line 137, in run
asyncio.run(server.interact(interaction=interaction))
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete
return future.result()
File "D:\AI\XAgent\XAgentServer\server.py", line 107, in interact
raise e
File "D:\AI\XAgent\XAgentServer\server.py", line 104, in interact
await task_handler.outer_loop_async()
File "D:\AI\XAgent\XAgent\workflow\task_handler.py", line 146, in outer_loop_async
search_method = await self.inner_loop_async(self.now_dealing_task)
File "D:\AI\XAgent\XAgent\workflow\task_handler.py", line 292, in inner_loop_async
await search_method.run_async(config=self.config,
File "D:\AI\XAgent\XAgent\inner_loop_search_algorithms\ReACT.py", line 64, in run_async
await self.generate_chain_async(config, agent, task_handler, function_list, tool_functions_description_list, task_id)
File "D:\AI\XAgent\XAgent\inner_loop_search_algorithms\ReACT.py", line 290, in generate_chain_async
LLM_code, new_message, tokens = agent.parse(
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init_.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init_.py", line 379, in call
do = self.iter(retry_state=retry_state)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init_.py", line 325, in iter
raise retry_exc.reraise()
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init_.py", line 158, in reraise
raise self.last_attempt.result()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 438, in result
return self.__get_result()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 390, in get_result
raise self.exception
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 382, in call
result = fn(*args, **kwargs)
File "D:\AI\XAgent\XAgent\agent\tool_agent\agent.py", line 38, in parse
response = chat_completion_request(
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 379, in call
do = self.iter(retry_state=retry_state)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 314, in iter
return fut.result()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 438, in result
return self.__get_result()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 390, in get_result
raise self.exception
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 382, in call
result = fn(*args, **kwargs)
File "D:\AI\XAgent\XAgent\agent\utils.py", line 48, in chat_completion_request
response = openai_chatcompletion_request(**json_data)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 379, in call
do = self.iter(retry_state=retry_state)
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 314, in iter
return fut.result()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 438, in result
return self.__get_result()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\concurrent\futures_base.py", line 390, in __get_result
raise self.exception
File "D:\AI\XAgent\myenv\lib\site-packages\tenacity_init.py", line 382, in call
result = fn(*args, **kwargs)
File "D:\AI\XAgent\XAgent\ai_functions\request\openai.py", line 103, in openai_chatcompletion_request
response = openai.ChatCompletion.create(**chatcompletion_kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 155, in create
response, _, api_key = requestor.request(
File "D:\AI\XAgent\myenv\lib\site-packages\openai\api_requestor.py", line 299, in request
resp, got_stream = self._interpret_response(result, stream)
File "D:\AI\XAgent\myenv\lib\site-packages\openai\api_requestor.py", line 710, in _interpret_response
self._interpret_response_line(
File "D:\AI\XAgent\myenv\lib\site-packages\openai\api_requestor.py", line 775, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: The model gpt-4-32k
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.
(myenv) PS D:\AI\XAgent>
I have sent an email to [email protected] for cooperation.
Have you receive that?
Looking for a reply, thanks!
Just a FYI. If you like to start the entire XAgent (tool, agent backend, agent frontend) in a remote machine and visit the UI service locally. You would need such changes. Otherwise, it won't work. I will try to make some configuration changes for users like me (laptop + remote dev machine)
34.216.99.75
is the IP of my remote dev machine
XAgent/XAgentServer/docker-compose.yml maps port 8000 but XAgent-Server listen to 16204
[ec2-user@ip-172-31-28-146 XAgent]$ python3 run.py --task "Help me find some japanese resturants in seattle area which price/person lower than $50" --model "gpt-4"
Traceback (most recent call last):
File "/home/ec2-user/XAgent/run.py", line 5, in <module>
from XAgent.config import CONFIG
File "/home/ec2-user/XAgent/XAgent/config.py", line 39
match model_name.lower():
^
SyntaxError: invalid syntax
租用的服务器不支持docker操作,可不可以不用docker部署项目呢
用户可以使用第三方chatgpt服务,通过自定义API URL和API KEY来实现。
For some reason it is spending crazy a lot of resources on the this reflection thing and burning money:
-=-=-=-=-=-=-= THOUGHTS, REASONING, PLAN AND CRITICISM WILL NOW BE VERIFIED BY AGENT -=-=-=-=-=-=-=
Executing AI Function: summarize_action
using gpt-4
Action summarized in 131 tokens
Executing AI Function: actions_reflection
using gpt-4
using gpt-4
using gpt-4
using gpt-4
using gpt-4
using gpt-4
using gpt-4
using gpt-4
using gpt-4
None
THOUGHTS: After correcting the IndentationError in the Flask server script, it is crucial to re-run the script to verify that the error has indeed been rectified and the application works as expected.
REASONING: Performing this action is essential to ensure the health of the application. By running the application, we can confirm that the previous issues have been resolved and that the application can perform its intended functionalities. This action also allows for the identification of any other potential errors that may have been overlooked previously.
PLAN:
XAgentWeb上一直登陆失败,显示
ERROR 9:59:48 PM [vite] http proxy error at /login: 21:59:48
Error: connect ECONNREFUSED 127.0.0.1:8090
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) (x2)
agentserver正常:
[+] Running 1/0
✔ Container XAgent-Server Created 0.0s
Attaching to XAgent-Server
XAgent-Server | INFO: Uvicorn running on http://0.0.0.0:16204 (Press CTRL+C to quit)
XAgent-Server | INFO: Started parent process [1]
XAgent-Server | INFO: Started server process [8]
XAgent-Server | INFO: Waiting for application startup.
XAgent-Server | INFO: Started server process [15]
XAgent-Server | INFO: Waiting for application startup.
XAgent-Server | INFO: Started server process [13]
XAgent-Server | INFO: Waiting for application startup.
XAgent-Server | INFO: Started server process [9]
XAgent-Server | INFO: Waiting for application startup.
XAgent-Server | INFO: Started server process [12]
XAgent-Server | INFO: Waiting for application startup.
XAgent-Server | INFO: Started server process [10]
XAgent-Server | INFO: Waiting for application startup.
XAgent-Server | INFO: Started server process [11]
XAgent-Server | INFO: Waiting for application startup.
XAgent-Server | INFO: Started server process [14]
XAgent-Server | INFO: Waiting for application startup.
XAgent-Server | INFO: Application startup complete.
XAgent-Server | INFO: Application startup complete.
XAgent-Server | INFO: Application startup complete.
XAgent-Server | INFO: Application startup complete.
XAgent-Server | INFO: Application startup complete.
XAgent-Server | INFO: Application startup complete.
XAgent-Server | INFO: Application startup complete.
XAgent-Server | INFO: Application startup complete.
The following error occurs. The task was to develop the game tetris in python using the pygame engine.
NEXT ACTION: COMMAND: shell_command_executor ARGUMENTS: {'command': 'pip install pygame'}
Traceback (most recent call last):
File "I:\KI\XAgent\XAgentServer\server.py", line 104, in interact
await task_handler.outer_loop_async()
File "I:\KI\XAgent\XAgent\workflow\task_handler.py", line 146, in outer_loop_async
search_method = await self.inner_loop_async(self.now_dealing_task)
File "I:\KI\XAgent\XAgent\workflow\task_handler.py", line 292, in inner_loop_async
await search_method.run_async(config=self.config,
File "I:\KI\XAgent\XAgent\inner_loop_search_algorithms\ReACT.py", line 64, in run_async
await self.generate_chain_async(config, agent, task_handler, function_list, tool_functions_description_list, task_id)
File "I:\KI\XAgent\XAgent\inner_loop_search_algorithms\ReACT.py", line 328, in generate_chain_async
tool_output, tool_output_status_code, need_for_plan_refine, using_tools = function_handler.handle_tool_call(
File "I:\KI\XAgent\XAgent\tool_call_handle.py", line 360, in handle_tool_call
command_result, tool_output_status_code, = toolserver_interface.execute_command_client(
File "I:\KI\XAgent\XAgent\tool_call_handle.py", line 240, in execute_command_client
recorder.regist_tool_server(url=url,
File "I:\KI\XAgent\XAgent\running_recorder.py", line 135, in regist_tool_server
json.dump(tool_record, writer, indent=2, ensure_ascii=False)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\json_init_.py", line 180, in dump
fp.write(chunk)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 305-344: character maps to
Disconnect with client 78f0a4d1-c992-4739-b219-9c76138f8c3b:
websocket 78f0a4d1-c992-4739-b219-9c76138f8c3b remove from active connections
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\uvicorn\protocols\websockets\websockets_impl.py", line 254, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\fastapi\applications.py", line 276, in call
await super().call(scope, receive, send)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\starlette\applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\starlette\middleware\errors.py", line 149, in call
await self.app(scope, receive, send)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\starlette\middleware\cors.py", line 76, in call
await self.app(scope, receive, send)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\starlette\middleware\base.py", line 26, in call
await self.app(scope, receive, send)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\starlette\middleware\exceptions.py", line 79, in call
raise exc
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\starlette\middleware\exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call
raise e
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\starlette\routing.py", line 718, in call
await route.handle(scope, receive, send)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\starlette\routing.py", line 341, in handle
await self.app(scope, receive, send)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\starlette\endpoints.py", line 89, in dispatch
raise exc
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\starlette\endpoints.py", line 81, in dispatch
await self.on_receive(websocket, data)
File "I:\KI\XAgent\app.py", line 628, in on_receive
await asyncio.create_task(self.do_running_long_task(parameter))
File "I:\KI\XAgent\app.py", line 688, in do_running_long_task
await task
File "I:\KI\XAgent\XAgentServer\server.py", line 107, in interact
raise e
File "I:\KI\XAgent\XAgentServer\server.py", line 104, in interact
await task_handler.outer_loop_async()
File "I:\KI\XAgent\XAgent\workflow\task_handler.py", line 146, in outer_loop_async
search_method = await self.inner_loop_async(self.now_dealing_task)
File "I:\KI\XAgent\XAgent\workflow\task_handler.py", line 292, in inner_loop_async
await search_method.run_async(config=self.config,
File "I:\KI\XAgent\XAgent\inner_loop_search_algorithms\ReACT.py", line 64, in run_async
await self.generate_chain_async(config, agent, task_handler, function_list, tool_functions_description_list, task_id)
File "I:\KI\XAgent\XAgent\inner_loop_search_algorithms\ReACT.py", line 328, in generate_chain_async
tool_output, tool_output_status_code, need_for_plan_refine, using_tools = function_handler.handle_tool_call(
File "I:\KI\XAgent\XAgent\tool_call_handle.py", line 360, in handle_tool_call
command_result, tool_output_status_code, = toolserver_interface.execute_command_client(
File "I:\KI\XAgent\XAgent\tool_call_handle.py", line 240, in execute_command_client
recorder.regist_tool_server(url=url,
File "I:\KI\XAgent\XAgent\running_recorder.py", line 135, in regist_tool_server
json.dump(tool_record, writer, indent=2, ensure_ascii=False)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\json_init_.py", line 180, in dump
fp.write(chunk)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 305-344: character maps to
ERROR: closing handshake failed
Traceback (most recent call last):
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\websockets\legacy\protocol.py", line 959, in transfer_data
message = await self.read_message()
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\websockets\legacy\protocol.py", line 1029, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\websockets\legacy\protocol.py", line 1104, in read_data_frame
frame = await self.read_frame(max_size)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\websockets\legacy\protocol.py", line 1161, in read_frame
frame = await Frame.read(
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\websockets\legacy\framing.py", line 68, in read
data = await reader(2)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\asyncio\streams.py", line 708, in readexactly
await self._wait_for_data('readexactly')
File "C:\Users\heins\miniconda3\envs\vicuna\lib\asyncio\streams.py", line 502, in _wait_for_data
await self._waiter
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\websockets\legacy\server.py", line 248, in handler
await self.close()
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\websockets\legacy\protocol.py", line 766, in close
await self.write_close_frame(Close(code, reason))
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\websockets\legacy\protocol.py", line 1232, in write_close_frame
await self.write_frame(True, OP_CLOSE, data, _state=State.CLOSING)
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\websockets\legacy\protocol.py", line 1205, in write_frame
await self.drain()
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\websockets\legacy\protocol.py", line 1194, in drain
await self.ensure_open()
File "C:\Users\heins\miniconda3\envs\vicuna\lib\site-packages\websockets\legacy\protocol.py", line 935, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: sent 1000 (OK); no close frame received
This is what ChatGPT has to say to the error:
The error UnicodeEncodeError: 'charmap' codec can't encode characters in position 305-344: character maps to indicates that Python tried to encode a Unicode character that is not defined in the current character map (charmap).
This error occurs when you try to write such a character to a file that was opened in a format that does not support this character. By default, Python uses the cp1252 character map on Windows, which does not include this character.
To fix the problem, you can open the file in UTF-8 format, which supports all Unicode characters. You can do this by adding the encoding='utf-8' parameter to the open function when you open the file. Here is an example:
with open('myfile.txt', 'w', encoding='utf-8') as f:
json.dump(mydata, f)
In your specific case, the error seems to occur in the regist_tool_server function in the running_recorder.py file. You could try opening the file in this function in UTF-8 format to fix the problem.
It seems that the excellent package dynaconf can help you to provide a better config and secret management.
An examples from us: https://github.com/quanttide/qcloud-sdk-py/blob/master/qcloud_sdk/config.py
I would like to help you on that if you guys needs.
[1]
ToolServer/docker-compose.yml
[2]
logging:
driver: "none"
[3]
logging:
driver: "json-file"
[email protected] dev
vite --host
file:///XAgent/XAgentWeb/node_modules/vite/bin/vite.js:7
await import('source-map-support').then((r) => r.default.install())
^^^^^
SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
at async link (internal/modules/esm/module_job.js:42:21)
npm ERR! code 1
npm ERR! path /home/ys/XAgent/XAgentWeb
npm ERR! command failed
npm ERR! command sh -c vite --host
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-10-18T12_14_44_491Z-debug.log
执行失败log ( /root/.npm/_logs/2023-10-18T12_14_44_491Z-debug.log )
0 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev' ]
1 info using [email protected]
2 info using [email protected]
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/share/nodejs/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/home/ys/XAgent/XAgentWeb/.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/root/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 5ms
19 verbose npm-session 8f61d137f4f07a4c
20 timing npm:load Completed in 11ms
21 timing command:run-script Completed in 82ms
22 verbose stack Error: command failed
22 verbose stack at ChildProcess. (/usr/share/nodejs/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack at ChildProcess.emit (events.js:314:20)
22 verbose stack at maybeClose (internal/child_process.js:1022:16)
22 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
23 verbose pkgid [email protected]
24 verbose cwd /XAgent/XAgentWeb
25 verbose Linux 5.10.0-23-amd64
26 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
27 verbose node v12.22.12
28 verbose npm v7.5.2
29 error code 1
30 error path /home/ys/XAgent/XAgentWeb
31 error command failed
32 error command sh -c vite --host
33 verbose exit 1
除了api_key之外还经常使用到的是api_base,在设置中能否配置这样的选项?
郑辉
Is it possible to integrate XAgent with multi-agent frameworks like ChatDev and Autogen?
Not the first time I got this, dont have any idea of whats causing it, gonna paste my entire console and attach the running record:
`(myenv) PS D:\AI\XAgent> python run.py --task "Application Development Prompt: Adversarial Attack on Image Content. Objective: Create an application to make text within an image undetectable to AI detection systems. Functionalities: 1)Image Upload: Users should be able to upload an image containing a mix of objects and text. 2)Target Area Selection: Users should be able to highlight or draw on the specific area of the image (primarily text) they wish to target for the adversarial attack. 3)Submission: After highlighting, users can click 'submit' to initiate the adversarial attack. Specifications: The adversarial attack should be based on the most current and effective techniques for this scenario. The end goal is to modify the targeted text area such that AI misinterprets it as non-text content, effectively making it 'invisible' to AI. For the drawing interface, consider using Gradio or any other suitable and convenient tool. Resources Provided: A folder titled 'adversarial-robustness-toolbox' has been attached. This contains a GitHub repository with up-to-date adversarial attack frameworks that can serve as a foundation for this development." --upload_files "D:\AI\adversarial-robustness-toolbox" --model "gpt-4"
XAgentServer is running on cmd mode
XAgentServer log: XAgentServer\localstorage\interact_records\2023-10-20\acded487eca74b689134d1e42867cb88
init localstorage connection: interaction.json
-=-=--=-=-=-=-=-=-= Current Instruction =-=-=-=-=-=-=-=-=-=-=-=-=-=-
Application Development Prompt: Adversarial Attack on Image Content. Objective: Create an application to make text within an image undetectable to AI detection systems. Functionalities: 1)Image Upload: Users should be able to upload an image containing a mix of objects and text. 2)Target Area Selection: Users should be able to highlight or draw on the specific area of the image (primarily text) they wish to target for the adversarial attack. 3)Submission: After highlighting, users can click 'submit' to initiate the adversarial attack. Specifications: The adversarial attack should be based on the most current and effective techniques for this scenario. The end goal is to modify the targeted text area such that AI misinterprets it as non-text content, effectively making it 'invisible' to AI. For the drawing interface, consider using Gradio or any other suitable and convenient tool. Resources Provided: A folder titled 'adversarial-robustness-toolbox' has been attached. This contains a GitHub repository with up-to-date adversarial attack frameworks that can serve as a foundation for this development.
Receive args from acded487eca74b689134d1e42867cb88: user_id: admin, token: xagent-admin, description: XAgent-Test
Receive data from acded487eca74b689134d1e42867cb88: Application Development Prompt: Adversarial Attack on Image Content. Objective: Create an application to make text within an image undetectable to AI detection systems. Functionalities: 1)Image Upload: Users should be able to upload an image containing a mix of objects and text. 2)Target Area Selection: Users should be able to highlight or draw on the specific area of the image (primarily text) they wish to target for the adversarial attack. 3)Submission: After highlighting, users can click 'submit' to initiate the adversarial attack. Specifications: The adversarial attack should be based on the most current and effective techniques for this scenario. The end goal is to modify the targeted text area such that AI misinterprets it as non-text content, effectively making it 'invisible' to AI. For the drawing interface, consider using Gradio or any other suitable and convenient tool. Resources Provided: A folder titled 'adversarial-robustness-toolbox' has been attached. This contains a GitHub repository with up-to-date adversarial attack frameworks that can serve as a foundation for this development.
Register parameter: {'interaction_id': 'acded487eca74b689134d1e42867cb88', 'parameter_id': '1768b1f4f80e41b5b229e2765e50648c', 'args': {'description': 'XAgent-Test', 'role_name': 'Assistant', 'download_files': [], 'file_list': ['D:\AI\adversarial-robustness-toolbox'], 'record_dir': None, 'goal': "Application Development Prompt: Adversarial Attack on Image Content. Objective: Create an application to make text within an image undetectable to AI detection systems. Functionalities: 1)Image Upload: Users should be able to upload an image containing a mix of objects and text. 2)Target Area Selection: Users should be able to highlight or draw on the specific area of the image (primarily text) they wish to target for the adversarial attack. 3)Submission: After highlighting, users can click 'submit' to initiate the adversarial attack. Specifications: The adversarial attack should be based on the most current and effective techniques for this scenario. The end goal is to modify the targeted text area such that AI misinterprets it as non-text content, effectively making it 'invisible' to AI. For the drawing interface, consider using Gradio or any other suitable and convenient tool. Resources Provided: A folder titled 'adversarial-robustness-toolbox' has been attached. This contains a GitHub repository with up-to-date adversarial attack frameworks that can serve as a foundation for this development.", 'mode': 'auto', 'plan': [], 'max_wait_seconds': 600}} into interaction of acded487eca74b689134d1e42867cb88, done!
init interaction: acded487eca74b689134d1e42867cb88
Register logger into interaction of acded487eca74b689134d1e42867cb88, done!
Register io into interaction of acded487eca74b689134d1e42867cb88, done!
Register db into interaction of acded487eca74b689134d1e42867cb88, done!
Register logger into XAgentServer of acded487eca74b689134d1e42867cb88, done!
Start a new thread to run interaction of acded487eca74b689134d1e42867cb88, done!
Constructing an AgentDispatcher: XAgentDispatcher
server is running, the start query is Application Development Prompt: Adversarial Attack on Image Content. Objective: Create an application to make text within an image undetectable to AI detection systems. Functionalities: 1)Image Upload: Users should be able to upload an image containing a mix of objects and text. 2)Target Area Selection: Users should be able to highlight or draw on the specific area of the image (primarily text) they wish to target for the adversarial attack. 3)Submission: After highlighting, users can click 'submit' to initiate the adversarial attack. Specifications: The adversarial attack should be based on the most current and effective techniques for this scenario. The end goal is to modify the targeted text area such that AI misinterprets it as non-text content, effectively making it 'invisible' to AI. For the drawing interface, consider using Gradio or any other suitable and convenient tool. Resources Provided: A folder titled 'adversarial-robustness-toolbox' has been attached. This contains a GitHub repository with up-to-date adversarial attack frameworks that can serve as a foundation for this development.
{
"openai_keys": {
"gpt-3.5-turbo-16k": [
{
"api_key": "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",
"api_base": "https://example.com",
"api_type": "azure",
"api_version": "2023-07-01-preview",
"engine": "GPT-35-Turbo-16k"
},
{
"api_key": "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",
"organization": "org-6Peuqd1RFYHaPELI2ETzkHg8",
"model": "gpt-3.5-turbo-16k"
}
],
"gpt-4": [
{
"api_key": "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",
"organization": "org-6Peuqd1RFYHaPELI2ETzkHg8",
"model": "gpt-4"
},
{
"api_key": "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",
"organization": "org-6Peuqd1RFYHaPELI2ETzkHg8",
"model": "gpt-4"
}
]
},
"default_completion_kwargs": {
"model": "gpt-4",
"temperature": 0.1,
"request_timeout": 60
},
"enable_summary": true,
"summary": {
"single_action_max_length": 1000,
"max_return_length": 4000
},
"use_selfhost_toolserver": true,
"selfhost_toolserver_url": "http://localhost:8080",
"max_retry_times": 2,
"max_subtask_chain_length": 10,
"max_plan_refine_chain_length": 2,
"max_plan_tree_depth": 3,
"max_plan_tree_width": 5,
"max_plan_length": 5000,
"rapidapi_retrieve_tool_count": 0,
"enable_ask_human_for_help": true,
"tool_blacklist": [
"FileSystemEnv_print_filesys_struture"
],
"record_dir": null
}
Human-In-The-Loop True
ToolServer connected in http://localhost:8080
Error happens when uploading file D:\AI\adversarial-robustness-toolbox
[Errno 13] Permission denied: 'D:\AI\adversarial-robustness-toolbox'
Start outer loop async
-=-=-=-=-=-=-= BEGIN QUERY SOVLING -=-=-=-=-=-=-=
Role Assistant
Task Application Development Prompt: Adversarial Attack on Image Content. Objective: Create an application to make text within an image undetectable to AI detection systems. Functionalities: 1)Image Upload: Users should be able to upload an image containing a mix of objects and text. 2)Target Area Selection: Users should be able to highlight or draw on the specific area of the image (primarily text) they wish to target for the adversarial attack. 3)Submission: After highlighting, users can click 'submit' to initiate the adversarial attack. Specifications: The adversarial attack should be based on the most current and effective techniques for this scenario. The end goal is to modify the targeted text area such that AI misinterprets it as non-text content, effectively making it 'invisible' to AI. For the drawing interface, consider using Gradio or any other suitable and convenient tool. Resources Provided: A folder titled 'adversarial-robustness-toolbox' has been attached. This contains a GitHub repository with up-to-date adversarial attack frameworks that can serve as a foundation for this development.
-=-=-=-=-=-=-= GENERATE INITIAL_PLAN -=-=-=-=-=-=-=
Constructing an Agent: PlanGenerateAgent
from _chat_completion_request
openai_chatcompletion_request: using gpt-4
[Task ID] 1
[Name] act as Assistant
[Goal] Application Development Prompt: Adversarial Attack on Image Content. Objective: Create an application to make text within an image undetectable to AI detection systems. Functionalities: 1)Image Upload: Users should be able to upload an image containing a mix of objects and text. 2)Target Area Selection: Users should be able to highlight or draw on the specific area of the image (primarily text) they wish to target for the adversarial attack. 3)Submission: After highlighting, users can click 'submit' to initiate the adversarial attack. Specifications: The adversarial attack should be based on the most current and effective techniques for this scenario. The end goal is to modify the targeted text area such that AI misinterprets it as non-text content, effectively making it 'invisible' to AI. For the drawing interface, consider using Gradio or any other suitable and convenient tool. Resources Provided: A folder titled 'adversarial-robustness-toolbox' has been attached. This contains a GitHub repository with up-to-date adversarial attack frameworks that can serve as a foundation for this development.
[Status] TODO
[Task ID] 1.1
[Name] Design and implement user interface
[Goal] Design a user interface that allows the user to upload an image and select a target area on the image for the adversarial attack. Use a tool like Gradio, and enable a 'submit' button to initiate the attack.
[Status] TODO
[Milestones]
cv2
in Python, it seems this package have not been installed in Python. I should use the shell command executor tool to install it before testingcv2
Python library package is needed to handle image processing in Python and it is not currently installed in my Python environment. Hence, I need to install it to be able to test the image upload functionality of the image adversarial attack application. Using the shell command executor tool, I am capable of executing package installation commands in root privilege.The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connectionpool.py", line 791, in urlopen
response = self._make_request(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connectionpool.py", line 497, in _make_request
conn.request(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connection.py", line 395, in request
self.endheaders()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1271, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1031, in _send_output
self.send(msg)
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 969, in send
self.connect()
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connection.py", line 243, in connect
self.sock = self._new_conn()
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connection.py", line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001D641569600>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\AI\XAgent\myenv\lib\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connectionpool.py", line 845, in urlopen
retries = retries.increment(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /execute_tool (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001D641569600>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\AI\XAgent\XAgentServer\server.py", line 104, in interact
await task_handler.outer_loop_async()
File "D:\AI\XAgent\XAgent\workflow\task_handler.py", line 146, in outer_loop_async
search_method = await self.inner_loop_async(self.now_dealing_task)
File "D:\AI\XAgent\XAgent\workflow\task_handler.py", line 292, in inner_loop_async
await search_method.run_async(config=self.config,
File "D:\AI\XAgent\XAgent\inner_loop_search_algorithms\ReACT.py", line 64, in run_async
await self.generate_chain_async(config, agent, task_handler, function_list, tool_functions_description_list, task_id)
File "D:\AI\XAgent\XAgent\inner_loop_search_algorithms\ReACT.py", line 331, in generate_chain_async
tool_output, tool_output_status_code, need_for_plan_refine, using_tools = function_handler.handle_tool_call(
File "D:\AI\XAgent\XAgent\tool_call_handle.py", line 371, in handle_tool_call
command_result, tool_output_status_code, = toolserver_interface.execute_command_client(
File "D:\AI\XAgent\XAgent\tool_call_handle.py", line 216, in execute_command_client
response = requests.post(url, json=payload, cookies=self.cookies)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /execute_tool (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001D641569600>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
Traceback (most recent call last):
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connection.py", line 203, in _new_conn
sock = connection.create_connection(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\util\connection.py", line 85, in create_connection
raise err
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connectionpool.py", line 791, in urlopen
response = self._make_request(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connectionpool.py", line 497, in _make_request
conn.request(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connection.py", line 395, in request
self.endheaders()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1271, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1031, in _send_output
self.send(msg)
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 969, in send
self.connect()
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connection.py", line 243, in connect
self.sock = self._new_conn()
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connection.py", line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001D641569600>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\AI\XAgent\myenv\lib\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connectionpool.py", line 845, in urlopen
retries = retries.increment(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /execute_tool (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001D641569600>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\AI\XAgent\XAgentServer\server.py", line 107, in interact
raise e
File "D:\AI\XAgent\XAgentServer\server.py", line 104, in interact
await task_handler.outer_loop_async()
File "D:\AI\XAgent\XAgent\workflow\task_handler.py", line 146, in outer_loop_async
search_method = await self.inner_loop_async(self.now_dealing_task)
File "D:\AI\XAgent\XAgent\workflow\task_handler.py", line 292, in inner_loop_async
await search_method.run_async(config=self.config,
File "D:\AI\XAgent\XAgent\inner_loop_search_algorithms\ReACT.py", line 64, in run_async
await self.generate_chain_async(config, agent, task_handler, function_list, tool_functions_description_list, task_id)
File "D:\AI\XAgent\XAgent\inner_loop_search_algorithms\ReACT.py", line 331, in generate_chain_async
tool_output, tool_output_status_code, need_for_plan_refine, using_tools = function_handler.handle_tool_call(
File "D:\AI\XAgent\XAgent\tool_call_handle.py", line 371, in handle_tool_call
command_result, tool_output_status_code, = toolserver_interface.execute_command_client(
File "D:\AI\XAgent\XAgent\tool_call_handle.py", line 216, in execute_command_client
response = requests.post(url, json=payload, cookies=self.cookies)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /execute_tool (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001D641569600>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connection.py", line 203, in _new_conn
sock = connection.create_connection(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\util\connection.py", line 85, in create_connection
raise err
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connectionpool.py", line 791, in urlopen
response = self._make_request(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connectionpool.py", line 497, in _make_request
conn.request(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connection.py", line 395, in request
self.endheaders()
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1271, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1031, in _send_output
self.send(msg)
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 969, in send
self.connect()
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connection.py", line 243, in connect
self.sock = self._new_conn()
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connection.py", line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001D6415683A0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\AI\XAgent\myenv\lib\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\connectionpool.py", line 845, in urlopen
retries = retries.increment(
File "D:\AI\XAgent\myenv\lib\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /download_workspace (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001D6415683A0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\AI\XAgent\run.py", line 50, in
cmd.start(
File "D:\AI\XAgent\command.py", line 163, in start
self.run({
File "D:\AI\XAgent\command.py", line 137, in run
asyncio.run(server.interact(interaction=interaction))
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\pedro\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete
return future.result()
File "D:\AI\XAgent\XAgentServer\server.py", line 109, in interact
toolserver_interface.download_all_files()
File "D:\AI\XAgent\XAgent\tool_call_handle.py", line 98, in download_all_files
response = requests.post(url, cookies=self.cookies,)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "D:\AI\XAgent\myenv\lib\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /download_workspace (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001D6415683A0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
2023_10_20_14_14_09cf4f4d9e.zip
`
Thank you for publishing such a powerful tool!!
But after downloading this repo and trying to host it on my Mac, I can't log in to the localhost:8000 (within the real email and token info, which is available at https://x-agent.net/). The whole deployment seems fine.
[+] Running 3/3
! ToolServerMonitor Warning 17.1s
! ToolServerManager Warning 17.1s
! ToolServerNode Warning 17.1s
[+] Building 110.1s (17/32) docker:default
=> [ToolServerNode internal] load build definition from Dockerfile 0.3s
=> => transferring dockerfile: 960B 0.0s
=> [ToolServerNode internal] load .dockerignore 0.4s
=> => transferring context: 2B 0.0s
=> [ToolServerManager internal] load build definition from Dockerfile 0.5s
=> => transferring dockerfile: 670B 0.0s
=> [ToolServerManager internal] load .dockerignore 0.6s
=> => transferring context: 2B 0.0s
=> [ToolServerMonitor internal] load build definition from Dockerfile 0.8s
=> => transferring dockerfile: 455B 0.0s
=> [ToolServerMonitor internal] load .dockerignore 0.9s
=> => transferring context: 2B 0.0s
=> [ToolServerManager internal] load metadata for docker.io/library/python:3.10 9.0s
=> [ToolServerManager internal] load build context 0.5s
=> => transferring context: 14.42kB 0.0s
=> [ToolServerNode 1/7] FROM docker.io/library/python:3.10@sha256:85de714b205693782cc48408bc48815343529987aae396b1adbbe05be5557cd7 0.0s
=> [ToolServerMonitor internal] load build context 0.4s
=> => transferring context: 4.01kB 0.0s
=> [ToolServerNode internal] load build context 0.5s
=> => transferring context: 2.42kB 0.1s
=> CACHED [ToolServerMonitor 2/7] WORKDIR /app 0.0s
=> CANCELED [ToolServerNode 3/12] RUN apt update && apt install -y build-essential make openjdk-17-jdk-headless curl docker.io docker-compose psmisc sudo 100.5s
=> CACHED [ToolServerMonitor 3/7] COPY ToolServerMonitor/requirements.txt . 0.0s
=> CACHED [ToolServerManager 3/7] COPY ToolServerManager/requirements.txt . 0.0s
=> CANCELED [ToolServerMonitor 4/7] RUN pip install --no-cache-dir -r requirements.txt 99.3s
=> ERROR [ToolServerManager 4/7] RUN pip install --no-cache-dir -r requirements.txt 98.2s
------
> [ToolServerManager 4/7] RUN pip install --no-cache-dir -r requirements.txt:
16.77 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe01e73b190>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fastapi/
29.29 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe01e739840>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fastapi/
42.30 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe01e73bc70>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fastapi/
56.32 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe01e73a260>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fastapi/
72.33 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe01e73bd60>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fastapi/
84.36 ERROR: Could not find a version that satisfies the requirement fastapi (from versions: none)
84.36 ERROR: No matching distribution found for fastapi
------
failed to solve: executor failed running [/bin/sh -c pip install --no-cache-dir -r requirements.txt]: exit code: 1
是否支持使用本地部署的大模型?比如开源的Qwen-14B或llama-70B?
本地已构建多个开源大模型本地化部署的API接口,能否类似langchain直接调用?
docker-compose.yaml一键部署支持
前后端配置在docker-compose.yaml文件中,执行docker compose up -d
进行部署。
Hey There,
Upon installation (2019 MBP 16GM DDR4) upon running docker-compose up, the terminal prints the following:
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:51872 - "GET / HTTP/1.1" 200 OK
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:51888 - "GET / HTTP/1.1" 200 OK
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:51900 - "GET / HTTP/1.1" 200 OK
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:49402 - "GET / HTTP/1.1" 200 OK
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:49412 - "GET / HTTP/1.1" 200 OK
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:49414 - "GET / HTTP/1.1" 200 OK
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:49426 - "GET / HTTP/1.1" 200 OK
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:49442 - "GET / HTTP/1.1" 200 OK
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:49444 - "GET / HTTP/1.1" 200 OK
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:49458 - "GET / HTTP/1.1" 200 OK
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:49466 - "GET / HTTP/1.1" 200 OK
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:49476 - "GET / HTTP/1.1" 200 OK
toolserver-ToolServerNode-1 | INFO: 127.0.0.1:49480 - "GET / HTTP/1.1" 200 OK
This went on for 10 mins. Stopping and reinstalling.
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
092f09a6498d xagent-server:0.1 "python start_server…" 3 minutes ago Up 3 minutes 0.0.0.0:8090->8090/tcp, :::8090->8090/tcp XAgent-Server
eb2b5c73a43f tool-server-monitor:0.1 "python main.py" 3 minutes ago Up 3 minutes 8180/tcp toolserver-ToolServerMonitor-1
8ae21b350e94 tool-server-manager:0.2 "gunicorn main:app -…" 3 minutes ago Up 3 minutes (healthy) 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp toolserver-ToolServerManager-1
f7e59e282dc3 tool-server-node:0.2 "uvicorn main:app --…" 3 minutes ago Up 3 minutes (healthy) 31942/tcp toolserver-ToolServerNode-1
35cc0aea28f1 mongo "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 27017/tcp toolserver-db-1
# root @ arm in /home/XAgent/XAgentServer on git:main x [14:28:49]
$ docker compose up
[+] Running 2/0
✔ Network xagentserver_default Created 0.1s
✔ Container XAgent-Server Created 0.0s
Attaching to XAgent-Server
XAgent-Server | INFO: Will watch for changes in these directories: ['/app']
XAgent-Server | INFO: Uvicorn running on http://0.0.0.0:8090 (Press CTRL+C to quit)
XAgent-Server | INFO: Started reloader process [1] using StatReload
XAgent-Server | INFO: Started server process [8]
XAgent-Server | INFO: Waiting for application startup.
XAgent-Server | INFO: Application startup complete.
XAgent-Server | XAgent Service Startup Param:
XAgent-Server | app: app:app
XAgent-Server | prod: False
XAgent-Server | base_dir: XAgentServer
XAgent-Server | use_redis: False
XAgent-Server | recorder_root_dir: running_records
XAgent-Server | default_login: True
XAgent-Server | check_running: False
XAgent-Server | host: 0.0.0.0
XAgent-Server | port: 8090
XAgent-Server | debug: True
XAgent-Server | reload: True
XAgent-Server | workers: 1
XAgent-Server | DB: <class 'XAgentServer.envs.XAgentServerEnv.DB'>
XAgent-Server | Redis: <class 'XAgentServer.envs.XAgentServerEnv.Redis'>
XAgent-Server | Email: <class 'XAgentServer.envs.XAgentServerEnv.Email'>
XAgent-Server | Upload: <class 'XAgentServer.envs.XAgentServerEnv.Upload'>
XAgent-Server | init websocket_queue
XAgent-Server | XAgentServer is running on 0.0.0.0:8090
XAgent-Server | Default user: admin, token: xagent-admin, you can use it to login
XAgent-Server | Create task for pong broadcast
XAgent-Server | init a websocket manager
XAgent-Server | init a thread pool executor, max_workers: 1
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | init localstorage connection: users.json
XAgent-Server | init localstorage connection: interaction.json
XAgent-Server | INFO: 120.231.170.167:9394 - "GET / HTTP/1.1" 404 Not Found
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | INFO: 172.23.0.1:47192 - "GET /api/login HTTP/1.1" 404 Not Found
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | pong broadcast for active connections: 0
XAgent-Server | INFO: 120.231.170.167:9452 - "GET / HTTP/1.1" 404 Not Found
请问贵司当前是否开放兼职申请,我的技术栈是 python, and i am ready to help.
I use docker to start up the web as instructed in the README, but cannot access the web UI via either 127.0.01:8090, 0.0.0.0:8090 or localhost:8090
I check the log:
Failed to load resource: the server responded with a status of 404 (Not Found) :8090/favicon.ico:1
So I suppose the icon image is missing. But I use a random image to replace this /favicon in the root dir, it still returns me the {"detail":"Not Found"}
.
This issue is related to #36
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7ffbcb7e91cc xagent-server:0.1 "python start_server…" 21 minutes ago Up 21 minutes 0.0.0.0:8090->8090/tcp XAgent-Server
ff8a3223e589 tool-server-monitor:0.1 "python main.py" 2 hours ago Up 2 hours 8180/tcp toolserver-ToolServerMonitor-1
0b5e79dc5061 tool-server-node:0.2 "uvicorn main:app --…" 2 hours ago Up 2 hours (healthy) 31942/tcp toolserver-ToolServerNode-1
ae79e03e9125 mongo "docker-entrypoint.s…" 2 hours ago Up 2 hours 27017/tcp toolserver-db-1
version: 2ea7b77
Docker Compose version v2.20.2-desktop.1
运行最后一部命令:npm run dev
[email protected] dev
vite --host
13:48:15
VITE v4.4.11 ready in 1384 ms
➜ Local: http://localhost:5173/ 13:48:15
➜ Network: http://10.118.154.209:5173/ 13:48:15
➜ press h to show help
在网页点击登录或者注册引发报错:
ERROR 14:02:29 [vite] http proxy error at /api/login: 14:02:29
Error: connect ECONNREFUSED 127.0.0.1:16204
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) (x11)
ERROR 14:03:08 [vite] http proxy error at /api/register: 14:03:08
Error: connect ECONNREFUSED 127.0.0.1:16204
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)
Hi developers! Thanks for developing this excellent framework!
But here I have a security concern about arbitrary code execution if the user use the extension tool calculator
.
please see the code: dangerous function eval
is used to calculate the expression without any sandbox or checking.
def calculator(expression:str)->str:
"""It is a simple calculator, which can execute Python expressions: e.g., "(123 + 234) / 23 * 1.5 - 8".
:param string expression: The python expression you requested.
:return string: The execution results of the expression.
"""
globals={}
locals={}
try:
# Wrap the code in an eval() call to return the result
wrapped_code = f"__result__ = eval({repr(expression)}, globals(), locals())" # Here lead to arbitrary code execution.
exec(wrapped_code, globals, locals)
return locals.get('__result__', None)
except Exception as e:
try:
# If eval fails, attempt to exec the code without returning a result
exec(expression, globals, locals)
return "Code executed successfully."
except Exception as e:
return f"Error: {str(e)}"
If the calculator is only used to calculate math expression, use numexpr instead.
If an app uses this calculator
as part of its backend, it may receive LLM generated code to help user to solve some math problem (via prompt). Attacker can use prompt injection to manipulate the LLM's output to let it generate malicious code, thus, remote code execution via prompt.
https://blog.x-agent.net/blog/xagent/ is not accessible
@sailaoda Can i create japanese readme
cd ToolServer
bash build_all.sh && docker-compose up
返回结果
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
what dataset we use to train XAgent? Toolbench or others?
Hello, after installing and trying to run the Agent i receive an error!
json.dump(tool_record, writer, indent=2, ensure_ascii=False)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\json\__init__.py", line 180, in dump
fp.write(chunk)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 80-81: character maps to <undefined>
【1】
XAgent-Server | "default_completion_kwargs": {
XAgent-Server | "model": "gpt-3.5-turbo-16k",
XAgent-Server | "temperature": 0.5,
XAgent-Server | "request_timeout": 60
XAgent-Server | },
XAgent-Server | "enable_summary": true,
XAgent-Server | "summary": {
XAgent-Server | "single_action_max_length": 8192,
XAgent-Server | "max_return_length": 18432
XAgent-Server | },
XAgent-Server | "use_selfhost_toolserver": true,
XAgent-Server | "selfhost_toolserver_url": "http://localhost:8080",
XAgent-Server | "max_retry_times": 3,
XAgent-Server | "max_subtask_chain_length": 20,
XAgent-Server | "max_plan_refine_chain_length": 3,
XAgent-Server | "max_plan_tree_depth": 3,
XAgent-Server | "max_plan_tree_width": 5,
XAgent-Server | "max_plan_length": 8192,
XAgent-Server | "rapidapi_retrieve_tool_count": 0,
XAgent-Server | "enable_ask_human_for_help": false
XAgent-Server | }
XAgent-Server | Human-In-The-Loop False
XAgent-Server | ERROR: Exception in ASGI application
XAgent-Server | Traceback (most recent call last):
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 203, in _new_conn
XAgent-Server | sock = connection.create_connection(
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection
XAgent-Server | raise err
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 73, in create_connection
XAgent-Server | sock.connect(sa)
XAgent-Server | ConnectionRefusedError: [Errno 111] Connection refused
XAgent-Server |
XAgent-Server | The above exception was the direct cause of the following exception:
XAgent-Server |
XAgent-Server | Traceback (most recent call last):
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 791, in urlopen
XAgent-Server | response = self._make_request(
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 497, in _make_request
XAgent-Server | conn.request(
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 395, in request
XAgent-Server | self.endheaders()
XAgent-Server | File "/usr/local/lib/python3.10/http/client.py", line 1278, in endheaders
XAgent-Server | self._send_output(message_body, encode_chunked=encode_chunked)
XAgent-Server | File "/usr/local/lib/python3.10/http/client.py", line 1038, in _send_output
XAgent-Server | self.send(msg)
XAgent-Server | File "/usr/local/lib/python3.10/http/client.py", line 976, in send
XAgent-Server | self.connect()
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 243, in connect
XAgent-Server | self.sock = self._new_conn()
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 218, in _new_conn
XAgent-Server | raise NewConnectionError(
XAgent-Server | urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f859c02b580>: Failed to establish a new connection: [Errno 111] Connection refused
XAgent-Server |
XAgent-Server | The above exception was the direct cause of the following exception:
XAgent-Server |
XAgent-Server | Traceback (most recent call last):
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
XAgent-Server | resp = conn.urlopen(
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 845, in urlopen
XAgent-Server | retries = retries.increment(
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 515, in increment
XAgent-Server | raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
XAgent-Server | urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /get_cookie (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f859c02b580>: Failed to establish a new connection: [Errno 111] Connection refused'))
XAgent-Server |
XAgent-Server | During handling of the above exception, another exception occurred:
XAgent-Server |
XAgent-Server | Traceback (most recent call last):
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 247, in run_asgi
XAgent-Server | result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
XAgent-Server | return await self.app(scope, receive, send)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 1115, in call
XAgent-Server | await super().call(scope, receive, send)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 122, in call
XAgent-Server | await self.middleware_stack(scope, receive, send)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 149, in call
XAgent-Server | await self.app(scope, receive, send)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 75, in call
XAgent-Server | await self.app(scope, receive, send)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/base.py", line 26, in call
XAgent-Server | await self.app(scope, receive, send)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in call
XAgent-Server | raise exc
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in call
XAgent-Server | await self.app(scope, receive, sender)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
XAgent-Server | raise e
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
XAgent-Server | await self.app(scope, receive, send)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 718, in call
XAgent-Server | await route.handle(scope, receive, send)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 341, in handle
XAgent-Server | await self.app(scope, receive, send)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/starlette/endpoints.py", line 88, in dispatch
XAgent-Server | raise exc
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/starlette/endpoints.py", line 80, in dispatch
XAgent-Server | await self.on_receive(websocket, data)
XAgent-Server | File "/app/app.py", line 628, in on_receive
XAgent-Server | await asyncio.create_task(self.do_running_long_task(parameter))
XAgent-Server | File "/app/app.py", line 688, in do_running_long_task
XAgent-Server | await task
XAgent-Server | File "/app/XAgentServer/server.py", line 64, in interact
XAgent-Server | toolserver_interface.lazy_init(config=config)
XAgent-Server | File "/app/XAgent/tool_call_handle.py", line 63, in lazy_init
XAgent-Server | response = requests.post(f'{self.url}/get_cookie',)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 115, in post
XAgent-Server | return request("post", url, data=data, json=json, **kwargs)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
XAgent-Server | return session.request(method=method, url=url, **kwargs)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
XAgent-Server | resp = self.send(prep, **send_kwargs)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
XAgent-Server | r = adapter.send(request, **kwargs)
XAgent-Server | File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 519, in send
XAgent-Server | raise ConnectionError(e, request=request)
XAgent-Server | requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /get_cookie (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f859c02b580>: Failed to establish a new connection: [Errno 111] Connection refused'))
XAgent-Server | INFO: connection closed
【2】
【3】
What part of the code should I fix?
目前版本只支持OpenAI 的API,企业运用中很多使用的Azure OpenAI API, 能否在config中提供支持 ?
运行这一步的时候:
cd ../XAgentWeb
npm install
npm run serve
遇到报错:
npm ERR! Missing script: "serve"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/logic/.npm/_logs/2023-10-18T03_07_41_621Z-debug-0.log
进入XAgentWeb/package.json查看代码,发现
确实没有server健值对。
请问如何解决这个问题?谢谢!
http://localhost:5173这个网页可以打开,但是提问以后没有反馈
XAgent-Server | "default_completion_kwargs": {
XAgent-Server | "model": "gpt-4",
XAgent-Server | "temperature": 0.2,
XAgent-Server | "request_timeout": 60
XAgent-Server | },
XAgent-Server | "enable_summary": true,
XAgent-Server | "summary": {
XAgent-Server | "single_action_max_length": 2048,
XAgent-Server | "max_return_length": 12384
XAgent-Server | },
XAgent-Server | "use_selfhost_toolserver": true,
XAgent-Server | "selfhost_toolserver_url": "http://localhost:8090",
XAgent-Server | "max_retry_times": 3,
XAgent-Server | "max_subtask_chain_length": 15,
XAgent-Server | "max_plan_refine_chain_length": 3,
XAgent-Server | "max_plan_tree_depth": 3,
XAgent-Server | "max_plan_tree_width": 5,
XAgent-Server | "max_plan_length": 8192,
XAgent-Server | "rapidapi_retrieve_tool_count": 0,
XAgent-Server | "enable_ask_human_for_help": false,
XAgent-Server | "tool_blacklist": [
XAgent-Server | "FileSystemEnv_print_filesys_struture"
XAgent-Server | ],
XAgent-Server | "record_dir": null
XAgent-Server | }
XAgent-Server | Human-In-The-Loop False
I followed the step by step to setup the Xagentserver and it runs on docker, but when I run it and go to http://localhost:8090/ I get a black page with this text on it: "{"detail":"Not Found"}"
Docker logs
2023-10-19 16:51:46 XAgent-Server | INFO: Will watch for changes in these directories: ['/app']
2023-10-19 16:51:46 XAgent-Server | INFO: Uvicorn running on http://0.0.0.0:8090 (Press CTRL+C to quit)
2023-10-19 16:51:46 XAgent-Server | INFO: Started reloader process [1] using StatReload
2023-10-19 16:51:51 XAgent-Server | INFO: Started server process [8]
2023-10-19 16:51:51 XAgent-Server | INFO: Waiting for application startup.
2023-10-19 16:51:51 XAgent-Server | INFO: Application startup complete.
2023-10-19 16:57:00 XAgent-Server | INFO: Shutting down
2023-10-19 16:57:01 XAgent-Server | INFO: Waiting for application shutdown.
2023-10-19 16:57:01 XAgent-Server | INFO: Application shutdown complete.
2023-10-19 16:57:01 XAgent-Server | INFO: Finished server process [8]
2023-10-19 16:57:01 XAgent-Server | XAgent Service Startup Param:
2023-10-19 16:57:01 XAgent-Server | app: app:app
2023-10-19 16:57:01 XAgent-Server | prod: False
2023-10-19 16:57:01 XAgent-Server | base_dir: XAgentServer
2023-10-19 16:57:01 XAgent-Server | use_redis: False
2023-10-19 16:57:01 XAgent-Server | recorder_root_dir: running_records
2023-10-19 16:57:01 XAgent-Server | default_login: True
2023-10-19 16:57:01 XAgent-Server | check_running: False
2023-10-19 16:57:01 XAgent-Server | host: 0.0.0.0
2023-10-19 16:57:01 XAgent-Server | port: 8090
2023-10-19 16:57:01 XAgent-Server | debug: True
2023-10-19 16:57:01 XAgent-Server | reload: True
2023-10-19 16:57:01 XAgent-Server | workers: 1
2023-10-19 16:57:01 XAgent-Server | DB: <class 'XAgentServer.envs.XAgentServerEnv.DB'>
2023-10-19 16:57:01 XAgent-Server | Redis: <class 'XAgentServer.envs.XAgentServerEnv.Redis'>
2023-10-19 16:57:01 XAgent-Server | Email: <class 'XAgentServer.envs.XAgentServerEnv.Email'>
2023-10-19 16:57:01 XAgent-Server | Upload: <class 'XAgentServer.envs.XAgentServerEnv.Upload'>
2023-10-19 16:57:01 XAgent-Server | init websocket_queue
2023-10-19 16:57:01 XAgent-Server | XAgentServer is running on 0.0.0.0:8090
2023-10-19 16:57:01 XAgent-Server | Default user: admin, token: xagent-admin, you can use it to login
2023-10-19 16:57:01 XAgent-Server | Create task for pong broadcast
2023-10-19 16:57:01 XAgent-Server | init a websocket manager
2023-10-19 16:57:01 XAgent-Server | init a thread pool executor, max_workers: 1
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | init localstorage connection: users.json
2023-10-19 16:57:01 XAgent-Server | init localstorage connection: interaction.json
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:01 XAgent-Server | INFO: Stopping reloader process [1]
2023-10-19 16:57:06 XAgent-Server | INFO: Will watch for changes in these directories: ['/app']
2023-10-19 16:57:06 XAgent-Server | INFO: Uvicorn running on http://0.0.0.0:8090 (Press CTRL+C to quit)
2023-10-19 16:57:06 XAgent-Server | INFO: Started reloader process [1] using StatReload
2023-10-19 16:57:07 XAgent-Server | INFO: Started server process [8]
2023-10-19 16:57:07 XAgent-Server | INFO: Waiting for application startup.
2023-10-19 16:57:07 XAgent-Server | INFO: Application startup complete.
2023-10-19 16:57:46 XAgent-Server | XAgent Service Startup Param:
2023-10-19 16:57:46 XAgent-Server | app: app:app
2023-10-19 16:57:46 XAgent-Server | prod: False
2023-10-19 16:57:46 XAgent-Server | base_dir: XAgentServer
2023-10-19 16:57:46 XAgent-Server | use_redis: False
2023-10-19 16:57:46 XAgent-Server | recorder_root_dir: running_records
2023-10-19 16:57:46 XAgent-Server | default_login: True
2023-10-19 16:57:46 XAgent-Server | check_running: False
2023-10-19 16:57:46 XAgent-Server | host: 0.0.0.0
2023-10-19 16:57:46 XAgent-Server | port: 8090
2023-10-19 16:57:46 XAgent-Server | debug: True
2023-10-19 16:57:46 XAgent-Server | reload: True
2023-10-19 16:57:46 XAgent-Server | workers: 1
2023-10-19 16:57:46 XAgent-Server | DB: <class 'XAgentServer.envs.XAgentServerEnv.DB'>
2023-10-19 16:57:46 XAgent-Server | Redis: <class 'XAgentServer.envs.XAgentServerEnv.Redis'>
2023-10-19 16:57:46 XAgent-Server | Email: <class 'XAgentServer.envs.XAgentServerEnv.Email'>
2023-10-19 16:57:46 XAgent-Server | Upload: <class 'XAgentServer.envs.XAgentServerEnv.Upload'>
2023-10-19 16:57:46 XAgent-Server | init websocket_queue
2023-10-19 16:57:46 XAgent-Server | XAgentServer is running on 0.0.0.0:8090
2023-10-19 16:57:46 XAgent-Server | Default user: admin, token: xagent-admin, you can use it to login
2023-10-19 16:57:46 XAgent-Server | Create task for pong broadcast
2023-10-19 16:57:46 XAgent-Server | init a websocket manager
2023-10-19 16:57:46 XAgent-Server | init a thread pool executor, max_workers: 1
2023-10-19 16:57:46 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:46 XAgent-Server | init localstorage connection: users.json
2023-10-19 16:57:46 XAgent-Server | init localstorage connection: interaction.json
2023-10-19 16:57:46 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:57:46 XAgent-Server | INFO: 172.20.0.1:49872 - "GET / HTTP/1.1" 404 Not Found
2023-10-19 16:57:47 XAgent-Server | INFO: 172.20.0.1:49872 - "GET /favicon.ico HTTP/1.1" 404 Not Found
2023-10-19 16:58:37 XAgent-Server | INFO: Shutting down
2023-10-19 16:58:37 XAgent-Server | INFO: Waiting for application shutdown.
2023-10-19 16:58:37 XAgent-Server | INFO: Application shutdown complete.
2023-10-19 16:58:37 XAgent-Server | INFO: Finished server process [8]
2023-10-19 16:58:37 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:58:37 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:58:37 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 16:58:37 XAgent-Server | INFO: Stopping reloader process [1]
2023-10-19 16:59:47 XAgent-Server | INFO: Will watch for changes in these directories: ['/app']
2023-10-19 16:59:47 XAgent-Server | INFO: Uvicorn running on http://0.0.0.0:8090 (Press CTRL+C to quit)
2023-10-19 16:59:47 XAgent-Server | INFO: Started reloader process [1] using StatReload
2023-10-19 16:59:48 XAgent-Server | INFO: Started server process [8]
2023-10-19 16:59:48 XAgent-Server | INFO: Waiting for application startup.
2023-10-19 16:59:48 XAgent-Server | INFO: Application startup complete.
2023-10-19 17:00:03 XAgent-Server | INFO: Shutting down
2023-10-19 17:00:03 XAgent-Server | INFO: Waiting for application shutdown.
2023-10-19 17:00:03 XAgent-Server | INFO: Application shutdown complete.
2023-10-19 17:00:03 XAgent-Server | INFO: Finished server process [8]
2023-10-19 17:00:03 XAgent-Server | XAgent Service Startup Param:
2023-10-19 17:00:03 XAgent-Server | app: app:app
2023-10-19 17:00:03 XAgent-Server | prod: False
2023-10-19 17:00:03 XAgent-Server | base_dir: XAgentServer
2023-10-19 17:00:03 XAgent-Server | use_redis: False
2023-10-19 17:00:03 XAgent-Server | recorder_root_dir: running_records
2023-10-19 17:00:03 XAgent-Server | default_login: True
2023-10-19 17:00:03 XAgent-Server | check_running: False
2023-10-19 17:00:03 XAgent-Server | host: 0.0.0.0
2023-10-19 17:00:03 XAgent-Server | port: 8090
2023-10-19 17:00:03 XAgent-Server | debug: True
2023-10-19 17:00:03 XAgent-Server | reload: True
2023-10-19 17:00:03 XAgent-Server | workers: 1
2023-10-19 17:00:03 XAgent-Server | DB: <class 'XAgentServer.envs.XAgentServerEnv.DB'>
2023-10-19 17:00:03 XAgent-Server | Redis: <class 'XAgentServer.envs.XAgentServerEnv.Redis'>
2023-10-19 17:00:03 XAgent-Server | Email: <class 'XAgentServer.envs.XAgentServerEnv.Email'>
2023-10-19 17:00:03 XAgent-Server | Upload: <class 'XAgentServer.envs.XAgentServerEnv.Upload'>
2023-10-19 17:00:03 XAgent-Server | init websocket_queue
2023-10-19 17:00:03 XAgent-Server | XAgentServer is running on 0.0.0.0:8090
2023-10-19 17:00:03 XAgent-Server | Default user: admin, token: xagent-admin, you can use it to login
2023-10-19 17:00:03 XAgent-Server | Create task for pong broadcast
2023-10-19 17:00:03 XAgent-Server | init a websocket manager
2023-10-19 17:00:03 XAgent-Server | init a thread pool executor, max_workers: 1
2023-10-19 17:00:03 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 17:00:03 XAgent-Server | init localstorage connection: users.json
2023-10-19 17:00:03 XAgent-Server | init localstorage connection: interaction.json
2023-10-19 17:00:03 XAgent-Server | INFO: Stopping reloader process [1]
2023-10-19 17:03:52 XAgent-Server | INFO: Will watch for changes in these directories: ['/app']
2023-10-19 17:03:52 XAgent-Server | INFO: Uvicorn running on http://0.0.0.0:8090 (Press CTRL+C to quit)
2023-10-19 17:03:52 XAgent-Server | INFO: Started reloader process [1] using StatReload
2023-10-19 17:03:53 XAgent-Server | INFO: Started server process [8]
2023-10-19 17:03:53 XAgent-Server | INFO: Waiting for application startup.
2023-10-19 17:03:53 XAgent-Server | INFO: Application startup complete.
2023-10-19 17:04:49 XAgent-Server | XAgent Service Startup Param:
2023-10-19 17:04:49 XAgent-Server | app: app:app
2023-10-19 17:04:49 XAgent-Server | prod: False
2023-10-19 17:04:49 XAgent-Server | base_dir: XAgentServer
2023-10-19 17:04:49 XAgent-Server | use_redis: False
2023-10-19 17:04:49 XAgent-Server | recorder_root_dir: running_records
2023-10-19 17:04:49 XAgent-Server | default_login: True
2023-10-19 17:04:49 XAgent-Server | check_running: False
2023-10-19 17:04:49 XAgent-Server | host: 0.0.0.0
2023-10-19 17:04:49 XAgent-Server | port: 8090
2023-10-19 17:04:49 XAgent-Server | debug: True
2023-10-19 17:04:49 XAgent-Server | reload: True
2023-10-19 17:04:49 XAgent-Server | workers: 1
2023-10-19 17:04:49 XAgent-Server | DB: <class 'XAgentServer.envs.XAgentServerEnv.DB'>
2023-10-19 17:04:49 XAgent-Server | Redis: <class 'XAgentServer.envs.XAgentServerEnv.Redis'>
2023-10-19 17:04:49 XAgent-Server | Email: <class 'XAgentServer.envs.XAgentServerEnv.Email'>
2023-10-19 17:04:49 XAgent-Server | Upload: <class 'XAgentServer.envs.XAgentServerEnv.Upload'>
2023-10-19 17:04:49 XAgent-Server | init websocket_queue
2023-10-19 17:04:49 XAgent-Server | XAgentServer is running on 0.0.0.0:8090
2023-10-19 17:04:49 XAgent-Server | Default user: admin, token: xagent-admin, you can use it to login
2023-10-19 17:04:49 XAgent-Server | Create task for pong broadcast
2023-10-19 17:04:49 XAgent-Server | init a websocket manager
2023-10-19 17:04:49 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 17:04:49 XAgent-Server | init a thread pool executor, max_workers: 1
2023-10-19 17:04:49 XAgent-Server | init localstorage connection: users.json
2023-10-19 17:04:49 XAgent-Server | init localstorage connection: interaction.json
2023-10-19 17:04:49 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 17:04:49 XAgent-Server | pong broadcast for active connections: 0
2023-10-19 17:04:49 XAgent-Server | INFO: 172.20.0.1:49876 - "GET / HTTP/1.1" 404 Not Found
执行docker-compose up遇到报错:
networks.tool-server-network value Additional properties are not allowed ('name' was unexpected)
将docker-compose.yaml中的network name注释掉之后:
networks:
tool-server-network:
# name: tool-server-network
driver: bridge
启动成功,但启动xagent后报错python run.py --task "xxx" --model "gpt-4"
ToolServerManager_1 | Traceback (most recent call last):
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
ToolServerManager_1 | result = await app( # type: ignore[func-returns-value]
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
ToolServerManager_1 | return await self.app(scope, receive, send)
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 292, in call
ToolServerManager_1 | await super().call(scope, receive, send)
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 122, in call
ToolServerManager_1 | await self.middleware_stack(scope, receive, send)
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in call
ToolServerManager_1 | raise exc
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in call
ToolServerManager_1 | await self.app(scope, receive, _send)
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in call
ToolServerManager_1 | raise exc
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in call
ToolServerManager_1 | await self.app(scope, receive, sender)
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
ToolServerManager_1 | raise e
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
ToolServerManager_1 | await self.app(scope, receive, send)
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 718, in call
ToolServerManager_1 | await route.handle(scope, receive, send)
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
ToolServerManager_1 | await self.app(scope, receive, send)
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
ToolServerManager_1 | response = await func(request)
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 273, in app
ToolServerManager_1 | raw_response = await run_endpoint_function(
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
ToolServerManager_1 | return await dependant.call(**values)
ToolServerManager_1 | File "/app/main.py", line 101, in read_cookie_info
ToolServerManager_1 | container = docker_client.containers.run(CONFIG['node']['image'],detach=True,network=CONFIG['node']['network'],
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/docker/models/containers.py", line 865, in run
ToolServerManager_1 | container.start()
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/docker/models/containers.py", line 406, in start
ToolServerManager_1 | return self.client.api.start(self.id, **kwargs)
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/docker/utils/decorators.py", line 19, in wrapped
ToolServerManager_1 | return f(self, resource_id, *args, **kwargs)
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/docker/api/container.py", line 1127, in start
ToolServerManager_1 | self._raise_for_status(res)
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/docker/api/client.py", line 270, in _raise_for_status
ToolServerManager_1 | raise create_api_error_from_http_exception(e) from e
ToolServerManager_1 | File "/usr/local/lib/python3.10/site-packages/docker/errors.py", line 39, in create_api_error_from_http_exception
ToolServerManager_1 | raise cls(e, response=response, explanation=explanation) from e
ToolServerManager_1 | docker.errors.NotFound: 404 Client Error for http+docker://localhost/v1.41/containers/d1c5f95eafa3b6fe678e43092e1bc8f7535f44b028387a5d9a4de137d3936cc7/start: Not Found ("network tool-server-network not found")
failed to solve: process "/bin/sh -c apt update && apt install -y build-essential make openjdk-17-jdk-headless curl docker.io docker-compose psmisc sudo" did not complete successfully: exit code: 100
mac book pro, Docker version 24.0.6, Docker Compose version v2.22.0-desktop.2
一步步的改代码改到最后能成功跑起来,XAgentServer也能成功跑起来,然后又出现两个错:
感觉就是项目代码不完整
邮件:admin
token:xagent-admin
I want XAgent to read a local file (given a related path) and process it. Where should I place the file?
(Is this a supported feature?)
(I tried to place it in local_workspace
, but XAgent can't find it and downloaded a weird one from the Internet)
Seems XAgentServer can not be accessible from localhost. In this case, frontend server can not talk to it
[ec2-user@ip-172-31-28-146 ~]$ curl http://localhost:8090/api/login
curl: (56) Recv failure: Connection reset by peer
[ec2-user@ip-172-31-28-146 ~]$ docker exec -it f20270f83123 bash
root@f20270f83123:/app# curl http://localhost:8090/api/login
{"detail":"Method Not Allowed"}
[ec2-user@ip-172-31-28-146 ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f20270f83123 xagent-server:0.1 "python start_server…" 58 minutes ago Up 2 minutes 0.0.0.0:8090->8090/tcp, :::8090->8090/tcp XAgent-Server
5b0dd44a5984 tool-server-monitor:0.1 "python main.py" About an hour ago Up About an hour 8180/tcp toolserver-ToolServerMonitor-1
0e6feb19389b tool-server-manager:0.2 "gunicorn main:app -…" About an hour ago Up About an hour (healthy) 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp toolserver-ToolServerManager-1
1d7f71db76bc tool-server-node:0.2 "uvicorn main:app --…" About an hour ago Up About an hour (healthy) 31942/tcp toolserver-ToolServerNode-1
4fb6e13a558d mongo "docker-entrypoint.s…" About an hour ago Up About an hour 27017/tcp toolserver-db-1
docker inspect container
[
{
"Id": "f20270f83123bb38c5c9fc7e1ba16002f664b7061a0cec466cf992d9783a986f",
"Created": "2023-10-18T20:14:07.214652701Z",
"Path": "python",
"Args": [
"start_server.py"
],
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.