Skip to content
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

AttributeError: 'str' object has no attribute 'model_dump' #9

Open
ZhenghaoYang19 opened this issue Jul 24, 2024 · 1 comment
Open

Comments

@ZhenghaoYang19
Copy link

Can you tell me the version of the related packages? It seems like a version incompatibility

@ZhenghaoYang19
Copy link
Author

It seems all packages all compatible. The error is:
Traceback (most recent call last):
File "C:\Users\zh-ya\miniconda3\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
File "C:\Users\zh-ya\miniconda3\Lib\threading.py", line 975, in run
self._target(*self._args, **self.kwargs)
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\speech_recognition_init
.py", line 568, in threaded_listen
if running[0]: callback(self, audio)
^^^^^^^^^^^^^^^^^^^^^
File "D:\Seafile\Projects\alloy-voice-assistant\assistant.py", line 150, in audio_callback
assistant.answer(prompt, webcam_stream.read(encode=True))
File "D:\Seafile\Projects\alloy-voice-assistant\assistant.py", line 76, in answer
response = self.chain.invoke(
^^^^^^^^^^^^^^^^^^
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_core\runnables\base.py", line 5057, in invoke
return self.bound.invoke(
^^^^^^^^^^^^^^^^^^
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_core\runnables\base.py", line 5057, in invoke
return self.bound.invoke(
^^^^^^^^^^^^^^^^^^
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_core\runnables\base.py", line 2875, in invoke
input = step.invoke(input, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_core\runnables\branch.py", line 239, in invoke
output = self.default.invoke(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_core\runnables\base.py", line 5057, in invoke
return self.bound.invoke(
^^^^^^^^^^^^^^^^^^
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_core\runnables\base.py", line 2875, in invoke
input = step.invoke(input, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_core\language_models\chat_models.py", line 270, in invoke
self.generate_prompt(
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_core\language_models\chat_models.py", line 703, in generate_prompt
return self.generate(prompt_messages, stop=stop, callbacks=callbacks, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_core\language_models\chat_models.py", line 560, in generate
raise e
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_core\language_models\chat_models.py", line 550, in generate
self._generate_with_cache(
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_core\language_models\chat_models.py", line 775, in _generate_with_cache
result = self._generate(
^^^^^^^^^^^^^^^
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_openai\chat_models\base.py", line 591, in _generate
return self._create_chat_result(response, generation_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zh-ya\miniconda3\Lib\site-packages\langchain_openai\chat_models\base.py", line 616, in _create_chat_result
response = response.model_dump()
^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'model_dump'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant