Haervwe / open-webui-tools

a Repository of Open-WebUI tools to use with your favourite LLMs
3 stars 0 forks source link

async client session #1

Open graelo opened 4 days ago

graelo commented 4 days ago

Hi, thanks, that's very interesting.

I'd like to know if you've ever had Unclosed client session errors. It's the second time I use mcts functions with open-webui, and each time I have these errors after I receive the results. Outside of mcts function, I have no issues, with websearch and ollama working very well. Is there something I could be missing? It probably is something stupid.

I know that could be a question for open-webui, but I see it as very specific to mcts functions, and so your experience could be super valuable to me, compared to the general answers I could get on the forum. I'll head there in case you can't help me.

Basically, I now the async session must be closed or reused, but not opened again and again, which of course happens in tree search.

(snip)
open-webui[1971609]: teadily releasing research papers on its AI work for years. With Ferret-UI, the company seems to be looking at how AI can help with smartphone navigation:'}, {'title': 'Towards artificial general intelligence via a multimodal foundation ...', 'url': 'https://www.nature.com/articles/s41467-022-30761-2', 'content': 'Artificial intelligence approaches inspired by human cognitive function have usually single learned ability. The authors propose a multimodal foundation model that demonstrates the cross-domain learning and adaptation for broad range of downstream cognitive tasks.'}] ,
open-webui[1971609]: INFO  [open_webui.apps.ollama.main] url: http://ollama.internal:9031
open-webui[1971609]: ERROR [asyncio] Unclosed client session
open-webui[1971609]: client_session: <aiohttp.client.ClientSession object at 0x7fc498197910>
open-webui[1971609]: ERROR [asyncio] Unclosed connector
open-webui[1971609]: connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fc4904da660>, 422102.234)]']
open-webui[1971609]: connector: <aiohttp.connector.TCPConnector object at 0x7fc491e76050>
open-webui[1971609]: INFO  [open_webui.apps.ollama.main] url: http://ollama.internal:9031
open-webui[1971609]: INFO  [open_webui.apps.ollama.main] url: http://ollama.internal:9031
nas open-webui[1971609]: INFO  [open_webui.apps.ollama.main] url: http://ollama.internal:9031
open-webui[1971609]: ERROR [asyncio] Unclosed client session
open-webui[1971609]: client_session: <aiohttp.client.ClientSession object at 0x7fc4979a8610>
open-webui[1971609]: INFO:     10.0.2.100:43114 - "POST /api/v1/chats/2c312bef-ce93-43f0-8c6c-fa885427f3f5 HTTP/1.0" 200 OK
open-webui[1971609]: INFO:     10.0.2.100:43128 - "GET /api/v1/chats/?page=1 HTTP/1.0" 200 OK
open-webui[1971609]: INFO:     10.0.2.100:43132 - "POST /api/chat/completed HTTP/1.1" 200 OK

Would you have any clue? Thanks in advance!

Haervwe commented 4 days ago

Hi ! yes im seeing that too, this morining when i saw your issue i got right on the problem,but i think is the ollama calls, wich are made by open webui logic, i tryed several fixes with no avail, maby the better option es refactor and ask for a olla url n valves an use the native calls, it would also fix the issue with context over the openAi api, also that set your context in another modelfile to use this, i forgot to mention on the readme. i will try an update it to fix it so i can really be sacallable

graelo commented 4 days ago

Thank you!