New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] AttributeError: 'coroutine' object has no attribute 'get' #807
Comments
Confirm possible bug with Ollama 1.33 and Qdrant 1.9.1, same problem. |
#783 Will gonna resolve most problem with ollama, wait some time |
First of all, really great job, ceshire-cat is great. Then... Please, take my observation with some caution, since I am fairly new to this kind of environment. It seems that here there are two problems:
where, at line 122, the handling of the exception passes through an async object, which "immediately" tries to call a get method on something which is not there yet:
so the exception (I am inside the docker environment created through your compose file)
My pesonal fix here, inspired by this stackoverflow post 'coroutine' object has no attribute get || pyppeteer
here is an extract of the log inside the container:
Which is the ollama exception.
which maybe could be interesting in order to solve this... thank you again for this framework, really... |
ok... I am back... I was able to obtain at least one answer. It seems that the problem is in the file (inside the docker backend container): /app/cat/looking_glass/agent_manager.py I changed the line 170, from
to
and the call apparently worked... again, take this with caution: smally tested (just one shot), from a beginner on both sides (python api and ollama api interface) |
@enrichicco thank you for the effort you are putting! We already resolve the problem with the merge of #783 #813 in
With the new changes, we also resolve the tool selection issue when a local model tries to select a tool (now even Phi-3 can launch tools) |
Appreciate it, @valentimarco! Any idea when we can expect this to be part of the main branch? |
not soon, is already in the develop branch but need some testing. If you want you can try it and give a feedback |
Hi @valentimarco, I checked the commits and the development branch, and it seems to me that the coroutine object error is still there, i.e, this one:
According to me, this should be something like this:
it is not so bad, but in case of response codes != 200 and 404, it masks the (manually) raised value error (lets say, the real request exception) with the "coroutine object has no attribute get error" . |
Langchain changed the code on that parts, infact i delete ollama_utils.py and from my test with ollama 1.33 and 1.34 i don't have any problem. If you want we can see it in discord, maybe i am forgetting something |
I solved it like this too |
@Pingdred do you know if this fix needs to apply also for the new chain? |
Not for now because we no longer use the stop sequence (branch develop), however, there is to test and see if it is necessary to keep it |
My config consists in a local-cat with qdrant and Ollama.
After update from 1.5.1 to 1.6.1 i have this problem:
traceback:
Traceback (most recent call last):
File "/app/cat/looking_glass/stray_cat.py", line 403, in run
cat_message = self.loop.run_until_complete(
File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
File "/app/cat/looking_glass/stray_cat.py", line 350, in call
raise e
File "/app/cat/looking_glass/stray_cat.py", line 340, in call
cat_message = await self.agent_manager.execute_agent(self)
File "/app/cat/looking_glass/agent_manager.py", line 236, in execute_agent
memory_chain_output = await self.execute_memory_chain(agent_input, prompt_prefix, prompt_suffix, stray)
File "/app/cat/looking_glass/agent_manager.py", line 170, in execute_memory_chain
return await memory_chain.ainvoke({**agent_input, "stop":"Human:"}, config=RunnableConfig(callbacks=[NewTokenHandler(stray)]))
File "/usr/local/lib/python3.10/site-packages/langchain/chains/base.py", line 212, in ainvoke
raise e
File "/usr/local/lib/python3.10/site-packages/langchain/chains/base.py", line 203, in ainvoke
await self._acall(inputs, run_manager=run_manager)
File "/usr/local/lib/python3.10/site-packages/langchain/chains/llm.py", line 275, in _acall
response = await self.agenerate([inputs], run_manager=run_manager)
File "/usr/local/lib/python3.10/site-packages/langchain/chains/llm.py", line 142, in agenerate
return await self.llm.agenerate_prompt(
File "/usr/local/lib/python3.10/site-packages/langchain_core/language_models/llms.py", line 643, in agenerate_prompt
return await self.agenerate(
File "/usr/local/lib/python3.10/site-packages/langchain_core/language_models/llms.py", line 1018, in agenerate
output = await self._agenerate_helper(
File "/usr/local/lib/python3.10/site-packages/langchain_core/language_models/llms.py", line 882, in _agenerate_helper
raise e
File "/usr/local/lib/python3.10/site-packages/langchain_core/language_models/llms.py", line 866, in _agenerate_helper
await self._agenerate(
File "/usr/local/lib/python3.10/site-packages/langchain_community/llms/ollama.py", line 444, in _agenerate
final_chunk = await super()._astream_with_aggregation(
File "/usr/local/lib/python3.10/site-packages/langchain_community/llms/ollama.py", line 343, in _astream_with_aggregation
async for stream_resp in self._acreate_generate_stream(prompt, stop, **kwargs):
File "/usr/local/lib/python3.10/site-packages/langchain_community/llms/ollama.py", line 174, in _acreate_generate_stream
async for item in self._acreate_stream(
File "/app/cat/factory/ollama_utils.py", line 121, in _acreate_stream_patch
optional_detail = await response.json().get("error")
AttributeError: 'coroutine' object has no attribute 'get'
The text was updated successfully, but these errors were encountered: