Update from Vibe Studio

This commit is contained in:
Vibe Studio
2026-01-16 03:55:43 +00:00
parent 90cb1a8345
commit f33e9727f2
5 changed files with 401 additions and 1 deletions

40
src/api/spellCheck.ts Normal file
View File

@@ -0,0 +1,40 @@
export interface SpellCheckRequest {
user_input_text: string
auto_correct: boolean
custom_vocab: string[]
}
export interface DifyRequest {
inputs: {
user_input_text: string
auto_correct: boolean
custom_vocab: string[]
}
query: string
response_mode: string
}
export function checkAndCorrectSpelling(
user_input_text: string,
auto_correct: boolean,
custom_vocab: string[]
) {
const requestBody: DifyRequest = {
inputs: {
user_input_text,
auto_correct,
custom_vocab
},
query: '1',
response_mode: 'streaming'
}
return fetch('https://copilot.sino-bridge.com/v1/chat-messages', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer app-Dmsx84IAGk7rVCko5MWptmK3'
},
body: JSON.stringify(requestBody)
})
}