mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
fix: resolve linting errors across codebase
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
from .reader_tool import S3ReaderTool
|
||||
from .writer_tool import S3WriterTool
|
||||
from .reader_tool import S3ReaderTool as S3ReaderTool
|
||||
from .writer_tool import S3WriterTool as S3WriterTool
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from .patronus_eval_tool import PatronusEvalTool
|
||||
from .patronus_local_evaluator_tool import PatronusLocalEvaluatorTool
|
||||
from .patronus_predefined_criteria_eval_tool import PatronusPredefinedCriteriaEvalTool
|
||||
from .patronus_eval_tool import PatronusEvalTool as PatronusEvalTool
|
||||
from .patronus_local_evaluator_tool import (
|
||||
PatronusLocalEvaluatorTool as PatronusLocalEvaluatorTool,
|
||||
)
|
||||
from .patronus_predefined_criteria_eval_tool import (
|
||||
PatronusPredefinedCriteriaEvalTool as PatronusPredefinedCriteriaEvalTool,
|
||||
)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import random
|
||||
|
||||
from patronus import Client, EvaluationResult # type: ignore[import-not-found]
|
||||
from patronus_local_evaluator_tool import ( # type: ignore[import-not-found]
|
||||
PatronusLocalEvaluatorTool,
|
||||
)
|
||||
|
||||
from crewai import Agent, Crew, Task
|
||||
from patronus import Client, EvaluationResult
|
||||
from patronus_local_evaluator_tool import PatronusLocalEvaluatorTool
|
||||
|
||||
|
||||
# Test the PatronusLocalEvaluatorTool where agent uses the local evaluator
|
||||
@@ -12,7 +15,7 @@ client = Client()
|
||||
# Example of an evaluator that returns a random pass/fail result
|
||||
@client.register_local_evaluator("random_evaluator")
|
||||
def random_evaluator(**kwargs):
|
||||
score = random.random()
|
||||
score = random.random() # noqa: S311
|
||||
return EvaluationResult(
|
||||
score_raw=score,
|
||||
pass_=score >= 0.5,
|
||||
|
||||
@@ -17,13 +17,17 @@ Usage:
|
||||
|
||||
import os
|
||||
|
||||
from crewai import Agent, Crew, Process, Task
|
||||
from crewai.utilities.printer import Printer
|
||||
from dotenv import load_dotenv
|
||||
from stagehand.schemas import AvailableModel
|
||||
from stagehand.schemas import AvailableModel # type: ignore[import-untyped]
|
||||
|
||||
from crewai import Agent, Crew, Process, Task
|
||||
from crewai_tools import StagehandTool
|
||||
|
||||
|
||||
_printer = Printer()
|
||||
|
||||
|
||||
# Load environment variables from .env file
|
||||
load_dotenv()
|
||||
|
||||
@@ -111,7 +115,7 @@ with StagehandTool(
|
||||
# Run the crew and get the result
|
||||
result = crew.kickoff()
|
||||
|
||||
print("\n==== RESULTS ====\n")
|
||||
print(result)
|
||||
_printer.print("\n==== RESULTS ====\n", color="cyan")
|
||||
_printer.print(str(result))
|
||||
|
||||
# Resources are automatically cleaned up when exiting the context manager
|
||||
|
||||
Reference in New Issue
Block a user