feat: Add crew train cli (#624)

* fix: fix crewai-tools cli command

* feat: add crewai train CLI command

* feat: add the tests

* fix: fix typing hinting issue on code

* fix: test.yml

* fix: fix test

* fix: removed fix since it didnt changed the test
This commit is contained in:
Eduardo Chiarotti
2024-05-23 18:46:45 -03:00
committed by GitHub
parent 393a86792c
commit b48beaaf9c
16 changed files with 278 additions and 45 deletions

View File

@@ -2,6 +2,7 @@ import click
import pkg_resources
from .create_crew import create_crew
from .train_crew import train_crew
@click.group()
@@ -27,11 +28,25 @@ def version(tools):
if tools:
try:
tools_version = pkg_resources.get_distribution("crewai[tools]").version
tools_version = pkg_resources.get_distribution("crewai-tools").version
click.echo(f"crewai tools version: {tools_version}")
except pkg_resources.DistributionNotFound:
click.echo("crewai tools not installed")
@crewai.command()
@click.option(
"-n",
"--n_iterations",
type=int,
default=5,
help="Number of iterations to train the crew",
)
def train(n_iterations: int):
"""Train the crew."""
click.echo(f"Training the crew for {n_iterations} iterations")
train_crew(n_iterations)
if __name__ == "__main__":
crewai()