-
Notifications
You must be signed in to change notification settings - Fork 690
feat: Allow Python Engine to end stream before final #2270
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
Conversation
WalkthroughA new error variant for Python's Changes
Sequence Diagram(s)sequenceDiagram
participant PythonAsyncGen as Python Async Generator
participant RustEngine as Rust Engine
participant PushHandler as Push Handler
PythonAsyncGen->>RustEngine: Yields item or raises exception
RustEngine->>RustEngine: Detects exception type
alt Exception is GeneratorExit
RustEngine->>PushHandler: Return PyGeneratorExit error
PushHandler->>PushHandler: Log warning, set flag, break loop
else Other Exception
RustEngine->>PushHandler: Return PythonException error
PushHandler->>PushHandler: Handle as generic error
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (5)📓 Common learnings📚 Learning: the asyncenginecontextprovider trait in lib/runtime/src/engine.rs was intentionally changed from `se...Applied to files:
📚 Learning: the codebase uses async-nats version 0.40, not the older nats crate. error handling should use async...Applied to files:
📚 Learning: in lib/llm/src/kv_router/scoring.rs, the user prefers to keep the panic behavior when calculating lo...Applied to files:
📚 Learning: in async-nats, the "no responders" error is represented as async_nats::error::requesterrorkind::nore...Applied to files:
🔇 Additional comments (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
727080c to
be1a631
Compare
tedzhouhk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested to be working
rmccorm4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question, but not blocking approval: https://github.com/ai-dynamo/dynamo/pull/2270/files#r2253082585
Overview:
Allow the Python engine to raise GeneratorExit exception while generating response, which will end the stream without final, so the request is migrated by the frontend if migration is enabled.
Details:
Should be merged together with #2280
Where should the reviewer start?
Start with the backend docs, and then move to the Python-Rust binding changes.
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
N/A
Summary by CodeRabbit