MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / add

Method add

fastdeploy/entrypoints/openai/protocol.py:127–138  ·  view source on GitHub ↗
(self, other: UsageInfo)

Source from the content-addressed store, hash-verified

125 completion_tokens_details: Optional[CompletionTokenUsageInfo] = None
126
127 def add(self, other: UsageInfo):
128 self.prompt_tokens += other.prompt_tokens
129 self.completion_tokens += other.completion_tokens
130 self.total_tokens = self.prompt_tokens + self.completion_tokens
131 if other.prompt_tokens_details and self.prompt_tokens_details:
132 self.prompt_tokens_details.add(other.prompt_tokens_details)
133 elif other.prompt_tokens_details:
134 self.prompt_tokens_details = other.prompt_tokens_details
135 if other.completion_tokens_details and self.completion_tokens_details:
136 self.completion_tokens_details.add(other.completion_tokens_details)
137 elif other.completion_tokens_details:
138 self.completion_tokens_details = other.completion_tokens_details
139
140
141class ModelPermission(BaseModel):

Callers 3

_receive_outputMethod · 0.45
handle_streamMethod · 0.45
handle_non_streamMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected