mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
Fix not initialized response latencies (#5679)
This commit is contained in:
@@ -46,8 +46,14 @@ class Metrics:
|
||||
|
||||
@property
|
||||
def response_latencies(self) -> list[ResponseLatency]:
|
||||
if not hasattr(self, '_response_latencies'):
|
||||
self._response_latencies = []
|
||||
return self._response_latencies
|
||||
|
||||
@response_latencies.setter
|
||||
def response_latencies(self, value: list[ResponseLatency]) -> None:
|
||||
self._response_latencies = value
|
||||
|
||||
def add_cost(self, value: float) -> None:
|
||||
if value < 0:
|
||||
raise ValueError('Added cost cannot be negative.')
|
||||
|
||||
Reference in New Issue
Block a user