Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] 角色设定 Prompt 支持指定Message Role 并支持多条初始Message #4613

Closed
wertycn opened this issue Nov 5, 2024 · 4 comments
Labels
🌠 Feature Request New feature or request | 特性与建议

Comments

@wertycn
Copy link

wertycn commented Nov 5, 2024

🥰 需求描述

目前lobe-chat助手的角色设定 prompt 设置只支持单条文本,如图
image

而实际目前大部分的模型API的 请求参数是一个类似的Message 列表

[
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Hello!"
    }
  ]

基于模型API 的能力,我们可以通过填充多个Message 达到利用模型本身消息结构的few-shot的效果,而不是把所有提示都放到system 或第一次的user 消息中,以达到更好的fewshot 效果

🧐 解决方案

角色设定支持类似如下模式的输入:

image

对于现有的模版,按照当前请求LLM API 的传参设定,补充默认role 信息或增加高级模式来实现

📝 补充信息

参考 ChatGPT-Next-Web 项目的设计,这项功能深受用户喜欢

ChatGPTNextWeb/ChatGPT-Next-Web#138

@wertycn wertycn added the 🌠 Feature Request New feature or request | 特性与建议 label Nov 5, 2024
@lobehubbot
Copy link
Member

👀 @wertycn

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@arvinxx
Copy link
Contributor

arvinxx commented Nov 9, 2024

重复 #336

@arvinxx arvinxx closed this as completed Nov 9, 2024
@lobehubbot
Copy link
Member

@wertycn

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Duplicate #336

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌠 Feature Request New feature or request | 特性与建议
Projects
None yet
Development

No branches or pull requests

3 participants