Skip to content

Commit 0d1fea5

Browse files
authored
Merge pull request #14 from workflowai/guillaume/fix-float-token-count
Allow prompt count to have decimals
2 parents d922dd4 + b43d26f commit 0d1fea5

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "workflowai"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
description = ""
55
authors = ["Guillaume Aquilina <guillaume@workflowai.com>"]
66
readme = "README.md"

workflowai/core/domain/llm_usage.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@
66
class LLMUsage(BaseModel):
77
"""An object to store usage information for the LLM provider"""
88

9-
prompt_token_count: Optional[int] = Field(
10-
default=None, description="The number of tokens in the prompt",
9+
prompt_token_count: Optional[float] = Field(
10+
default=None,
11+
description="The number of tokens in the prompt",
1112
)
1213
prompt_cost_usd: Optional[float] = Field(
13-
default=None, description="The cost of the prompt in USD",
14+
default=None,
15+
description="The cost of the prompt in USD",
1416
)
1517

16-
completion_token_count: Optional[int] = Field(
17-
default=None, description="The number of tokens in the completion",
18+
completion_token_count: Optional[float] = Field(
19+
default=None,
20+
description="The number of tokens in the completion",
1821
)
1922
completion_cost_usd: Optional[float] = Field(
20-
default=None, description="The cost of the completion in USD",
23+
default=None,
24+
description="The cost of the completion in USD",
2125
)
2226

2327
@property

0 commit comments

Comments
 (0)