Skip to content

400 bad request using role with Perplexity #448

@dev-microcosm

Description

@dev-microcosm

Describe the bug

Using a Perplexity model with a role flag gives a 400 bad request.
"error, status code: 400, status: 400 Bad Request, message: After the (optional) system message(s), user and assistant roles should be alternating."

Setup

  • add your Perplexity API key
  • add a role (I am using the 'shell' example)

Please complete the following information along with version numbers, if applicable.

  • OS: Ubuntu 24.04.2 LTS
  • Shell: PowerShell 7.4.7
  • Terminal Emulator: Ghostty 1.1.3
  • mods: 1.7.0

To Reproduce

Steps to reproduce the behavior:

  1. run a prompt with the role on a Perplexity model
  2. get a 400 error (non Perplexity models and Perplexity models without the role flag seem to work fine)

Expected behavior

I expect a response using the provided role like the other AI models.

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions