Update from Vibe Studio
This commit is contained in:
31
src/api/spell-check-tool.ts
Normal file
31
src/api/spell-check-tool.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 错别字检测与修正工具 API
|
||||
* 调用 Dify 平台进行错别字检测与修正
|
||||
*/
|
||||
|
||||
export interface DifyRequest {
|
||||
inputs: {
|
||||
user_input: string
|
||||
}
|
||||
query: string
|
||||
response_mode: string
|
||||
}
|
||||
|
||||
export function checkSpellingWithDify(user_input: string) {
|
||||
const requestBody: DifyRequest = {
|
||||
inputs: {
|
||||
user_input
|
||||
},
|
||||
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-4SnGvNq4HPxFH4Ie8C0xo7ng'
|
||||
},
|
||||
body: JSON.stringify(requestBody)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user