当前位置: 首页 > wzjs >正文

苹果软件做ppt模板下载网站2022重大时政热点事件简短

苹果软件做ppt模板下载网站,2022重大时政热点事件简短,二手手表交易平台,营销型网站建设公司电话简介 文章主要介绍了如何扩展一个自定义app插件,这里先看下生成效果,生成的内容其实还是有问题的,后续博主会调整提示词看看能不能优化生成效果 修改代码 代码详情 # chat_di是从chat_normal复制过来的,这里只改了提示词 from d…

简介

文章主要介绍了如何扩展一个自定义app插件,这里先看下生成效果,生成的内容其实还是有问题的,后续博主会调整提示词看看能不能优化生成效果

修改代码

代码详情

# chat_di是从chat_normal复制过来的,这里只改了提示词

from dbgpt._private.config import Config

from dbgpt.core import (

    ChatPromptTemplate,

    HumanPromptTemplate,

    MessagesPlaceholder,

    SystemPromptTemplate,

)

from dbgpt_app.scene import AppScenePromptTemplateAdapter, ChatScene

from dbgpt_app.scene.chat_di.out_parser import DiChatOutputParser

PROMPT_SCENE_DEFINE_EN = """

    You are a SeaTunnel configuration expert, please generate HOCON format configuration files according to user needs. requirement:

    1.Check if the user input contains all necessary parameters and validate them separately by source, transform, and sink.

    2.If there are missing parameters, return the corresponding JSON error message, clearly indicating the missing parameters.

    3.If there are multiple possible matches, prompt the user to make a clear selection.

    4.If all necessary parameters are complete, generate the correct HOCON configuration file, which includes four parts: env, source, transform, and sink.

    5.When necessary parameters are missing from the configuration item, prompt the user to complete them and directly return JSON format data, such as "success": "false", "result": "Kafka missing topic configuration"

    6.Parameter replacement needs to be obtained from the data source and user input, do not fabricate non-existent configuration items

"""

PROMPT_SCENE_DEFINE_ZH = """

                你是一个SeaTunnel配置专家,请根据用户需求生成HOCON格式配置文件。要求:

                1.检查用户输入是否包含所有必要参数,按source、transform、sink分别验证。

                2.如果有参数缺失,返回对应的JSON错误信息,明确指出缺少的参数。

                3.如果存在多个可能的匹配项,提示用户明确选择。

                4.如果所有必要参数齐全,生成正确的HOCON配置文件,包含env、source、transform、sink四个部分。

                5.配置项中缺少必要参数时,提示用户补全,直接返回json格式数据,如 "success":"false","result":"kafka缺少topic配置"

                6.替换参数需要从数据源和用户输入中获取,不要编造不存在的配置项

                数据源信息:

"""

CFG = Config()

PROMPT_SCENE_DEFINE = (

    PROMPT_SCENE_DEFINE_ZH if CFG.LANGUAGE == "zh" else PROMPT_SCENE_DEFINE_EN

)

prompt = ChatPromptTemplate(

    messages=[

        SystemPromptTemplate.from_template(PROMPT_SCENE_DEFINE),

        MessagesPlaceholder(variable_name="chat_history"),

        MessagesPlaceholder(variable_name="media_input"),

        HumanPromptTemplate.from_template("{input}"),

    ]

)

prompt_adapter = AppScenePromptTemplateAdapter(

    prompt=prompt,

    template_scene=ChatScene.ChatDi.value(),

    stream_out=True,

    output_parser=DiChatOutputParser(),

)

CFG.prompt_template_registry.register(

    prompt_adapter, language=CFG.LANGUAGE, is_default=True

)

base.py

    ChatDi = Scene(

        code="chat_di",

        name="数据集成问答",

        describe="数据集成问答,生成数据集成任务和工作流",

        # param_types=["Plugin Select"],

)

chat_factory.py

        from dbgpt_app.scene.chat_di.chat import ChatDi  # noqa: F401

        from dbgpt_app.scene.chat_di.prompt import prompt  # noqa: F401,F811

gpts_app.py

        chat_with_di = NativeTeamContext(

            chat_scene="chat_di",

            scene_name="数据集成模型问答",

            scene_describe="数据集成模型问答",

            param_title="",

            show_disable=False,

        )

        chat_di_app = GptsApp(

            app_code=chat_with_di.chat_scene,

            app_name=chat_with_di.scene_name,

            language="zh",

            team_mode="native_app",

            details=[],

            app_describe=chat_with_di.scene_describe,

            team_context=chat_with_di,

            param_need=[

                {

                    "type": AppParamType.Resource.value,

                    "value": ResourceType.ExcelFile.value,

                },

                {"type": AppParamType.Model.value, "value": None},

                {"type": AppParamType.Temperature.value, "value": None},

                {"type": AppParamType.MaxNewTokens.value, "value": None},

            ],

            user_code=user_code,

            published="true",

        )

        try:

            gpts_dao.remove_native_app(chat_di_app.app_code)

            gpts_dao.create(chat_di_app)

        except Exception as ex:

            logger.exception(f"create chat_di_app error: {ex}")

http://www.dtcms.com/wzjs/93008.html

相关文章:

  • 临海市住房和城乡建设规划局网站seo站长工具下载
  • 用phython做网站线上推广哪个平台最好
  • 网站建设 菜鸟教程seo网络排名优化哪家好
  • 手机做网站的步骤网站推广专家
  • 聊城网站建设品牌怎么开网站平台挣钱
  • 冠县哪做网站产品推广方案范文500字
  • 湖北seo排名诊断搜索引擎关键词优化
  • 一个网站如何做盈利网络营销期末总结
  • 做全英文网站网站怎么优化自己免费
  • 用服务器ip做网站域名app推广公司怎么对接业务
  • 宿迁网站定制电商运营主要负责什么
  • 视频链接生成网站免费推广方法有哪些
  • wordpress 爆破贵阳seo网站推广
  • wordpress 去除html优化大师手机版下载
  • 网站内链怎么做更好单页网站制作
  • wordpress 的论坛模板安阳企业网站优化外包
  • 甘肃省住房和城乡建设部网站2024年3月新冠高峰
  • 网站建设团队架构大兵seo博客
  • 海南最新情况最新消息今天全达seo
  • 网站优化时间网站推广优化排名公司
  • 网站建设公司成就优化视频
  • 河北省住建和城乡建设厅网站googleplay官网
  • 闵行区人民政府官网优化品牌seo关键词
  • 静态网站的设计方案网络营销八大目标是什么
  • 萧山做网站哪里找沈阳市网站
  • 狼雨的网站网站关键词排名分析
  • 济南建设主管部门网站seo比较好的优化方法
  • 大型移动网站建设广州推广优化
  • wordpress arrayseo优化方法
  • php做的网站手机能看到seo网站内容优化有哪些