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

bug: Incorrect Formatting in messages to Claude API #4702

Open
2 of 3 tasks
piasnikj opened this issue Feb 20, 2025 · 2 comments
Open
2 of 3 tasks

bug: Incorrect Formatting in messages to Claude API #4702

piasnikj opened this issue Feb 20, 2025 · 2 comments
Assignees
Labels
type: bug Something isn't working

Comments

@piasnikj
Copy link

piasnikj commented Feb 20, 2025

Jan version

0.5.15

Describe the Bug

I just upgraded from 0.5.14 and since this update there is a clear issue with response formatting for interactions with the Claude API. Reproducible on multiple machines.

Version 0.5.15
Image

This becomes far worse if you are expecting a nicely formatted response with lists and other more complex formatting.

Version 0.5.14

Image

Steps to Reproduce

Enter any prompt that interacts with Claude's API (Sonnet).

Screenshots / Logs

No response

What is your OS?

  • MacOS
  • Windows
  • Linux
@piasnikj piasnikj added the type: bug Something isn't working label Feb 20, 2025
@github-project-automation github-project-automation bot moved this to Investigating in Menlo Feb 20, 2025
@Fuan1
Copy link

Fuan1 commented Feb 20, 2025

I have the same issue and after doing several tests, it seems to get worse in areas that require a lot of symbols such as mathematical answers.

@Sm0ove
Copy link

Sm0ove commented Feb 20, 2025

A workaround for the response format conversion was recently posted on the discord channel:

https://discord.com/channels/1107178041848909847/1341839071454040115/1341998275250884698

{% if input_request.stream %} {"object": "chat.completion.chunk", "model": "{{ input_request.model }}", "choices": [{"index": 0, "delta": { {% if input_request.type == "message_start" %} "role": "assistant", "content": null {% else if input_request.type == "ping" %} "role": "assistant", "content": null {% else if input_request.type == "content_block_delta" %} "role": "assistant", "content": {{ tojson(input_request.delta.text) }} {% else if input_request.type == "content_block_stop" %} "role": "assistant", "content": null {% else if input_request.type == "content_block_stop" %} "role": "assistant", "content": null {% endif %} }, {% if input_request.type == "content_block_stop" %} "finish_reason": "stop" {% else %} "finish_reason": null {% endif %} }]} {% else %} {{tojson(input_request)}} {% endif %}

@louis-menlo louis-menlo self-assigned this Feb 21, 2025
@louis-menlo louis-menlo moved this from Investigating to Eng Review in Menlo Mar 11, 2025
@louis-menlo louis-menlo moved this from Eng Review to QA in Menlo Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: QA
Development

No branches or pull requests

4 participants