refactor(simulation): Add strict type hints to simulation modules

This commit is contained in:
2026-02-28 19:00:36 -05:00
parent 53c2bbfa81
commit ec91c90c15
4 changed files with 19 additions and 21 deletions

View File

@@ -1,9 +1,10 @@
import time
import random
from typing import Any, Callable
import ai_client
class UserSimAgent:
def __init__(self, hook_client, model="gemini-2.5-flash-lite"):
def __init__(self, hook_client: Any, model: str = "gemini-2.5-flash-lite") -> None:
self.hook_client = hook_client
self.model = model
self.system_prompt = (
@@ -13,7 +14,7 @@ class UserSimAgent:
"Do not use markdown blocks for your main message unless you are providing code."
)
def generate_response(self, conversation_history):
def generate_response(self, conversation_history: list[dict]) -> str:
"""
Generates a human-like response based on the conversation history.
conversation_history: list of dicts with 'role' and 'content'
@@ -38,7 +39,7 @@ class UserSimAgent:
ai_client.set_custom_system_prompt("")
return response
def perform_action_with_delay(self, action_func, *args, **kwargs):
def perform_action_with_delay(self, action_func: Callable, *args: Any, **kwargs: Any) -> Any:
"""
Executes an action with a human-like delay.
"""