Skip to content

Commit e12ef2d

Browse files
committed
fix(linter):
1 parent ce3686e commit e12ef2d

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

agentic_security/agents/operator_crew.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import os
21
import asyncio
32
import logging
4-
from typing import Any, List, Dict
3+
import os
4+
from typing import Any
55

66
import httpx
7-
from pydantic import BaseModel, Field, ConfigDict
8-
from crewai import Agent, Task, Crew
7+
from crewai import Agent, Crew, Task
98
from crewai_tools import tool
9+
from pydantic import BaseModel, ConfigDict, Field
1010

1111
# Assuming LLMSpec is defined elsewhere; placeholder import
1212
from 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)
3636
class 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():
248248
os.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

255255
if __name__ == "__main__":
256256
asyncio.run(run_crew())

agentic_security/agents/operator_pydantic.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import asyncio
22
import logging
3-
from typing import Any, List, Dict
3+
from typing import Any
44

55
import httpx
6-
from pydantic import BaseModel, Field, ConfigDict
7-
from pydantic_ai import Agent, Tool, RunContext
6+
from pydantic import BaseModel, ConfigDict, Field
7+
from pydantic_ai import Agent, RunContext, Tool
88

99
# Assuming LLMSpec is defined elsewhere; placeholder import
1010
from agentic_security.http_spec import LLMSpec
@@ -21,8 +21,8 @@ class AgentSpecification(BaseModel):
2121
name: str | None = Field(None, description="Name of the LLM/agent")
2222
version: str | None = Field(None, description="Version of the LLM/agent")
2323
description: str | None = Field(None, description="Description of the LLM/agent")
24-
capabilities: List[str] | None = Field(None, description="List of capabilities")
25-
configuration: Dict[str, Any] | None = Field(
24+
capabilities: list[str] | None = Field(None, description="List of capabilities")
25+
configuration: dict[str, Any] | None = Field(
2626
None, description="Configuration settings"
2727
)
2828
endpoint: str | None = Field(None, description="Endpoint URL of the deployed agent")
@@ -32,7 +32,7 @@ class AgentSpecification(BaseModel):
3232

3333
# Define OperatorToolBox class
3434
class OperatorToolBox:
35-
def __init__(self, spec: AgentSpecification, datasets: List[Dict[str, Any]]):
35+
def __init__(self, spec: AgentSpecification, datasets: list[dict[str, Any]]):
3636
self.spec = spec
3737
self.datasets = datasets
3838
self.failures = []
@@ -41,7 +41,7 @@ def __init__(self, spec: AgentSpecification, datasets: List[Dict[str, Any]]):
4141
def get_spec(self) -> AgentSpecification:
4242
return self.spec
4343

44-
def get_datasets(self) -> List[Dict[str, Any]]:
44+
def get_datasets(self) -> list[dict[str, Any]]:
4545
return self.datasets
4646

4747
def validate(self) -> bool:
@@ -59,10 +59,10 @@ def stop(self) -> None:
5959
def run(self) -> None:
6060
logger.info("Running the toolbox...")
6161

62-
def get_results(self) -> List[Dict[str, Any]]:
62+
def get_results(self) -> list[dict[str, Any]]:
6363
return self.datasets
6464

65-
def get_failures(self) -> List[str]:
65+
def get_failures(self) -> list[str]:
6666
return self.failures
6767

6868
def run_operation(self, operation: str) -> str:

0 commit comments

Comments
 (0)