Perplexity appears to have statefulness within a conversation, so converting a system message to "user" in one call and then back to "system" in the next (after more messages are appended) causes API errors. Remove the trailing system→user conversion entirely — if the context only has system messages, the API call will fail but the mistake will be caught right away.
55 KiB
55 KiB