feat(providers): fix loading issues
This commit is contained in:
parent
3b4b8a8b02
commit
8539ce82ad
5 changed files with 27 additions and 11 deletions
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue