Files
page-assist/src/models/index.ts

42 lines
693 B
TypeScript
Raw Normal View History

2024-06-30 20:45:06 +05:30
import { ChatChromeAI } from "./ChatChromeAi"
import { ChatOllama } from "./ChatOllama"
export const pageAssistModel = async ({
model,
baseUrl,
keepAlive,
temperature,
topK,
topP,
numCtx,
seed
}: {
model: string
baseUrl: string
keepAlive?: string
temperature?: number
topK?: number
topP?: number
numCtx?: number
seed?: number
2024-06-30 20:45:06 +05:30
}) => {
switch (model) {
case "chrome::gemini-nano::page-assist":
return new ChatChromeAI({
temperature,
topK
})
default:
return new ChatOllama({
baseUrl,
keepAlive,
temperature,
topK,
topP,
numCtx,
seed,
model
})
}
}