Skip to content

Commit f5f91e6

Browse files
committed
fix: resolve TypeScript linter error for cache_control property
Use type assertion to handle cache_control property that's not in OpenAI types
1 parent 9345041 commit f5f91e6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/api/providers/lite-llm.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ export class LiteLLMHandler extends RouterProvider implements SingleCompletionHa
5454
type: "text",
5555
text: systemPrompt,
5656
cache_control: { type: "ephemeral" },
57-
},
57+
} as any,
5858
],
59-
} as OpenAI.Chat.ChatCompletionSystemMessageParam
59+
}
6060

6161
// Find the last two user messages to apply caching
6262
const userMsgIndices = openAiMessages.reduce(
@@ -78,7 +78,7 @@ export class LiteLLMHandler extends RouterProvider implements SingleCompletionHa
7878
type: "text",
7979
text: message.content,
8080
cache_control: { type: "ephemeral" },
81-
},
81+
} as any,
8282
],
8383
}
8484
} else if (Array.isArray(message.content)) {
@@ -87,10 +87,10 @@ export class LiteLLMHandler extends RouterProvider implements SingleCompletionHa
8787
...message,
8888
content: message.content.map((content, contentIndex) =>
8989
contentIndex === message.content.length - 1
90-
? {
90+
? ({
9191
...content,
9292
cache_control: { type: "ephemeral" },
93-
}
93+
} as any)
9494
: content,
9595
),
9696
}

0 commit comments

Comments
 (0)