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

#163: Evolving the resiliency & routing architecture to support chatStream #166

Merged
merged 28 commits into from
Mar 17, 2024

Conversation

roma-glushko
Copy link
Member

@roma-glushko roma-glushko commented Mar 5, 2024

Integrating the streaming chat workflow into the existing resiliency & routing mechanisms.

Changes

  • Separated sync and streaming chat schemas
  • Extracted assumptions on where to find latency from routing strategies to a separate LatencyGetters that can be different for different models/workflows
  • Elaborated the client provider chatStream() interface. Clients now expose a response channel instead of being provided with by caller
  • Connected the stream chat workflow to latency & health tracking
  • Refined the chatStream() method of clients to return a stream struct
  • Separated latency tracking of the streaming workflow from the sync chat workflow
  • defined a new HealthTracker to incorporate all health tracking logic

…quests & removed latency from the model interface as it turned out to be a property of a specific model action
@roma-glushko roma-glushko marked this pull request as ready for review March 11, 2024 16:47
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 74.95108% with 128 lines in your changes are missing coverage. Please review.

Project coverage is 64.20%. Comparing base (1add6e3) to head (c3b7470).

Files Patch % Lines
pkg/providers/lang.go 75.75% 22 Missing and 2 partials ⚠️
pkg/routers/router.go 76.38% 14 Missing and 3 partials ⚠️
pkg/providers/openai/errors.go 60.00% 12 Missing and 2 partials ⚠️
pkg/providers/testing/lang.go 85.26% 12 Missing and 2 partials ⚠️
pkg/routers/config.go 76.27% 13 Missing and 1 partial ⚠️
pkg/api/http/handlers.go 0.00% 10 Missing ⚠️
pkg/providers/openai/chat_stream.go 80.76% 9 Missing and 1 partial ⚠️
pkg/providers/clients/stream.go 0.00% 9 Missing ⚠️
pkg/providers/anthropic/chat_stream.go 0.00% 2 Missing ⚠️
pkg/providers/azureopenai/chat_stream.go 0.00% 2 Missing ⚠️
... and 7 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #166      +/-   ##
===========================================
+ Coverage    61.39%   64.20%   +2.81%     
===========================================
  Files           65       70       +5     
  Lines         2839     3079     +240     
===========================================
+ Hits          1743     1977     +234     
- Misses         994     1000       +6     
  Partials       102      102              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@roma-glushko roma-glushko marked this pull request as draft March 11, 2024 18:32
@roma-glushko roma-glushko requested a review from mkrueger12 March 13, 2024 21:13
@roma-glushko roma-glushko marked this pull request as ready for review March 17, 2024 11:50
@roma-glushko roma-glushko merged commit a04eccf into develop Mar 17, 2024
10 checks passed
@roma-glushko roma-glushko deleted the 163-streaming-workflow-resiliency branch March 17, 2024 12:57
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.

🔧 [Stream Router] Extend the model health & latency tracking functionality to account for streaming API
1 participant