Skip to content

Commit

Permalink
update flowsettings
Browse files Browse the repository at this point in the history
  • Loading branch information
lone17 committed Apr 8, 2024
1 parent 636b008 commit 3271cad
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions libs/ktem/flowsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,38 +73,37 @@

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,
}

if config("LOCAL_MODEL", default=""):
KH_LLMS["local"] = {
"def": {
"spec": {
"__type__": "kotaemon.llms.EndpointChatLLM",
"endpoint_url": "http://localhost:31415/v1/chat/completions",
},
Expand All @@ -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",
},
Expand Down Expand Up @@ -164,10 +163,4 @@
"config": {},
"index_type": "ktem.index.file.FileIndex",
},
{
"id": 2,
"name": "Sample",
"config": {},
"index_type": "ktem.index.file.FileIndex",
},
]

0 comments on commit 3271cad

Please sign in to comment.