[fix] antropic
This commit is contained in:
@@ -732,6 +732,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
if(raiModel.startsWith('claude')){
|
if(raiModel.startsWith('claude')){
|
||||||
|
|
||||||
let replacerURL = (aiModel === 'reverse_proxy') ? (db.forceReplaceUrl) : ('https://api.anthropic.com/v1/complete')
|
let replacerURL = (aiModel === 'reverse_proxy') ? (db.forceReplaceUrl) : ('https://api.anthropic.com/v1/complete')
|
||||||
|
let apiKey = (aiModel === 'reverse_proxy') ? db.proxyKey : db.claudeAPIKey
|
||||||
if(aiModel === 'reverse_proxy'){
|
if(aiModel === 'reverse_proxy'){
|
||||||
if(replacerURL.endsWith('v1')){
|
if(replacerURL.endsWith('v1')){
|
||||||
replacerURL += '/complete'
|
replacerURL += '/complete'
|
||||||
@@ -785,10 +786,11 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"x-api-key": db.claudeAPIKey,
|
"x-api-key": apiKey,
|
||||||
"anthropic-version": "2023-06-01",
|
"anthropic-version": "2023-06-01",
|
||||||
"accept": "application/json"
|
"accept": "application/json"
|
||||||
}
|
},
|
||||||
|
useRisuToken: true
|
||||||
})
|
})
|
||||||
|
|
||||||
if((!da.ok) || (da.data.error)){
|
if((!da.ok) || (da.data.error)){
|
||||||
|
|||||||
Reference in New Issue
Block a user