refactor(sdm): Global pass with refined 'External Only' SDM tags. Pruned redundant internal references and fixed indentation logic in injector. Verified full project compilation.
This commit is contained in:
@@ -22,16 +22,25 @@ class UserSimAgent:
|
||||
return max(0.5, min(5.0, delay))
|
||||
|
||||
def wait_to_read(self, text: str) -> None:
|
||||
"""
|
||||
[C: simulation/workflow_sim.py:WorkflowSimulator.wait_for_ai_response]
|
||||
"""
|
||||
if self.enable_delays:
|
||||
delay = self.calculate_reading_delay(text)
|
||||
time.sleep(delay)
|
||||
|
||||
def wait_to_think(self, probability: float = 0.2, min_delay: float = 2.0, max_delay: float = 5.0) -> None:
|
||||
"""
|
||||
[C: simulation/workflow_sim.py:WorkflowSimulator.wait_for_ai_response]
|
||||
"""
|
||||
if self.enable_delays and random.random() < probability:
|
||||
delay = random.uniform(min_delay, max_delay)
|
||||
time.sleep(delay)
|
||||
|
||||
def simulate_typing(self, text: str, jitter_range: tuple[float, float] = (0.01, 0.05), batch_typing: bool = False) -> None:
|
||||
"""
|
||||
[C: simulation/workflow_sim.py:WorkflowSimulator.run_discussion_turn_async]
|
||||
"""
|
||||
if not self.enable_delays:
|
||||
return
|
||||
if batch_typing or self.batch_typing:
|
||||
@@ -50,8 +59,10 @@ class UserSimAgent:
|
||||
|
||||
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'
|
||||
|
||||
Generates a human-like response based on the conversation history.
|
||||
conversation_history: list of dicts with 'role' and 'content'
|
||||
[C: simulation/workflow_sim.py:WorkflowSimulator.run_discussion_turn_async]
|
||||
"""
|
||||
last_ai_msg = ""
|
||||
for entry in reversed(conversation_history):
|
||||
@@ -67,9 +78,11 @@ class UserSimAgent:
|
||||
|
||||
def perform_action_with_delay(self, action_func: Callable, *args: Any, **kwargs: Any) -> Any:
|
||||
"""
|
||||
Executes an action with a human-like delay if enabled.
|
||||
|
||||
Executes an action with a human-like delay if enabled.
|
||||
[C: tests/test_user_agent.py:test_perform_action_with_delay]
|
||||
"""
|
||||
if self.enable_delays:
|
||||
delay = random.uniform(0.5, 2.0)
|
||||
time.sleep(delay)
|
||||
return action_func(*args, **kwargs)
|
||||
return action_func(*args, **kwargs)
|
||||
Reference in New Issue
Block a user