From 30ba563ea7cf54ef771de5f3d3e9d74194126a6a Mon Sep 17 00:00:00 2001 From: TomasLiu Date: Tue, 3 Dec 2024 08:28:31 +0800 Subject: [PATCH] add usage by force --- .../interface/ten_ai_base/usage.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 agents/ten_packages/system/ten_ai_base/interface/ten_ai_base/usage.py diff --git a/agents/ten_packages/system/ten_ai_base/interface/ten_ai_base/usage.py b/agents/ten_packages/system/ten_ai_base/interface/ten_ai_base/usage.py new file mode 100644 index 00000000..2e555b1c --- /dev/null +++ b/agents/ten_packages/system/ten_ai_base/interface/ten_ai_base/usage.py @@ -0,0 +1,19 @@ +from pydantic import BaseModel + +class LLMCompletionTokensDetails(BaseModel): + accepted_prediction_tokens: int = 0 + audio_tokens: int = 0 + reasoning_tokens: int = 0 + rejected_prediction_tokens: int = 0 + +class LLMPromptTokensDetails(BaseModel): + audio_tokens: int = 0 + cached_tokens: int = 0 + +class LLMUsage(BaseModel): + completion_tokens: int = 0 + prompt_tokens: int = 0 + total_tokens: int = 0 + + completion_tokens_details: LLMCompletionTokensDetails | None = None + prompt_tokens_details: LLMPromptTokensDetails | None = None \ No newline at end of file