File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 1111
1212
1313class MetricsMiddleware (RunMiddlewareProtocol ):
14- def __init__ (self ):
14+ def __init__ (self ) -> None :
1515 self .start_time : datetime | None = None
1616 self .end_time : datetime | None = None
1717 self .tool_calls : int = 0
@@ -28,10 +28,10 @@ def bind(self, ctx: RunContext) -> None:
2828 EmitterOptions (is_blocking = True , priority = 1 ),
2929 )
3030
31- async def _on_run_context_start (self , event : RunContextStartEvent , meta : EventMeta ):
31+ async def _on_run_context_start (self , event : RunContextStartEvent , meta : EventMeta ) -> None :
3232 self .start_time = datetime .now ()
3333
34- async def _on_run_context_finish (self , event : RunContextFinishEvent , meta : EventMeta ):
34+ async def _on_run_context_finish (self , event : RunContextFinishEvent , meta : EventMeta ) -> None :
3535 self .end_time = datetime .now ()
3636
3737 @property
@@ -40,5 +40,5 @@ def duration(self) -> float:
4040 return (self .end_time - self .start_time ).total_seconds ()
4141 return 0
4242
43- def get_metrics (self ) -> dict :
43+ def get_metrics (self ) -> dict [ str , float ] :
4444 return {"duration" : self .duration }
Original file line number Diff line number Diff line change 1+ from typing import Generator
2+
3+
14import pytest
25
6+
37@pytest .hookimpl (wrapper = True )
4- def pytest_terminal_summary (terminalreporter : pytest .TerminalReporter , exitstatus , config : pytest .Config ):
8+ def pytest_terminal_summary (
9+ terminalreporter : pytest .TerminalReporter , exitstatus , config : pytest .Config
10+ ) -> Generator :
511 yield
612 metrics = config .stash .get ("metrics" , None )
713
Original file line number Diff line number Diff line change 99
1010
1111class TriageAgentTestCase :
12- def __init__ (self , input , expected_output ):
13- self .input = input
14- self .expected_output = expected_output
12+ def __init__ (self , input : str , expected_output : TriageOutputSchema ):
13+ self .input : str = input
14+ self .expected_output : TriageOutputSchema = expected_output
1515 self .metrics : dict = None
1616
1717 async def run (self ) -> TriageState :
You can’t perform that action at this time.
0 commit comments