Skip to content

Conversation

@Vasuk12
Copy link

@Vasuk12 Vasuk12 commented Dec 13, 2025

Fixes: #3552

What does this PR do?

The parameter allows users to request top log probabilities for each token when logprobs are enabled via the include parameter. The response will contain top_logprobs from the provider or None if not supported.

  • Add top_logprobs parameter to create_openai_response in agents.py
  • Pass top_logprobs through _create_streaming_response
  • Add top_logprobs to StreamingResponseOrchestrator
  • Pass top_logprobs to inference API (OpenAIChatCompletionRequestWithExtraBody)

Test Plan

Implements issue llamastack#3552: Add support for top_logprobs parameter in Responses Create API.

Changes:
- Add top_logprobs parameter to create_openai_response in agents.py
- Pass top_logprobs through _create_streaming_response
- Add top_logprobs to StreamingResponseOrchestrator
- Pass top_logprobs to inference API (OpenAIChatCompletionRequestWithExtraBody)

The parameter allows users to request top log probabilities for each token
when logprobs are enabled via the include parameter. The response will
contain top_logprobs from the provider or None if not supported.

Fixes: llamastack#3552
@meta-cla
Copy link

meta-cla bot commented Dec 13, 2025

Hi @Vasuk12!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla
Copy link

meta-cla bot commented Dec 13, 2025

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 13, 2025
@iamemilio
Copy link
Contributor

cc @leseb @cdoern could a maintainer please enable CI on this PR

@Vasuk12
Copy link
Author

Vasuk12 commented Dec 17, 2025

Hi, thanks for running the ci checks. I will commit with some additions to the yaml files to solve the failing integration tests.

Signed-off-by: Vasu <vasukhare88@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Dec 20, 2025

✱ Stainless preview builds

This PR will update the llama-stack-client SDKs with the following commit message.

feat: Add top_logprobs parameter to Responses API

Edit this comment to update it. It will appear in the SDK's changelogs.

llama-stack-client-python studio · conflict

There was a conflict between your custom code and your generated changes.
You don't need to resolve this conflict right now, but you will need to resolve it for your changes to be released to your users. Read more about why this happened here.

llama-stack-client-node studio · code · diff

Your SDK built successfully.
generate ⚠️build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/llama-stack-client-node/50cd18a6e9ff5efac07d8d78db71214249967291/dist.tar.gz
llama-stack-client-kotlin studio · code · diff

Your SDK built successfully.
generate ⚠️lint ✅test ❗

llama-stack-client-go studio · code · diff

Your SDK built successfully.
generate ❗lint ❗test ❗

go get github.com/stainless-sdks/llama-stack-client-go@b24c62ea08cc21b524fbf61c5687e99a08d9217d

This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
Last updated: 2025-12-21 08:14:21 UTC

Signed-off-by: Vasu <vasukhare88@gmail.com>
@mergify
Copy link

mergify bot commented Dec 20, 2025

This pull request has merge conflicts that must be resolved before it can be merged. @Vasuk12 please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Dec 20, 2025
@mergify mergify bot removed the needs-rebase label Dec 20, 2025
@Vasuk12
Copy link
Author

Vasuk12 commented Dec 21, 2025

Hey @iamemilio @leseb, I have implemented some changes and all tests have passed. Let me know if there are any other changes that might be reuired...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Responses max_logprobs

2 participants