mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
* feat: add training logic to agent and crew * feat: add training logic to agent executor * feat: add input parameter to cli command * feat: add utilities for the training logic * feat: polish code, logic and add private variables * feat: add docstring and type hinting to executor * feat: add constant file, add constant to code * feat: fix name of training handler function * feat: remove unused var * feat: change file handler file name * feat: Add training handler file, class and change on the code * feat: fix name error from file * fix: change import to adapt to logic * feat: add training handler test * feat: add tests for file and training_handler * feat: add test for task evaluator function * feat: change text to fit in-screen * feat: add test for train function * feat: add test for agent training_handler function * feat: add test for agent._use_trained_data
24 lines
615 B
Python
24 lines
615 B
Python
#!/usr/bin/env python
|
|
import sys
|
|
from {{folder_name}}.crew import {{crew_name}}Crew
|
|
|
|
|
|
def run():
|
|
# Replace with your inputs, it will automatically interpolate any tasks and agents information
|
|
inputs = {
|
|
'topic': 'AI LLMs'
|
|
}
|
|
{{crew_name}}Crew().crew().kickoff(inputs=inputs)
|
|
|
|
|
|
def train():
|
|
"""
|
|
Train the crew for a given number of iterations.
|
|
"""
|
|
inputs = {"topic": "AI LLMs"}
|
|
try:
|
|
{{crew_name}}Crew().crew().train(n_iterations=int(sys.argv[1]), inputs=inputs)
|
|
|
|
except Exception as e:
|
|
raise Exception(f"An error occurred while training the crew: {e}")
|