-
Notifications
You must be signed in to change notification settings - Fork 0
DM-37253: Make Prompt Processing service configurable #71
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
This class will encapsulate pipeline selection configuration and transfer the information between the activator and MiddlewareInterface. The current class is a stub with no functionality.
The initial implementation is a copy of MiddlewareInterface._get_pipeline_file.
This change completes the transfer of existing pipeline-selection functionality from MiddlewareInterface to PipelinesConfig.
""" | ||
# Use regex instead of str.split, in case keys or values also have spaces. | ||
node = re.compile(r'\s*\(survey="(?P<survey>[\w\s]+)"\)=' | ||
r'(?P<filename>[-\w./${} ]*[-\w./${}])(?:\s+|$)') |
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.
Probably just a matter of taste. Would r'(?P<filename>[^=,]*[^=, ])(?:\s+|$)')
be slightly easier to read and still correct?
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 had that before, actually, but then got worried that that might match some unexpected (and possibly malicious) string. I figured it's best to err on the side of being too restrictive.
I agree that ^=,
would be easier to read.
7db0070
to
14f75ad
Compare
The input only supports simple survey-pipeline mappings for now, but is designed with future selection criteria in mind.
The pipeline was only used by test_middleware_interface.py, but had to go into `pipelines/` because that location was assumed by the application code.
14f75ad
to
247e890
Compare
The survey field is not always populated for test data.
All but the shortest config strings provided through environment variables are likely to be multiline, so this case must be supported.
247e890
to
2f33a6c
Compare
This PR adds a pipeline configuration variable (
PIPELINES_CONFIG
) to the service setup, which maps surveys to pipelines. This allows the target pipeline(s) to be controlled fromprompt-proto-service.yaml
instead of being hardcoded intoMiddlewareInterface.py
.