feat(providers): fix loading issues

This commit is contained in:
ItzCrazyKns
2024-07-08 15:39:27 +05:30
parent 3b4b8a8b02
commit 8539ce82ad
5 changed files with 27 additions and 11 deletions

View File

@ -6,6 +6,8 @@ import { ChatOllama } from '@langchain/community/chat_models/ollama';
export const loadOllamaChatModels = async () => {
const ollamaEndpoint = getOllamaApiEndpoint();
if (!ollamaEndpoint) return {};
try {
const response = await fetch(`${ollamaEndpoint}/api/tags`, {
headers: {
@ -31,9 +33,11 @@ export const loadOllamaChatModels = async () => {
}
};
export const loadOpenAIEmbeddingsModel = async () => {
export const loadOllamaEmbeddingsModels = async () => {
const ollamaEndpoint = getOllamaApiEndpoint();
if (!ollamaEndpoint) return {};
try {
const response = await fetch(`${ollamaEndpoint}/api/tags`, {
headers: {