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

Chat Response: Add logprobs #533

Merged
merged 4 commits into from
Apr 8, 2025

Conversation

klmork
Copy link
Contributor

@klmork klmork commented Mar 11, 2025

What:

  • Bug Fix
  • New Feature

Description:

Add logprobs to CreateResponseChoice.

Updates tests and docs.

This pull does not:

  • Add logprobs to CreateStreamedResponseChoice.
  • Add all of the logprob fields at this time (e.g. refusal or content's field of top_logprobs array).

Related:

fixes: #455

@iBotPeaches
Copy link
Collaborator

Do you mind rebasing? I allowed CI to run, but since this is an older PR its still using cache/v1 which is dead. A simple rebase will solve that and we can see if this will pass CI.

thanks!

klmork added 4 commits April 4, 2025 14:29
Only add content for now.
Now that we have our classes for logprobs (CreateResponseChoiceLogprobs
and CreateResponseChoiceLogbropsContent), let's actually add logprobs in
the CreateResponseChoice / CreateResponse objects.

Update types, fixtures, tests.
@klmork klmork force-pushed the add-chat-response-logprobs branch from 7c0bea4 to 1dbd60a Compare April 4, 2025 21:43
@klmork
Copy link
Contributor Author

klmork commented Apr 4, 2025

Thanks @iBotPeaches! Just rebased 👍

@iBotPeaches iBotPeaches merged commit babb3e1 into openai-php:main Apr 8, 2025
10 checks passed
@iBotPeaches
Copy link
Collaborator

thanks! Tested it out a bit with on/off and worked as I expect. Thanks for 1st PR with perfect CI/CD passing and quick response.

@iBotPeaches iBotPeaches added the enhancement New feature or request label Apr 8, 2025
@klmork
Copy link
Contributor Author

klmork commented Apr 8, 2025

Awesome! Yay, thanks 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Logprobs property is missing in Chat\CreateResponseChoice
2 participants