Skip to content

Add model_request_stream_sync to direct API #2116

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

Merged
merged 19 commits into from
Jul 4, 2025

Conversation

hewliyang
Copy link
Contributor

@hewliyang hewliyang commented Jul 2, 2025

closes #2096

  • sync helper for model_request_stream with some threading overhead
  • enforces usage within a context manager to prevent thread leakages

@hewliyang hewliyang marked this pull request as draft July 2, 2025 17:52
@hewliyang hewliyang changed the title feat(direct-api): model_request_stream_sync` feat(direct-api): model_request_stream_sync Jul 2, 2025
@hewliyang hewliyang force-pushed the hly/feat/streaming-sync-direct branch from cb65100 to 285328b Compare July 2, 2025 17:53
Copy link
Contributor

hyperlint-ai bot commented Jul 3, 2025

PR Change Summary

Added support for synchronous streamed requests in the API documentation.

  • Introduced StreamedResponseSync model in the API documentation.
  • Added model_request_stream_sync function to the direct API documentation.

Modified Files

  • docs/api/models/base.md
  • docs/direct.md

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

@hewliyang hewliyang marked this pull request as ready for review July 3, 2025 15:33
@hewliyang hewliyang requested a review from DouweM July 4, 2025 05:47
@hewliyang hewliyang requested a review from DouweM July 4, 2025 18:26
@DouweM DouweM changed the title feat(direct-api): model_request_stream_sync Add model_request_stream_sync to direct API Jul 4, 2025
@DouweM DouweM merged commit e4e4999 into pydantic:main Jul 4, 2025
19 checks passed
@DouweM
Copy link
Contributor

DouweM commented Jul 4, 2025

@hewliyang Nice work, thanks! We'll release this early next week

@hewliyang hewliyang deleted the hly/feat/streaming-sync-direct branch July 5, 2025 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sync method for direct api model_request_stream
2 participants