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

[BUG] Cannot create 'Knowledge' #1859

Open
fbomb111 opened this issue Jan 6, 2025 · 3 comments
Open

[BUG] Cannot create 'Knowledge' #1859

fbomb111 opened this issue Jan 6, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@fbomb111
Copy link

fbomb111 commented Jan 6, 2025

Description

I am following the documentation here: https://docs.crewai.com/concepts/knowledge#text-file-knowledge-source

Steps to Reproduce

my_knowledge = Knowledge(
collection_name="my_knowledge",
sources=[source1, source2, source3]
)

I assume that my sources are valid because I tried with fake files and I get a file not found error. When I use real files, this error goes away.

I have tried with both docling and json source classes.

Expected behavior

I would expect no error.

Screenshots/Code snippets

See above.

Operating System

Ubuntu 20.04

Python Version

3.11

crewAI Version

0.95.0

crewAI Tools Version

0.25.8

Virtual Environment

Poetry

Evidence

my_knowledge = Knowledge(
^^^^^^^^^^
File "/home/myproject/.venv/lib/python3.11/site-packages/crewai/knowledge/knowledge.py", line 46, in init
source.add()
File "/home/myproject/.venv/lib/python3.11/site-packages/crewai/knowledge/source/crew_docling_source.py", line 88, in add
self._save_documents()
File "/home/myproject/.venv/lib/python3.11/site-packages/crewai/knowledge/source/base_knowledge_source.py", line 50, in _save_documents
self.storage.save(self.chunks)
File "/home/myproject/.venv/lib/python3.11/site-packages/crewai/knowledge/storage/knowledge_storage.py", line 161, in save
self.collection.upsert(
File "/home/myproject/.venv/lib/python3.11/site-packages/chromadb/api/models/Collection.py", line 334, in upsert
upsert_request = self._validate_and_prepare_upsert_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/myproject/.venv/lib/python3.11/site-packages/chromadb/api/models/CollectionCommon.py", line 93, in wrapper
raise type(e)(msg).with_traceback(e.traceback)
^^^^^^^^^^^^
TypeError: APIStatusError.init() missing 2 required keyword-only arguments: 'response' and 'body'

Possible Solution

None

Additional context

None. Thanks for the help!

@fbomb111 fbomb111 added the bug Something isn't working label Jan 6, 2025
@bhancockio
Copy link
Collaborator

@lorenzejay - Is this similar to the issue you were talking about yesterday?

@fbomb111
Copy link
Author

fbomb111 commented Jan 8, 2025

Some more info if it's helpful, my AI provider is Azure Open AI. The docs say it will use the same provider as what the agents are configured to, but perhaps I need to provide a specific embedder to the crew? I can try this tomorrow.

If you have any ideas I'd be happy to dig in/test them out and report back. Thanks!

@rupakg
Copy link

rupakg commented Jan 10, 2025

@fbomb111 See this issue: #769 You have to add an embedder for a non-OpenAI provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants