Skip to content

Commit b52237d

Browse files
committed
types
1 parent 11fc491 commit b52237d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/inferencesh/models/llm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ class BaseLLMOutput(BaseAppOutput):
117117
class LLMUsageMixin(BaseModel):
118118
"""Mixin for models that provide token usage statistics."""
119119
usage: Optional[LLMUsage] = Field(
120-
description="Token usage statistics"
120+
description="Token usage statistics",
121+
default=None
121122
)
122123

123124
# Example of how to use:
@@ -386,7 +387,7 @@ def __init__(self):
386387

387388
class ResponseTransformer:
388389
"""Base class for transforming model responses."""
389-
def __init__(self, output_cls: type[LLMOutput] = LLMOutput):
390+
def __init__(self, output_cls: type[BaseLLMOutput] = LLMOutput):
390391
self.state = ResponseState()
391392
self.output_cls = output_cls
392393
self.timing = None # Will be set by stream_generate

0 commit comments

Comments
 (0)