fix(#371): resolve TypeScript strictness errors in telemetry tracking
- llm-cost-table.ts: Add undefined guard for MODEL_COSTS lookup - llm-telemetry-tracker.service.ts: Allow undefined in callingContext for exactOptionalPropertyTypes compatibility Refs #371 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -80,7 +80,10 @@ export function getModelCost(modelName: string): ModelCost {
|
|||||||
|
|
||||||
for (const prefix of SORTED_PREFIXES) {
|
for (const prefix of SORTED_PREFIXES) {
|
||||||
if (normalized.startsWith(prefix)) {
|
if (normalized.startsWith(prefix)) {
|
||||||
return MODEL_COSTS[prefix];
|
const cost = MODEL_COSTS[prefix];
|
||||||
|
if (cost !== undefined) {
|
||||||
|
return cost;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export interface LlmCompletionParams {
|
|||||||
* Optional calling context hint for task type inference.
|
* Optional calling context hint for task type inference.
|
||||||
* Examples: "brain", "chat", "embed", "planning", "code-review"
|
* Examples: "brain", "chat", "embed", "planning", "code-review"
|
||||||
*/
|
*/
|
||||||
callingContext?: string;
|
callingContext?: string | undefined;
|
||||||
/** Whether the call succeeded or failed */
|
/** Whether the call succeeded or failed */
|
||||||
success: boolean;
|
success: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user