* update welcome svg

* fix loading chatglm3 (#1937)

* update welcome svg

* update welcome message

* fix loading chatglm3

---------

Co-authored-by: binary-husky <qingxu.fu@outlook.com>
Co-authored-by: binary-husky <96192199+binary-husky@users.noreply.github.com>

* begin rag project with llama index

* rag version one

* rag beta release

* add social worker (proto)

* fix llamaindex version

---------

Co-authored-by: moetayuko <loli@yuko.moe>
This commit is contained in:
binary-husky
2024-09-08 23:20:42 +08:00
committed by GitHub
parent 16f4fd636e
commit dd66ca26f7
19 changed files with 1103 additions and 12 deletions

View File

@@ -95,3 +95,19 @@ def select_api_key(keys, llm_model):
api_key = random.choice(avail_key_list) # 随机负载均衡
return api_key
def select_api_key_for_embed_models(keys, llm_model):
import random
avail_key_list = []
key_list = keys.split(',')
if llm_model.startswith('text-embedding-'):
for k in key_list:
if is_openai_api_key(k): avail_key_list.append(k)
if len(avail_key_list) == 0:
raise RuntimeError(f"您提供的api-key不满足要求不包含任何可用于{llm_model}的api-key。您可能选择了错误的模型或请求源。")
api_key = random.choice(avail_key_list) # 随机负载均衡
return api_key