-
Notifications
You must be signed in to change notification settings - Fork 148
refactor: consolidates all processors with one generic type #1600
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
296ad2d to
10d37f1
Compare
|
wow cool all tests passing |
10d37f1 to
f4c2951
Compare
|
Tomorrow i will backfill the tests and then good to go |
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
14ccbb3 to
81511ae
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1600 +/- ##
==========================================
- Coverage 83.97% 83.51% -0.47%
==========================================
Files 141 137 -4
Lines 13021 11934 -1087
==========================================
- Hits 10935 9967 -968
+ Misses 1463 1386 -77
+ Partials 623 581 -42 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
this is where I generalized the ChatCompletionsProcessor with a few type params, almost all the logic is the same
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.
all new endpoints will only touch this file by declaring one type implementing one small interface and that's it
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
|
Cool i came up with some cool trick while eating dinner and now we no longer need to touch internal/extproc AT ALL for adding endpoints!!!!!!! |
| func NewFactory[ReqT any, RespT any, RespChunkT any, EndpointSpecT endpointspec.Spec[ReqT, RespT, RespChunkT]]( | ||
| f metrics.Factory, | ||
| tracer tracing.RequestTracer[ReqT, RespT, RespChunkT], | ||
| _ EndpointSpecT, // This is a type marker to bind EndpointSpecT without specifying ReqT, RespT, RespChunkT explicitly. |
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.
This is so cool
nacx
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.
Nice!
|
/retest |
…xy#1600) **Description** This consolidates all the copy-pasted processors that existed per endpoint we support into one generic processor. This was made possible thanks to the series of refactoring that we landed in the past few weeks primarily for dynamic module work envoyproxy#90. Notably, now in order to add an endpoint, majority of the new code will be in translator (where also have shared generic interface) as well as the type definition. No longer it requires the huge copy paste of processors. **Related Issues/PRs (if applicable)** Resolves envoyproxy#1083 Blocker for envoyproxy#1429 envoyproxy#1584 envoyproxy#1592 envoyproxy#1594 --------- Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com> Co-authored-by: Ignasi Barrera <ignasi@tetrate.io> Signed-off-by: Erica Hughberg <erica.sundberg.90@gmail.com>
Description
This consolidates all the copy-pasted processors that existed per endpoint we support into one generic processor. This was made possible thanks to the series of refactoring that we landed in the past few weeks primarily for dynamic module work #90.
Notably, now in order to add an endpoint, majority of the new code will be in translator (where also have shared generic interface) as well as the type definition. No longer it requires the huge copy paste of processors.
Related Issues/PRs (if applicable)
Resolves #1083
Blocker for #1429 #1584 #1592 #1594