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

fix: openai extension #6528

Merged
merged 4 commits into from
Nov 18, 2024
Merged

fix: openai extension #6528

merged 4 commits into from
Nov 18, 2024

Conversation

hronoas
Copy link
Contributor

@hronoas hronoas commented Nov 13, 2024

Pull Request Title:
Fix: Handle Multiple Content Items in Messages

Description:

Currently, when messages contain multiple content items, only the last item in the list is used.

Example Issue:

Given the following JSON input:

{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "first item"
        },
        {
          "type": "text",
          "text": "second item"
        },
        {
          "type": "text",
          "text": "last item"
        }
      ]
    }
  ]
}

The system currently utilizes only "last item" and ignores the other entries.

Proposed Fix:

This PR addresses the issue by ensuring all content items within a message are processed appropriately.

Checklist:

@hronoas
Copy link
Contributor Author

hronoas commented Nov 13, 2024

For example, the Cline extension in VSCode does not work correctly due to this issue.

@Ph0rk0z
Copy link
Contributor

Ph0rk0z commented Nov 14, 2024

Also some food for thought related to this: https://old.reddit.com/r/SillyTavernAI/comments/1govgfw/dev_st_produces_incorrect_chat_completion/

There may also be multiple SYSTEM messages depending on what front end/app is communicating with the API in chat completion. This may break the template for the model as well.

Chat completion sure is "fun".

@oobabooga
Copy link
Owner

Thanks for the fix

@oobabooga oobabooga merged commit 9b3a3d8 into oobabooga:dev Nov 18, 2024
cyberfox pushed a commit to cyberfox/text-generation-webui that referenced this pull request Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants