-
Notifications
You must be signed in to change notification settings - Fork 27
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
extproc: remove the path from the translator factory #334
Conversation
// - `l`: the logger. | ||
type Factory func(path string) (Translator, error) | ||
// Factory creates a [Translator] for the given API schema combination. | ||
type Factory func() Translator | ||
|
||
// NewFactory returns a callback function that creates a translator for the given API schema combination. | ||
func NewFactory(in, out filterapi.VersionedAPISchema) (Factory, error) { |
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.
should we now rename this to NewChatCompletionTranslatorFactory
?
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.
I've completely removed the Factory now, and moved the translator instantiation to the chat completion processor, as it does only make sense for that processor.
WDYT?
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.
sg
coverage! |
c3a1722
to
916b0bf
Compare
Signed-off-by: Ignasi Barrera <[email protected]>
Signed-off-by: Ignasi Barrera <[email protected]>
Signed-off-by: Ignasi Barrera <[email protected]>
Signed-off-by: Ignasi Barrera <[email protected]>
916b0bf
to
bbfdc4e
Compare
} | ||
return nil, fmt.Errorf("unsupported path: %s", path) | ||
// NewOpenAIToAWSBedrockTranslator implements [Factory] for OpenAI to AWS Bedrock translation. | ||
func NewOpenAIToAWSBedrockTranslator() Translator { |
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.
here as well
Signed-off-by: Ignasi Barrera <[email protected]>
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.
Thank you for a nice clean up!
Commit Message
extproc: remove the path from the translator factory
Removes the path from the translator factory, now that there is a dedicated processor for the chat completion endpoint.
Related Issues/PRs (if applicable)
Follow-up for: #325 (review)
Special notes for reviewers (if applicable)
Note that I don't remove the
Factory
type completely so that only the right translator is instantiated and only when needed.