refactor: replace Any types with specific types and update bad_code.md
- Replace Any with object or specific types across codebase - Add ReviewRequest dataclass for PR review payloads - Update bad_code.md: mark 5.1 (Any Type Overuse) as resolved - Fix summary table with accurate counts and unresolved issues list
This commit is contained in:
+4
-4
@@ -1,7 +1,7 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import lmstudio as lms
|
||||
from typing import Any, Callable
|
||||
from typing import Callable
|
||||
from .prompt import CAVEMAN_PROMPT
|
||||
|
||||
logger: logging.Logger = logging.getLogger("agent-base")
|
||||
@@ -13,7 +13,7 @@ class _ActResponseCapture:
|
||||
def __init__(self) -> None:
|
||||
self.responses: list[str] = []
|
||||
|
||||
def __call__(self, message: Any) -> None:
|
||||
def __call__(self, message: object) -> None:
|
||||
content: str = ""
|
||||
if hasattr(message, 'content'):
|
||||
content = message.content
|
||||
@@ -58,7 +58,7 @@ class BaseAgent:
|
||||
|
||||
def __init__(self, model_name: str) -> None:
|
||||
self.model_name: str = model_name
|
||||
self.model: Any | None = None
|
||||
self.model: object | None = None
|
||||
self.system_prompt: str = ""
|
||||
|
||||
async def initialize(self) -> None:
|
||||
@@ -87,7 +87,7 @@ class BaseAgent:
|
||||
logger.error(f"Agent execution error: {e}")
|
||||
return f"Error in agent execution: {str(e)}"
|
||||
|
||||
async def run_with_tools(self, user_input: str, tools: list[Any]) -> str:
|
||||
async def run_with_tools(self, user_input: str, tools: list[object]) -> str:
|
||||
"""Run the agent with tool calling capability."""
|
||||
if self.model is None:
|
||||
await self.initialize()
|
||||
|
||||
Reference in New Issue
Block a user