feat(rag): Support RAG SDK (#1322)

This commit is contained in:
Fangyin Cheng
2024-03-22 15:36:57 +08:00
committed by GitHub
parent e65732d6e4
commit 8a17099dd2
69 changed files with 1332 additions and 558 deletions

View File

@@ -1,19 +1,21 @@
import asyncio
from typing import Any, Coroutine, List
from dbgpt.app.scene import BaseChat, ChatFactory
chat_factory = ChatFactory()
async def llm_chat_response_nostream(chat_scene: str, **chat_param):
"""llm_chat_response_nostream"""
from dbgpt.app.scene import BaseChat, ChatFactory
chat_factory = ChatFactory()
chat: BaseChat = chat_factory.get_implementation(chat_scene, **chat_param)
res = await chat.get_llm_response()
return res
async def llm_chat_response(chat_scene: str, **chat_param):
from dbgpt.app.scene import BaseChat, ChatFactory
chat_factory = ChatFactory()
chat: BaseChat = chat_factory.get_implementation(chat_scene, **chat_param)
return chat.stream_call()

View File

@@ -226,7 +226,7 @@ class EnvArgumentParser:
**kwargs,
) -> Any:
"""Parse parameters from environment variables and command lines and populate them into data class"""
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(allow_abbrev=False)
for field in fields(dataclass_type):
env_var_value: Any = _genenv_ignoring_key_case_with_prefixes(
field.name, env_prefixes