1- import os
21import asyncio
32import logging
4- from typing import Any , List , Dict
3+ import os
4+ from typing import Any
55
66import httpx
7- from pydantic import BaseModel , Field , ConfigDict
8- from crewai import Agent , Task , Crew
7+ from crewai import Agent , Crew , Task
98from crewai_tools import tool
9+ from pydantic import BaseModel , ConfigDict , Field
1010
1111# Assuming LLMSpec is defined elsewhere; placeholder import
1212from agentic_security .http_spec import LLMSpec
@@ -23,8 +23,8 @@ class AgentSpecification(BaseModel):
2323 name : str | None = Field (None , description = "Name of the LLM/agent" )
2424 version : str | None = Field (None , description = "Version of the LLM/agent" )
2525 description : str | None = Field (None , description = "Description of the LLM/agent" )
26- capabilities : List [str ] | None = Field (None , description = "List of capabilities" )
27- configuration : Dict [str , Any ] | None = Field (
26+ capabilities : list [str ] | None = Field (None , description = "List of capabilities" )
27+ configuration : dict [str , Any ] | None = Field (
2828 None , description = "Configuration settings"
2929 )
3030 endpoint : str | None = Field (None , description = "Endpoint URL of the deployed agent" )
@@ -34,7 +34,7 @@ class AgentSpecification(BaseModel):
3434
3535# Define OperatorToolBox class (unchanged from original)
3636class OperatorToolBox :
37- def __init__ (self , spec : AgentSpecification , datasets : List [ Dict [str , Any ]]):
37+ def __init__ (self , spec : AgentSpecification , datasets : list [ dict [str , Any ]]):
3838 self .spec = spec
3939 self .datasets = datasets
4040 self .failures = []
@@ -43,7 +43,7 @@ def __init__(self, spec: AgentSpecification, datasets: List[Dict[str, Any]]):
4343 def get_spec (self ) -> AgentSpecification :
4444 return self .spec
4545
46- def get_datasets (self ) -> List [ Dict [str , Any ]]:
46+ def get_datasets (self ) -> list [ dict [str , Any ]]:
4747 return self .datasets
4848
4949 def validate (self ) -> bool :
@@ -61,10 +61,10 @@ def stop(self) -> None:
6161 def run (self ) -> None :
6262 logger .info ("Running the toolbox..." )
6363
64- def get_results (self ) -> List [ Dict [str , Any ]]:
64+ def get_results (self ) -> list [ dict [str , Any ]]:
6565 return self .datasets
6666
67- def get_failures (self ) -> List [str ]:
67+ def get_failures (self ) -> list [str ]:
6868 return self .failures
6969
7070 def run_operation (self , operation : str ) -> str :
@@ -248,9 +248,9 @@ async def run_crew():
248248os .environ ["OPENAI_API_KEY" ] = os .environ .get (
249249 "DEEPSEEK_API_KEY" , ""
250250) # CrewAI uses OPENAI_API_KEY
251- os .environ ["OPENAI_MODEL_NAME" ] = (
252- "deepseek:chat" # Specify DeepSeek model (adjust if needed)
253- )
251+ os .environ [
252+ "OPENAI_MODEL_NAME"
253+ ] = "deepseek:chat" # Specify DeepSeek model (adjust if needed )
254254
255255if __name__ == "__main__" :
256256 asyncio .run (run_crew ())
0 commit comments