[feat] openrouter apis

This commit is contained in:
kwaroran
2023-07-21 17:41:48 +09:00
parent b0fa63a14b
commit 7d2860bf35
10 changed files with 51 additions and 18 deletions

View File

@@ -200,7 +200,7 @@ async function createBotFromWebMain(prompt:string):Promise<{ ok: false; data:str
content: rqv
},{
role: 'system',
content: "\n\n*Name*:\n*Age*:\n*gender*: \n*race*:\n*Hair style, color*:\n*color, shape of eye*:\n*Personality*:\n*Dress*:\n*Height (cm)*:\n*weight(kg)*:\n*Job*:\n*Specialty*:\n*Features*: \n*Likes*:\n*Dislikes*:\n*Character's background*: \n\n[[This is a format that you must convert to. output the latest information If there is older information. If it is unknown, output as unknown. only output the converted result. now, output the converted result.]]"
content: "\n\n*Name*:\n*Age*:\n*gender*: \n*race*:\n*Hair style, color*:\n*color, shape of eye*:\n*Personality*:\n*Dress*:\n*Height (cm)*:\n*weight(kg)*:\n*Job*:\n*Specialty*:\n*Features*: \n*Likes*:\n*Dislikes*:\n*Character's background*: \n*Other informations*: \n\n[[This is a format that you must convert to. output the latest information If there is older information. If it is unknown, output as unknown. only output the converted result. now, output the converted result.]]"
}],
maxTokens: 600,
temperature: 0,
@@ -230,6 +230,14 @@ async function createBotFromWebMain(prompt:string):Promise<{ ok: false; data:str
}
async function createBotByAI() {
let search = await alertInput(language.inputBotGenerationPrompt)
if(search.length < 3){
return
}
}
async function createFirstMsg(charDesc:string) {
const v = await requestChatData({
formated: [{

View File

@@ -0,0 +1,11 @@
export async function openRouterModels() {
try {
const aim = fetch("https://openrouter.ai/api/v1/models")
const res = await (await aim).json()
return res.data.map((v:any) => {
return v.id
})
} catch (error) {
return []
}
}