mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-10-27 04:39:58 +00:00
feat(model): Add new LLMClient and new build tools (#967)
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
import asyncio
|
||||
from dbgpt.core.awel import DAG
|
||||
from dbgpt.core import BaseOutputParser, OpenAILLM, RequestBuildOperator, PromptTemplate
|
||||
from dbgpt.core import (
|
||||
BaseOutputParser,
|
||||
RequestBuildOperator,
|
||||
PromptTemplate,
|
||||
LLMOperator,
|
||||
)
|
||||
from dbgpt.model import OpenAILLMClient
|
||||
|
||||
with DAG("simple_sdk_llm_example_dag") as dag:
|
||||
prompt_task = PromptTemplate.from_template(
|
||||
"Write a SQL of {dialect} to query all data of {table_name}."
|
||||
)
|
||||
model_pre_handle_task = RequestBuildOperator(model="gpt-3.5-turbo")
|
||||
llm_task = OpenAILLM()
|
||||
llm_task = LLMOperator(OpenAILLMClient())
|
||||
out_parse_task = BaseOutputParser()
|
||||
prompt_task >> model_pre_handle_task >> llm_task >> out_parse_task
|
||||
|
||||
|
||||
Reference in New Issue
Block a user