Aider-AI / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
20.95k stars 1.94k forks source link

Uncaught RuntimeError in validators.py line 765 #2016

Closed sirnikfactorio closed 2 weeks ago

sirnikfactorio commented 2 weeks ago

Error happened when tried to ask a question using /help

Aider version: 0.59.1 Python version: 3.10.12 Platform: Linux-6.8.0-45-generic-x86_64-with-glibc2.35 Python implementation: CPython Virtual environment: Yes OS: Linux 6.8.0-45-generic (64bit) Git version: git version 2.34.1

An uncaught exception occurred:

Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
  File "main.py", line 757, in main
    coder.run()
  File "base_coder.py", line 730, in run
    self.run_one(user_message, preproc)
  File "base_coder.py", line 767, in run_one
    message = self.preproc_user_input(user_message)
  File "base_coder.py", line 756, in preproc_user_input
    return self.commands.run(inp)
  File "commands.py", line 233, in run
    return self.do_run(matching_commands[0][1:], rest_inp)
  File "commands.py", line 208, in do_run
    return cmd_method(args)
  File "commands.py", line 972, in cmd_help
    self.help = Help()
  File "help.py", line 118, in __init__
    Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-small-en-v1.5")
  File "settings.py", line 74, in embed_model
    self._embed_model = resolve_embed_model(embed_model)
  File "utils.py", line 39, in resolve_embed_model
    from llama_index.core.bridge.langchain import Embeddings as LCEmbeddings
  File "langchain.py", line 2, in <module>
    from langchain.agents import (
  File "__init__.py", line 40, in <module>
    from langchain.agents.agent import (
  File "agent.py", line 639, in <module>
    class LLMSingleActionAgent(BaseSingleActionAgent):
  File "main.py", line 197, in __new__
    fields[ann_name] = ModelField.infer(
  File "fields.py", line 504, in infer
    return cls(
  File "fields.py", line 434, in __init__
    self.prepare()
  File "fields.py", line 555, in prepare
    self.populate_validators()
  File "fields.py", line 829, in populate_validators
    *(get_validators() if get_validators else list(find_validators(self.type_, self.model_config))),
  File "validators.py", line 765, in find_validators
    raise RuntimeError(f'no validator found for {type_}, see `arbitrary_types_allowed` in Config')
RuntimeError: no validator found for <class 'langchain.chains.llm.LLMChain'>, see `arbitrary_types_allowed` in Config
fry69 commented 2 weeks ago

Thank you for filing this issue.

Can you please try to install or reinstall aider in a separate Python environment? Either with venv or pipx?

Please remove the existing environment/aider installation first, e.g. with pipx:

$ pipx uninstall aider-chat
uninstalled aider-chat! ✨ 🌟 ✨
$ pipx install aider-chat
  installed package aider-chat 0.59.1, installed using Python 3.12.7
  These apps are now globally available
    - aider
done! ✨ 🌟 ✨

This document may be helpful -> https://aider.chat/docs/troubleshooting/imports.html