mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-03 18:17:45 +00:00
Native data AI application framework based on AWEL+AGENT (#1152)
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: lcx01800250 <lcx01800250@alibaba-inc.com> Co-authored-by: licunxing <864255598@qq.com> Co-authored-by: Aralhi <xiaoping0501@gmail.com> Co-authored-by: xuyuan23 <643854343@qq.com> Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: hzh97 <2976151305@qq.com>
This commit is contained in:
@@ -12,6 +12,7 @@ from dbgpt.core import (
|
||||
ModelRequest,
|
||||
ModelRequestContext,
|
||||
)
|
||||
from dbgpt.core.awel.flow import Parameter, ResourceCategory, register_resource
|
||||
from dbgpt.model.parameter import ProxyModelParameters
|
||||
from dbgpt.model.proxy.base import ProxyLLMClient
|
||||
from dbgpt.model.proxy.llms.proxy_model import ProxyModel
|
||||
@@ -42,6 +43,32 @@ async def chatgpt_generate_stream(
|
||||
yield r
|
||||
|
||||
|
||||
@register_resource(
|
||||
label="OpenAI LLM Client",
|
||||
name="openai_llm_client",
|
||||
category=ResourceCategory.LLM_CLIENT,
|
||||
parameters=[
|
||||
Parameter.build_from(
|
||||
label="OpenAI API Key",
|
||||
name="apk_key",
|
||||
type=str,
|
||||
optional=True,
|
||||
default=None,
|
||||
description="OpenAI API Key, not required if you have set OPENAI_API_KEY "
|
||||
"environment variable.",
|
||||
),
|
||||
Parameter.build_from(
|
||||
label="OpenAI API Base",
|
||||
name="api_base",
|
||||
type=str,
|
||||
optional=True,
|
||||
default=None,
|
||||
description="OpenAI API Base, not required if you have set OPENAI_API_BASE "
|
||||
"environment variable.",
|
||||
),
|
||||
],
|
||||
documentation_url="https://github.com/openai/openai-python",
|
||||
)
|
||||
class OpenAILLMClient(ProxyLLMClient):
|
||||
def __init__(
|
||||
self,
|
||||
|
Reference in New Issue
Block a user