emrgnt-cmplxty/automata

ValueError: You are using a deprecated configuration of Chroma.

bitnom opened this issue · 0 comments

bitnom commented

I tried to run the Python example. I had to modify the imports and toolkit string it to get it to run:

from automata.config.config_base import AgentConfigName
from automata.config.openai_config import OpenAIAutomataAgentConfigBuilder
from automata.agent import OpenAIAutomataAgent
from automata.singletons.dependency_factory import dependency_factory
from automata.singletons.py_module_loader import py_module_loader
from automata.tools.agent_tool_factory import AgentToolFactory

# Initialize the module loader to the local directory
py_module_loader.initialize()

# Construct the set of all dependencies that will be used to build the tools
toolkit_list = ["advanced-context-oracle"]
tool_dependencies = dependency_factory.build_dependencies_for_tools(toolkit_list)

# Build the tools
tools = AgentToolFactory.build_tools(toolkit_list, **tool_dependencies)

# Build the agent config
agent_config = (
    OpenAIAutomataAgentConfigBuilder.from_name("automata-main")
    .with_tools(tools)
    .with_model("gpt-4")
    .build()
)

# Initialize and run the agent
instructions = "Explain how embeddings are used by the codebase"
agent = OpenAIAutomataAgent(instructions, config=agent_config)
result = agent.run()

which threw:

Loading modules with root path: /home/user/src/programmer/src/ext/automata/automata/core/../.. and py path: /home/user/src/programmer/src/ext/automata/automata/core/../../automata
Building dependencies for toolkits ['advanced-context-oracle']...
Building symbol_doc_embedding_handler...
Creating dependency symbol_doc_embedding_handler
Traceback (most recent call last):
  File "/home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/232.10072.31/plugins/python/helpers/pydev/pydevd.py", line 1500, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/232.10072.31/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/home/user/src/programmer/src/programmer/auto.py", line 13, in <module>
    tool_dependencies = dependency_factory.build_dependencies_for_tools(toolkit_list)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/src/programmer/src/ext/automata/automata/singletons/dependency_factory.py", line 161, in build_dependencies_for_tools
    tool_dependencies[dependency] = self.get(dependency)
                                    ^^^^^^^^^^^^^^^^^^^^
  File "/home/user/src/programmer/src/ext/automata/automata/singletons/dependency_factory.py", line 128, in get
    instance = creation_method()
               ^^^^^^^^^^^^^^^^^
  File "/home/user/src/programmer/src/ext/automata/automata/singletons/dependency_factory.py", line 253, in create_symbol_doc_embedding_handler
    ChromaSymbolEmbeddingVectorDatabase(
  File "/home/user/src/programmer/src/ext/automata/automata/symbol_embedding/vector_databases.py", line 47, in __init__
    super().__init__(collection_name, persist_directory)
  File "/home/user/src/programmer/src/ext/automata/automata/core/base/database/vector_database.py", line 226, in __init__
    self._setup_chroma_client(persist_directory)
  File "/home/user/src/programmer/src/ext/automata/automata/core/base/database/vector_database.py", line 243, in _setup_chroma_client
    self.client = chromadb.Client(
                  ^^^^^^^^^^^^^^^^
  File "/home/user/src/programmer/.venv/lib/python3.11/site-packages/chromadb/__init__.py", line 148, in Client
    system = System(settings)
             ^^^^^^^^^^^^^^^^
  File "/home/user/src/programmer/.venv/lib/python3.11/site-packages/chromadb/config.py", line 247, in __init__
    if settings[key] is not None:
       ~~~~~~~~^^^^^
  File "/home/user/src/programmer/.venv/lib/python3.11/site-packages/chromadb/config.py", line 184, in __getitem__
    raise ValueError(LEGACY_ERROR)
ValueError: You are using a deprecated configuration of Chroma.
If you do not have data you wish to migrate, you only need to change how you construct
your Chroma client. Please see the "New Clients" section of https://docs.trychroma.com/migration.