feat: Add model type support

Adds model type support for chat and embedding models. This allows users to specify which type of model they want to use when adding custom models.

Additionally, this commit introduces a more descriptive interface for adding custom models, enhancing the clarity of the model selection process.
This commit is contained in:
n4ze3m
2024-10-13 18:22:16 +05:30
parent 4e04155471
commit ff4473c35b
9 changed files with 277 additions and 43 deletions

View File

@@ -138,7 +138,7 @@ export const getEmbeddingModels = async ({ returnEmpty }: {
}) => {
try {
const ollamaModels = await getAllModels({ returnEmpty })
const customModels = await ollamaFormatAllCustomModels()
const customModels = await ollamaFormatAllCustomModels("embedding")
return [
...ollamaModels.map((model) => {
@@ -217,7 +217,7 @@ export const fetchChatModels = async ({
})
const chromeModel = await getChromeAIModel()
const customModels = await ollamaFormatAllCustomModels()
const customModels = await ollamaFormatAllCustomModels("chat")
return [
...chatModels,
@@ -234,7 +234,7 @@ export const fetchChatModels = async ({
}
})
const chromeModel = await getChromeAIModel()
const customModels = await ollamaFormatAllCustomModels()
const customModels = await ollamaFormatAllCustomModels("chat")
return [
...models,
...chromeModel,