feat(events): Add EventEmitter and instrument ai_client.py

This commit is contained in:
2026-02-23 16:23:55 -05:00
parent 93e72b5530
commit cd3f3c89ed
3 changed files with 38 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ from pathlib import Path
import file_cache
import mcp_client
import google.genai
from events import EventEmitter
_provider: str = "gemini"
_model: str = "gemini-2.5-flash"
@@ -27,6 +28,9 @@ _max_tokens: int = 8192
_history_trunc_limit: int = 8000
# Global event emitter for API lifecycle events
events = EventEmitter()
def set_model_params(temp: float, max_tok: int, trunc_limit: int = 8000):
global _temperature, _max_tokens, _history_trunc_limit
_temperature = temp