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 Train agents when using any knowledge source. #1916

Open
karolvargas opened this issue Jan 17, 2025 · 3 comments
Open

[BUG] Cannot Train agents when using any knowledge source. #1916

karolvargas opened this issue Jan 17, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@karolvargas
Copy link

Description

Just using the base project from create crew CLI command and using OpenAI API key I am able to train and test my agents just fine. When I add knowledge sources of type JSON I do get a pydantic error from a dependency that I cannot fix. Simply importing the package will fail to train the agent. It will run the crew fine however. Is this intentional? As I do not see anyplace in the documentation for training that that is the case.

Steps to Reproduce

  1. follow create crew instructions
  2. change nothing
  3. Add knowledge source to agent using default user_preference.txt
  4. try to train model

Expected behavior

Ability to train on sample data

Screenshots/Code snippets

macOS Sequoia

Operating System

Other (specify in additional context)

Python Version

3.11

crewAI Version

0.95.0

crewAI Tools Version

0.25.8

Virtual Environment

Venv

Evidence

`crewai train -n 1
Training the Crew for 1 iterations
Traceback (most recent call last):
File "/path/src/tf_jits/main.py", line 36, in train
TfJits().crew().train(n_iterations=int(sys.argv[1]), filename=sys.argv[2], inputs=inputs)
File "/path/.venv/lib/python3.11/site-packages/crewai/crew.py", line 491, in train
train_crew = self.copy()
^^^^^^^^^^^
File "/path/.venv/lib/python3.11/site-packages/crewai/crew.py", line 1012, in copy
cloned_agents = [agent.copy() for agent in self.agents]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/.venv/lib/python3.11/site-packages/crewai/crew.py", line 1012, in
cloned_agents = [agent.copy() for agent in self.agents]
^^^^^^^^^^^^
File "/path/.venv/lib/python3.11/site-packages/crewai/agents/agent_builder/base_agent.py", line 265, in copy
copied_agent = type(self)(**copied_data, llm=existing_llm, tools=self.tools)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/.venv/lib/python3.11/site-packages/pydantic/main.py", line 214, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Can't instantiate abstract class BaseKnowledgeSource with abstract methods add, validate_content

During handling of the above exception, another exception occurred:`

Possible Solution

None

Additional context

None

@karolvargas karolvargas added the bug Something isn't working label Jan 17, 2025
@bhancockio bhancockio self-assigned this Jan 17, 2025
@phuang07
Copy link

@karolvargas I encountered this issue today, wondering if you have solution for this.

@karolvargas
Copy link
Author

Was never able to figure it out 😢

@karolvargas karolvargas reopened this Jan 23, 2025
@karolvargas
Copy link
Author

Maybe someone else can look at it

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