fix lint type error

This commit is contained in:
duanfuxiang 2025-02-18 13:04:37 +08:00
parent 653744c98a
commit 0c9589f380
5 changed files with 11 additions and 8 deletions

View File

@ -1,7 +1,7 @@
{
"name": "obsidian-infio-copilot",
"version": "0.0.3",
"description": "A Cursor-inspired AI assistant for Obsidian that offers smart autocomplete and interactive chat with your selected notes",
"version": "0.0.4",
"description": "A Cursor-inspired AI assistant that offers smart autocomplete and interactive chat with your selected notes",
"main": "main.js",
"scripts": {
"bundle-pglite": "node scripts/bundle-pglite-resources.mjs",

View File

@ -158,6 +158,7 @@ export class GroqProvider implements BaseLLMProvider {
finish_reason: choice.finish_reason,
message: {
content: choice.message.content,
reasoning_content: 'reasoning_content' in choice.message ? (choice.message.reasoning_content as string) : null,
role: choice.message.role,
},
})),
@ -177,6 +178,7 @@ export class GroqProvider implements BaseLLMProvider {
finish_reason: choice.finish_reason ?? null,
delta: {
content: choice.delta.content ?? null,
reasoning_content: 'reasoning_content' in choice.delta ? (choice.delta.reasoning_content as string) : null,
role: choice.delta.role,
},
})),

View File

@ -121,8 +121,8 @@ export class OpenAIMessageAdapter {
choices: response.choices.map((choice) => ({
finish_reason: choice.finish_reason,
message: {
content: choice.message.content,
reasoning_content: choice.message.reasoning_content,
content: choice.message.content,
reasoning_content: 'reasoning_content' in choice.message ? (choice.message.reasoning_content as string) : null,
role: choice.message.role,
},
})),
@ -143,7 +143,7 @@ export class OpenAIMessageAdapter {
finish_reason: choice.finish_reason ?? null,
delta: {
content: choice.delta.content ?? null,
reasoning_content: choice.delta.reasoning_content ?? null,
reasoning_content: 'reasoning_content' in choice.delta ? (choice.delta.reasoning_content as string) : null,
role: choice.delta.role,
},
})),

View File

@ -248,7 +248,7 @@ export const ComboBoxComponent: React.FC<ComboBoxComponentProps> = ({
<select
className="infio-llm-setting-provider-switch"
value={modelProvider}
onChange={(e) => setModelProvider(e.target.value)}
onChange={(e) => setModelProvider(e.target.value as ApiProvider)}
>
{providers.map((provider) => (
<option

View File

@ -30,7 +30,8 @@ export type ResponseUsage = {
type NonStreamingChoice = {
finish_reason: string | null // Depends on the model. Ex: 'stop' | 'length' | 'content_filter' | 'tool_calls' | 'function_call'
message: {
content: string | null
content: string | null
reasoning_content?: string | null
role: string
}
error?: Error
@ -40,7 +41,7 @@ type StreamingChoice = {
finish_reason: string | null
delta: {
content: string | null
reasoning_content: string | null
reasoning_content?: string | null
role?: string
}
error?: Error