You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've seen such errors before when the filename is the same as the package name, however, I was just testing the InMemoryArchivalMemoryDataSource functionality using the example given in the documentation. Please can you give suggestions on how to resolve this?
playground.py:
import os
key = os.environ["OPENAI_API_KEY"]
from bondai.memory.archival.datasources import InMemoryArchivalMemoryDataSource
from bondai.models.openai import OpenAIEmbeddingModel, OpenAIModelNames
# Initialize an In-Memory Archival Memory Data Source
in_memory_archival = InMemoryArchivalMemoryDataSource(
embedding_model=OpenAIEmbeddingModel(OpenAIModelNames.TEXT_EMBEDDING_ADA_002)
)
# Insert and search content
in_memory_archival.insert("Temporary archival data")
results = in_memory_archival.search("archival data")
print(results)
Error:
File "/Users/username/project/bondai_trial/playground.py", line 4, in <module>
from bondai.memory.archival.datasources import InMemoryArchivalMemoryDataSource
File "/Users/username/merck project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/memory/__init__.py", line 1, in <module>
from .memory_manager import (
File "/Users/username/project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/memory/memory_manager.py", line 10, in <module>
from .conversation.datasources import (
File "/Users/username/project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/memory/conversation/__init__.py", line 1, in <module>
from .datasources import (
File "/Users/username/project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/memory/conversation/datasources.py", line 6, in <module>
from bondai.agents.messages import (
File "/Users/username/project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/agents/__init__.py", line 1, in <module>
from .conversational_agent import ConversationalAgent
File "/Users/username/project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/agents/conversational_agent.py", line 8, in <module>
from bondai.memory import MemoryManager
ImportError: cannot import name 'MemoryManager' from partially initialized module 'bondai.memory' (most likely due to a circular import) (/Users/username/project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/memory/__init__.py)
File structure:
|- trial_env
|- playground.py
Here, trial_env is my virtual environment
The text was updated successfully, but these errors were encountered:
Hello,
I've seen such errors before when the filename is the same as the package name, however, I was just testing the
InMemoryArchivalMemoryDataSource
functionality using the example given in the documentation. Please can you give suggestions on how to resolve this?playground.py:
Error:
File structure:
Here, trial_env is my virtual environment
The text was updated successfully, but these errors were encountered: