Add 2 embeding models from OpenAI (#812)

### What problem does this PR solve?

#810 

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
KevinHuSh
2024-05-17 08:51:29 +08:00
committed by GitHub
parent d54d1375a5
commit e73ce39b66
2 changed files with 40 additions and 0 deletions

View File

@ -135,6 +135,16 @@ class TenantLLMService(CommonService):
.execute()
return num
@classmethod
@DB.connection_context()
def get_openai_models(cls):
objs = cls.model.select().where(
(cls.model.llm_factory == "OpenAI"),
~(cls.model.llm_name == "text-embedding-3-small"),
~(cls.model.llm_name == "text-embedding-3-large")
).dicts()
return list(objs)
class LLMBundle(object):
def __init__(self, tenant_id, llm_type, llm_name=None, lang="Chinese"):