From 3271caddffc6d3c29537bbc4aa56a6432855d136 Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 8 Apr 2024 19:10:27 +0700 Subject: [PATCH] update flowsettings --- libs/ktem/flowsettings.py | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/libs/ktem/flowsettings.py b/libs/ktem/flowsettings.py index 2e26cff1a..25f0c06a2 100644 --- a/libs/ktem/flowsettings.py +++ b/libs/ktem/flowsettings.py @@ -73,30 +73,29 @@ if config("OPENAI_API_KEY", default=""): KH_LLMS["openai"] = { - "def": { + "spec": { "__type__": "kotaemon.llms.ChatOpenAI", "temperature": 0, - "openai_api_base": config("OPENAI_API_BASE", default="") + "base_url": config("OPENAI_API_BASE", default="") or "https://api.openai.com/v1", - "openai_api_key": config("OPENAI_API_KEY", default=""), + "api_key": config("OPENAI_API_KEY", default=""), "model": config("OPENAI_CHAT_MODEL", default="") or "gpt-3.5-turbo", - "request_timeout": 10, - "stream": False, + "timeout": 10, }, "default": False, } if len(KH_EMBEDDINGS) < 1: KH_EMBEDDINGS["openai"] = { - "def": { + "spec": { "__type__": "kotaemon.embeddings.OpenAIEmbeddings", - "openai_api_base": config("OPENAI_API_BASE", default="") + "base_url": config("OPENAI_API_BASE", default="") or "https://api.openai.com/v1", - "openai_api_key": config("OPENAI_API_KEY", default=""), + "api_key": config("OPENAI_API_KEY", default=""), "model": config( "OPENAI_EMBEDDINGS_MODEL", default="text-embedding-ada-002" ) or "text-embedding-ada-002", - "request_timeout": 10, + "timeout": 10, "chunk_size": 16, }, "default": False, @@ -104,7 +103,7 @@ if config("LOCAL_MODEL", default=""): KH_LLMS["local"] = { - "def": { + "spec": { "__type__": "kotaemon.llms.EndpointChatLLM", "endpoint_url": "http://localhost:31415/v1/chat/completions", }, @@ -113,7 +112,7 @@ } if len(KH_EMBEDDINGS) < 1: KH_EMBEDDINGS["local"] = { - "def": { + "spec": { "__type__": "kotaemon.embeddings.EndpointEmbeddings", "endpoint_url": "http://localhost:31415/v1/embeddings", }, @@ -164,10 +163,4 @@ "config": {}, "index_type": "ktem.index.file.FileIndex", }, - { - "id": 2, - "name": "Sample", - "config": {}, - "index_type": "ktem.index.file.FileIndex", - }, ]