feat(providers): fix loading issues
This commit is contained in:
parent
3b4b8a8b02
commit
8539ce82ad
5 changed files with 27 additions and 11 deletions
|
|
@ -5,6 +5,8 @@ import logger from '../../utils/logger';
|
|||
export const loadOpenAIChatModels = async () => {
|
||||
const openAIApiKey = getOpenaiApiKey();
|
||||
|
||||
if (!openAIApiKey) return {};
|
||||
|
||||
try {
|
||||
const chatModels = {
|
||||
'GPT-3.5 turbo': new ChatOpenAI({
|
||||
|
|
@ -36,9 +38,11 @@ export const loadOpenAIChatModels = async () => {
|
|||
}
|
||||
};
|
||||
|
||||
export const loadOpenAIEmbeddingsModel = async () => {
|
||||
export const loadOpenAIEmbeddingsModels = async () => {
|
||||
const openAIApiKey = getOpenaiApiKey();
|
||||
|
||||
if (!openAIApiKey) return {};
|
||||
|
||||
try {
|
||||
const embeddingModels = {
|
||||
'Text embedding 3 small': new OpenAIEmbeddings({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue