8000 Updated imodel - event.streaming by ohdearquant · Pull Request #544 · khive-ai/lionagi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Updated imodel - event.streaming #544

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 10 commits into from
Jan 23, 2025
Merged

Updated imodel - event.streaming #544

merged 10 commits into from
Jan 23, 2025

Conversation

ohdearquant
Copy link
Collaborator
@ohdearquant ohdearquant commented Jan 23, 2025

PR 1: Updated iModel2

Summary of Changes:

  • Introduced a new streaming property on Event and a corresponding stream() method.
  • Enhanced the Processor logic to distinguish between streaming and non-streaming events:
    • If event.streaming is True, the processor calls event.stream() instead of event.invoke().
    • Applied concurrency control when concurrency_limit is set.
  • Modified APICalling to support both normal invocation and streaming within the same class.
  • Unified error-handling logic for both invoke and stream paths (logging errors, updating event status, etc.).
  • Minor refactoring to better align code across the codebase (e.g., file structure and imports).

Why This PR?

  • Needed an integrated way to handle streaming responses within the same queue/processor flow used for standard requests.
  • Simplifies code by adding a single attribute (streaming = True) on an event rather than creating a separate streaming event class.
  • Improves reliability, as both invoke() and stream() now share a consistent state and error-handling approach.

Testing:

  • Verified that queue-based processing respects concurrency limits for streaming.
  • Manually tested both normal invocation and streaming across various endpoints.
  • Ensured the updated logic did not break existing rate-limit features or event statuses.

@ohdearquant ohdearquant merged commit 30a1416 into main Jan 23, 2025
@ohdearquant ohdearquant changed the title Updated imodel2 Updated imodel - event.streaming Jan 29, 2025
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.

1 participant
0