当前位置: 首页 > news >正文

上海闸北区网站建设初期做网站

上海闸北区网站建设,初期做网站,做微商如何网站推广,网站建设公司演讲稿官网:https://github.com/All-Hands-AI/OpenHands 欢迎来到OpenHands(前身为OpenDevin),这是一个由人工智能驱动的软件开发代理平台。 OpenHands代理可以做任何人类开发人员可以做的事情:修改代码、运行命令、浏览网页…

官网:https://github.com/All-Hands-AI/OpenHands

欢迎来到OpenHands(前身为OpenDevin),这是一个由人工智能驱动的软件开发代理平台。
OpenHands代理可以做任何人类开发人员可以做的事情:修改代码、运行命令、浏览网页、调用API,是的,甚至可以从StackOverflow复制代码片段。
 

实践

Windows10 WSL Ubuntu24.04下尝试(失败)

OpenHands需要用docker安装

比如在Windows10的wsl Ubuntu24.04系统下,直接执行下面两句:

docker pull docker.all-hands.dev/all-hands-ai/runtime:0.28-nikolaikdocker run -it --rm --pull=always \-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.28-nikolaik \-e LOG_ALL_EVENTS=true \-v /var/run/docker.sock:/var/run/docker.sock \-v ~/.openhands-state:/.openhands-state \-p 3000:3000 \--add-host host.docker.internal:host-gateway \--name openhands-app \docker.all-hands.dev/all-hands-ai/openhands:0.28

启动后在3000端口侦听

You'll find OpenHands running at http://localhost:3000

浏览器打开3000端口

首先进行大模型的设置

 设置服务提供方 ,选定模型,输入key 。但是这还不够,因为我们想使用定制的llm大模型提供方,比如本地提供方。那么可以点击“see advanced settings” ,再打开Advanced开关,就可以自己定义大模型了,比如模型名字:gtp-4o,模型url选自己假设的服务192.168.1.5就可以,API key自己设定:

设定好后, 点击新项目,用官方给的prompt开始破冰之旅:
I want to create a Hello World app in Javascript that:
* Displays Hello World in the middle.
* Has a button that when clicked, changes the greeting with a bouncing animation to fun versions of Hello.
* Has a counter for how many times the button has been clicked.
* Has another button that changes the app's background color.

后面是漫长的等待时间。一直就没信息,这不对啊。而且设定为中文,但是界面并没有改,就像设定没有起作用一样。

windows10下试试(失败)

在windows10的powershell下,直接执行:

docker run -it --rm --pull=always `-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.28-nikolaik `-e LOG_ALL_EVENTS=true  `-v C:\Users\Admin\.openhands-state:/.openhands-state  `-p 3000:3000  `--add-host host.docker.internal:host-gateway  `--name openhands-app  `docker.all-hands.dev/all-hands-ai/openhands:0.28

 然后浏览器连到本地3000端口,也是一样,页面显示Connecting,但是就是没啥反应

测试openai api

测试本地搭建的openai api ,测试通过

import openai
client = openai.OpenAI(api_key="anything",base_url="http://192.168.1.5:1337/v1"
)# request sent to model set on litellm proxy, `litellm --model`
response = client.chat.completions.create(model="gpt-4o", messages = [{"role": "user","content": "this is a test request, write a short poem"}
])print(response)

 所以到底哪里出错了呢?没找到原因,但是肯定跟科学上网有关。

 

总结

一句话,OpenHands很好!

第二句话:没法用,问就是科学上网的锅。

调试

agent卡住,控制台报错ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=39992)

  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 398, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/utils/request.py", line 44, in send_request
    response = session.request(method, url, timeout=timeout, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=39992): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f894c95eba0>: Failed to establish a new connection: [Errno 111] Connection refused'))

感觉是命令里的这句话有问题:

--add-host host.docker.internal:host-gateway 

去掉试试

docker run -it --rm --pull=always \-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.28-nikolaik \-e LOG_ALL_EVENTS=true \-v /var/run/docker.sock:/var/run/docker.sock \-v ~/.openhands-state:/.openhands-state \-p 3000:3000 \--name openhands-app \docker.all-hands.dev/all-hands-ai/openhands:0.28

去掉之后有这句 

10:53:54 - openhands:INFO: docker_runtime.py:155 - [runtime 10e429aad4564baea20a8ebcc602fe40] Waiting for client to become ready at http://host.docker.internal:39992...

好像还是一样啊

要不改成这句:

--add-host h172.25.176.1:host-gateway 

docker run -it --rm --pull=always \-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.28-nikolaik \-e LOG_ALL_EVENTS=true \-v /var/run/docker.sock:/var/run/docker.sock \-v ~/.openhands-state:/.openhands-state \--add-host 172.25.176.1:host-gateway \-p 3000:3000 \--name openhands-app \docker.all-hands.dev/all-hands-ai/openhands:0.28

看这个issue:[Bug]: Release using docker images 0.28 doesn't start, fails with exception of incorrect message · Issue #7152 · All-Hands-AI/OpenHands 

docker run -it --rm --pull=always \-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.28-nikolaik \-e LOG_ALL_EVENTS=true \-v /var/run/docker.sock:/var/run/docker.sock \-v ~/.openhands-state:/.openhands-state \-e SANDBOX_RUNTIME_BINDING_ADDRESS="0.0.0.0"  \-p 3000:3000 \--add-host host.docker.internal:host-gateway \--name openhands-app \docker.all-hands.dev/all-hands-ai/openhands:0.28

 试试

发现无法修改配置了

而且很...很卡,就是ctrl+c后半天docker都不退出,整个wsl Ubuntu都卡住了。

后来用另一个终端把它kill了。

windows下的docker也是一样网页端卡住,docker端有报错

  File "/app/openhands/server/middleware.py", line 203, in __call__
    return await call_next(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 154, in call_next
    raise app_exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 141, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 177, in __call__
    with recv_stream, send_stream, collapse_excgroups():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 179, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/middleware.py", line 172, in __call__
    response = await self._attach_conversation(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/middleware.py", line 151, in _attach_conversation
    await shared.conversation_manager.attach_to_conversation(request.state.sid)
  File "/app/openhands/server/conversation_manager/standalone_conversation_manager.py", line 91, in attach_to_conversation
    c = Conversation(sid, file_store=self.file_store, config=self.config)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/session/conversation.py", line 34, in __init__
    self.runtime = runtime_cls(
                   ^^^^^^^^^^^^
  File "/app/openhands/runtime/impl/docker/docker_runtime.py", line 80, in __init__
    self.docker_client: docker.DockerClient = self._init_docker_client()
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/impl/docker/docker_runtime.py", line 183, in _init_docker_client
    raise ex
  File "/app/openhands/runtime/impl/docker/docker_runtime.py", line 178, in _init_docker_client
    return docker.from_env()
           ^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/docker/client.py", line 94, in from_env
    return cls(
           ^^^^
  File "/app/.venv/lib/python3.12/site-packages/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/docker/api/client.py", line 207, in __init__
    self._version = self._retrieve_server_version()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/docker/api/client.py", line 230, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

http://www.dtcms.com/a/578322.html

相关文章:

  • 小型公司网站建设知乎网站建设与开发开题报告
  • 高端网站的制作有那些网站
  • UE4第二次构建时,引擎是否主动删除掉Saved/Cooked目录
  • asynccontextmanager
  • 天津大学邓意达/陈亚楠团队Nano-Micro Lett.研究:热冲击法促新型纳米片自发成长,提升全水解效率
  • 流程架构的解耦与进化设计
  • 企业发展历程网站游戏开发软件免费下载
  • 枣庄市住房和城乡建设局网站如何做网站微信小程序
  • 广州网站排名优化公司20亿做网站
  • Java 获取拼多多商品详情简易版 API 接口实现
  • 邢台市做网站电话wordpress用户名可以修改
  • 成都有几家做网站的公司小型crm系统
  • 工程计算 - Mathcad® 替代方案
  • 广州网站设计建设网站改版 重新收录
  • ESP32C3初应用:点灯及ADC
  • 301 是什么意思?——HTTP 状态码详解与应用
  • 深入解析cursor Token消耗详细分解
  • 深圳网站设计联系电话广告公司海报用的易拉
  • fiddler模拟弱网延时请求
  • 基于单片机的剧本杀场景控制系统(论文+源码)
  • mysql启动提示1067:进程意外终止
  • 网站建设的服务器郑州app制作
  • 智能决策算法的核心原理是什么?
  • springboot基于Java的校园导航微信小程序的设计与实现(代码+数据库+LW)
  • 11.大模型Agent应用
  • 学院网站建设目的与意义手机商城在哪里找到
  • MySQL的GROUP_CONCAT函数详解
  • Temu平台新规全面收紧,卖家如何破局迎战年终大促?
  • 底层视觉及图像增强-项目实践-细节再<十六-9,如何用AI实现LED显示画质增强:总结再回顾>:从LED大屏,到手机小屏,快来挖一挖里面都有什么
  • 怎么做网站后缀识别符号才不会变电脑淘宝网页版