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

一般做网站是用什么程序做的如何建立公司网站多少钱

一般做网站是用什么程序做的,如何建立公司网站多少钱,服装培训网站建设,推广方法有哪些简介 文章主要介绍了如何扩展一个自定义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/568388.html

相关文章:

  • 济南网站制作定制公司wordpress流动图片
  • 建立网站接受投注是什么意思设计公司logo用什么软件
  • 网络一站式服务平台C 如何做简易网站
  • 廊坊哪里有做阿里巴巴网站的青海网站建设 小程序开发
  • 网络技术专业就业方向seo每天一贴
  • 为网站做seo最新体育新闻头条
  • wordpress站点地址和中网可信网站查询
  • iis7 部署网站福州网站设计网址
  • 天津网站备案时间线上推广有哪些平台效果好
  • 阳江做网站多少钱wordpress mysql 搭建
  • 建设网站的安全性最早做团购的网站
  • 智库网站建设方案躺平设计家官网
  • 网站文字列表页模板it培训班大概需要多少钱
  • 建站行业有哪些上线了做的网站怎么办
  • 服饰东莞网站建设怎么在企查查网站做企业认证
  • 网站建设公司龙头网站建设公司的服务
  • 网站制作招聘个人做跨境电商网站
  • qq发网站链接怎么做安全的南昌网站制作
  • 网站怎么做才是对搜索引擎友好地方网站做哪些内容
  • qq刷赞网站推广软件汽车制造行业网站模板
  • 现代郑州网站建设医院做网站是最简单的前端吗
  • 企业网站备案 优帮云浦项建设公司员工网站
  • 装饰网站设计模板下载python 做网站缺点
  • 广西美丽乡村建设网站邯郸建设局公开网站
  • 湖北省建设厅质监站网站优建网站
  • 阿里云网站更换域名快消品网站建设
  • 成都高端品牌网站建设ppt模板图片 背景
  • 网站建设完成以后应该怎样备份wordpress 分类404
  • 专做律所网站网站框架怎么搭建
  • 沈阳网站建设公司多少钱山水人家装饰公司