mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-01-17 08:35:10 +00:00
Update to version 0.7.4, fix CORS errors for the Moonshot provider, add BM25 search support, and document related changes in the CHANGELOG.
This commit is contained in:
parent
c0cd2ccf4d
commit
d99ea8f2f6
@ -1,4 +1,8 @@
|
|||||||
releases:
|
releases:
|
||||||
|
- version: "0.7.4"
|
||||||
|
fixes:
|
||||||
|
- "fix moonshot provider cors error"
|
||||||
|
- "add bm25 search support"
|
||||||
- version: "0.7.3"
|
- version: "0.7.3"
|
||||||
features:
|
features:
|
||||||
- "add idb support"
|
- "add idb support"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "infio-copilot",
|
"id": "infio-copilot",
|
||||||
"name": "Infio Copilot",
|
"name": "Infio Copilot",
|
||||||
"version": "0.7.3",
|
"version": "0.7.4",
|
||||||
"minAppVersion": "0.15.0",
|
"minAppVersion": "0.15.0",
|
||||||
"description": "A Cursor-inspired AI assistant for notes that offers smart autocomplete and interactive chat with your selected notes",
|
"description": "A Cursor-inspired AI assistant for notes that offers smart autocomplete and interactive chat with your selected notes",
|
||||||
"author": "Felix.D",
|
"author": "Felix.D",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian-infio-copilot",
|
"name": "obsidian-infio-copilot",
|
||||||
"version": "0.7.3",
|
"version": "0.7.4",
|
||||||
"description": "A Cursor-inspired AI assistant that offers smart autocomplete and interactive chat with your selected notes",
|
"description": "A Cursor-inspired AI assistant that offers smart autocomplete and interactive chat with your selected notes",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import { OpenAIMessageAdapter } from './openai-message-adapter'
|
|||||||
|
|
||||||
export class OpenAICompatibleProvider implements BaseLLMProvider {
|
export class OpenAICompatibleProvider implements BaseLLMProvider {
|
||||||
private adapter: OpenAIMessageAdapter
|
private adapter: OpenAIMessageAdapter
|
||||||
private client: OpenAI
|
private client: OpenAI | NoStainlessOpenAI
|
||||||
private apiKey: string
|
private apiKey: string
|
||||||
private baseURL: string
|
private baseURL: string
|
||||||
|
|
||||||
@ -54,8 +54,8 @@ export class OpenAICompatibleProvider implements BaseLLMProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取提供商特定的额外参数
|
// 获取提供商特定的额外参数
|
||||||
private getExtraParams(isStreaming: boolean): Record<string, any> {
|
private getExtraParams(isStreaming: boolean): Record<string, unknown> {
|
||||||
const extraParams: Record<string, any> = {}
|
const extraParams: Record<string, unknown> = {}
|
||||||
|
|
||||||
// 阿里云Qwen API需要在非流式调用中设置 enable_thinking: false
|
// 阿里云Qwen API需要在非流式调用中设置 enable_thinking: false
|
||||||
if (this.isAlibabaQwen() && !isStreaming) {
|
if (this.isAlibabaQwen() && !isStreaming) {
|
||||||
@ -77,7 +77,7 @@ export class OpenAICompatibleProvider implements BaseLLMProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const extraParams = this.getExtraParams(false) // 非流式调用
|
const extraParams = this.getExtraParams(false) // 非流式调用
|
||||||
return this.adapter.generateResponse(this.client, request, options, extraParams)
|
return this.adapter.generateResponse(this.client as OpenAI, request, options, extraParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
async streamResponse(
|
async streamResponse(
|
||||||
@ -92,6 +92,6 @@ export class OpenAICompatibleProvider implements BaseLLMProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const extraParams = this.getExtraParams(true) // 流式调用
|
const extraParams = this.getExtraParams(true) // 流式调用
|
||||||
return this.adapter.streamResponse(this.client, request, options, extraParams)
|
return this.adapter.streamResponse(this.client as OpenAI, request, options, extraParams)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export class OpenAIMessageAdapter {
|
|||||||
client: OpenAI,
|
client: OpenAI,
|
||||||
request: LLMRequestNonStreaming,
|
request: LLMRequestNonStreaming,
|
||||||
options?: LLMOptions,
|
options?: LLMOptions,
|
||||||
extraParams?: Record<string, any>,
|
extraParams?: Record<string, unknown>,
|
||||||
): Promise<LLMResponseNonStreaming> {
|
): Promise<LLMResponseNonStreaming> {
|
||||||
const response = await client.chat.completions.create(
|
const response = await client.chat.completions.create(
|
||||||
{
|
{
|
||||||
@ -50,7 +50,7 @@ export class OpenAIMessageAdapter {
|
|||||||
client: OpenAI,
|
client: OpenAI,
|
||||||
request: LLMRequestStreaming,
|
request: LLMRequestStreaming,
|
||||||
options?: LLMOptions,
|
options?: LLMOptions,
|
||||||
extraParams?: Record<string, any>,
|
extraParams?: Record<string, unknown>,
|
||||||
): Promise<AsyncIterable<LLMResponseStreaming>> {
|
): Promise<AsyncIterable<LLMResponseStreaming>> {
|
||||||
const stream = await client.chat.completions.create(
|
const stream = await client.chat.completions.create(
|
||||||
{
|
{
|
||||||
|
|||||||
@ -216,6 +216,13 @@ describe('parseSmartCopilotSettings', () => {
|
|||||||
useCustomUrl: false,
|
useCustomUrl: false,
|
||||||
models: [],
|
models: [],
|
||||||
},
|
},
|
||||||
|
moonshotProvider: {
|
||||||
|
name: 'Moonshot',
|
||||||
|
apiKey: '',
|
||||||
|
baseUrl: '',
|
||||||
|
useCustomUrl: false,
|
||||||
|
models: [],
|
||||||
|
},
|
||||||
siliconflowProvider: {
|
siliconflowProvider: {
|
||||||
name: 'SiliconFlow',
|
name: 'SiliconFlow',
|
||||||
apiKey: '',
|
apiKey: '',
|
||||||
@ -458,6 +465,13 @@ describe('settings migration', () => {
|
|||||||
useCustomUrl: false,
|
useCustomUrl: false,
|
||||||
models: [],
|
models: [],
|
||||||
},
|
},
|
||||||
|
moonshotProvider: {
|
||||||
|
name: 'Moonshot',
|
||||||
|
apiKey: '',
|
||||||
|
baseUrl: '',
|
||||||
|
useCustomUrl: false,
|
||||||
|
models: [],
|
||||||
|
},
|
||||||
siliconflowProvider: {
|
siliconflowProvider: {
|
||||||
name: 'SiliconFlow',
|
name: 'SiliconFlow',
|
||||||
apiKey: '',
|
apiKey: '',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user