OUTPUT #1101 | 626 karakter | 24 satır
def as_dict(self) -> dict[str, Any]:
return {
"calls": self.calls,
"cached_calls": self.cached_calls,
"input_tokens": self.input_tokens,
"output_tokens": self.output_tokens,
"cost_usd": round(self.cost_usd, 6),
}
@dataclass
class Answer:
"""One typed answer. `raw` keeps every field the API returned."""
id: str
kind: str
raw: dict[str, Any] = field(default_factory=dict)
@property
def noul(self) -> float:
return float(self.raw["noul"])
@property
root@213-238-170-219:/home/hermes#