AGiXT icon indicating copy to clipboard operation
AGiXT copied to clipboard

Error when go to agent

Open timuryung opened this issue 1 year ago • 6 comments

Description

In new version there is an error when user go to agent page (http://localhost:3000/agent/Agent-LLM)

Знімок екрана 2023-05-01 о 22 44 06

Promise { } error - unhandledRejection: Error: connect ECONNREFUSED ::1:80 at AxiosError.from (file:///Users/timur/Downloads/Agent-LLM-1.1.0-alpha/frontend/node_modules/axios/lib/core/AxiosError.js:89:14) at RedirectableRequest.handleRequestError (file:///Users/timur/Downloads/Agent-LLM-1.1.0-alpha/frontend/node_modules/axios/lib/adapters/http.js:591:25) at RedirectableRequest.emit (node:events:513:28) at eventHandlers. (/Users/timur/Downloads/Agent-LLM-1.1.0-alpha/frontend/node_modules/follow-redirects/index.js:14:24) at ClientRequest.emit (node:events:513:28) at Socket.socketErrorListener (node:_http_client:502:9) at Socket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { digest: undefined } error - Error: connect ECONNREFUSED ::1:80 at AxiosError.from (file:///Users/timur/Downloads/Agent-LLM-1.1.0-alpha/frontend/node_modules/axios/lib/core/AxiosError.js:89:14) at RedirectableRequest.handleRequestError (file:///Users/timur/Downloads/Agent-LLM-1.1.0-alpha/frontend/node_modules/axios/lib/adapters/http.js:591:25) at RedirectableRequest.emit (node:events:513:28) at eventHandlers. (/Users/timur/Downloads/Agent-LLM-1.1.0-alpha/frontend/node_modules/follow-redirects/index.js:14:24) at ClientRequest.emit (node:events:513:28) at Socket.socketErrorListener (node:_http_client:502:9) at Socket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { digest: undefined } error - Error: connect ECONNREFUSED ::1:80 at AxiosError.from (file:///Users/timur/Downloads/Agent-LLM-1.1.0-alpha/frontend/node_modules/axios/lib/core/AxiosError.js:89:14) at RedirectableRequest.handleRequestError (file:///Users/timur/Downloads/Agent-LLM-1.1.0-alpha/frontend/node_modules/axios/lib/adapters/http.js:591:25) at RedirectableRequest.emit (node:events:513:28) at eventHandlers. (/Users/timur/Downloads/Agent-LLM-1.1.0-alpha/frontend/node_modules/follow-redirects/index.js:14:24) at ClientRequest.emit (node:events:513:28) at Socket.socketErrorListener (node:_http_client:502:9) at Socket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { digest: undefined }

Steps to Reproduce the Bug

  1. Run frontend
  2. Run backend
  3. Go to http://localhost:3000/agent/Agent-LLM

Expected Behavior

Goes to page without error

Actual Behavior

Error occurs

Additional Context / Screenshots

No response

Operating System

  • [ ] Microsoft Windows
  • [X] Apple MacOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
  • [ ] Other

Python Version

  • [ ] Python <= 3.9
  • [ ] Python 3.10
  • [X] Python 3.11

Environment Type - Connection

  • [X] Local
  • [ ] Remote

Environment Type - Container

  • [ ] Using Docker
  • [X] Not Using Docker

Acknowledgements

  • [X] My issue title is concise, descriptive, and in title casing.
  • [X] I have searched the existing issues to make sure this bug has not been reported yet.
  • [X] I am using the latest version of Agent-LLM.
  • [X] I have provided enough information for the maintainers to reproduce and diagnose the issue.

timuryung avatar May 01 '23 21:05 timuryung

Search for: await axios.get(`/api/provider`) and replace with: axios.get(`${process.env.NEXT_PUBLIC_API_URI ?? 'http://localhost:7437'}/api/provider`) https://github.com/search?q=repo%3AJosh-XT%2FAgent-LLM%20%60%2Fapi&type=code

samuzaffar99 avatar May 02 '23 00:05 samuzaffar99

What file is this "axios.get('/api/provider') located in?

jeffwadsworth avatar May 02 '23 02:05 jeffwadsworth

  • frontend/components/systems/agent/tabs/AgentConfigure.js
  • frontend/pages/provider/[provider].js
  • frontend/pages/provider/index.js

samuzaffar99 avatar May 02 '23 02:05 samuzaffar99

Sadly, the same error comes up.

jeffwadsworth avatar May 02 '23 02:05 jeffwadsworth

Search for: await axios.get(/api/provider) and replace with: axios.get(${process.env.NEXT_PUBLIC_API_URI ?? '[http://localhost:7437'}/api/provider](http://localhost:7437'%7D/api/provider%60)) https://github.com/search?q=repo%3AJosh-XT%2FAgent-LLM%20%60%2Fapi&type=code

  • frontend/components/systems/agent/tabs/AgentConfigure.js

    • frontend/pages/provider/[provider].js

    • frontend/pages/provider/index.js

I experience the same issue as the OP and unfortunately this fix didn't work either, I appreciate the effort

there is another line: console.log(axios.get("/api/provider")); in frontend/pages/_app.js Maybe that is causing the error to display on console? The project still does not work fully for me with oobabooga web-ui. I was able to access the agents page and add an agent after this, however when sending a message to the agent, it does not show up in the dialogbox, only the console. Also, sometimes the buttons on the UI are either unresponsive or quite slow. After applying the above fixes, try navigating to: http://localhost:3000/agent and see if it works. For reference, I'm using the following params: AI_PROVIDER=oobabooga AI_MODEL=default AI_PROVIDER_URI=http://127.0.0.1:7860

on Node v16.18.1 and python 3.11.3 (virtualenv)

samuzaffar99 avatar May 02 '23 16:05 samuzaffar99

frontend/pages/api/provider/index.js line 16 change: await axios.get(${process.env.API_URI}/api/provider).then((response) => { to await axios.get(${process.env.NEXT_PUBLIC_API_URI}/api/provider).then((response) => {

Not sure how to create a PR for this. First timer!

kenfink avatar May 02 '23 18:05 kenfink