mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-09 12:59:43 +00:00
feat(rag): Support RAG SDK (#1322)
This commit is contained in:
@@ -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()
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user