(self, other: UsageInfo)
| 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 | |
| 141 | class ModelPermission(BaseModel): |
no outgoing calls
no test coverage detected