[feat] openrouter apis
This commit is contained in:
@@ -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: [{
|
||||
11
src/ts/model/openrouter.ts
Normal file
11
src/ts/model/openrouter.ts
Normal 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 []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user