Update from Vibe Studio
This commit is contained in:
40
src/api/spellCheck.ts
Normal file
40
src/api/spellCheck.ts
Normal 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)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user