Skip to content

Conversation

iBotPeaches
Copy link
Collaborator

What:

  • Bug Fix

Description:

When running streaming from Claude in OpenAI compatibility mode we find that Claude returns a payload structure (shortened) like this.

data: {"id":"msg_0111RgCFCqN68mJbev6Rq1cz","choices":[{"index":0,"delta":{"role":"assistant"}}],"created":1744469024,"model":"claude-3-7-sonnet-20250219","object":"chat.completion.chunk"}
data: {"type": "ping"}
data: {"id":"msg_0111RgCFCqN68mJbev6Rq1cz","choices":[{"index":0,"delta":{"content":"Hello!"}}],"created":1744469024,"model":"claude-3-7-sonnet-20250219","object":"chat.completion.chunk"}
data: [DONE]

Related:

fixes: #555

@iBotPeaches iBotPeaches changed the title Fix: Support streaming of non-OpenAI models that return "ping" fix: Support streaming of non-OpenAI models that return "ping" Apr 12, 2025
@iBotPeaches iBotPeaches merged commit a1fe444 into openai-php:main Apr 12, 2025
10 checks passed
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.

[Bug]: Claude Models not working with Stream Option
1 participant