ChatGPTNextWeb / ChatGPTNextWeb/NextChat

[Feature Request]: Improve Concatenated Send Messages Logic

Open
#4,303 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
88.8k
Forks
59.1k
PR merge metrics
No merged PRs in 30d

Description

### Problem Description

The current concatenated send messages logic has an issue. It only works consistently for `OpenAI`, but when using another provider such as `Anthropic (Claude)`, it does not work consistently.

![image](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/assets/17626300/0cfdb5a7-687c-4efc-96d8-a79622c620f7)

### Solution Description

If possible, it would be better to improve the logic and make it more structured. The suggested approach is:

1. If there is no `system` role, make the `user` role the first one.
2. If there is a `system` role, make the `user` role the second one.

This improvement would ensure consistent behavior across different providers and a more structured approach to handling concatenated messages.

### Alternatives Considered

_No response_

### Additional Context

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.