Fix PredictModel to return correct output fields#55
Open
reyna-abhyankar wants to merge 3 commits intoGenseeAI:mainfrom
Open
Fix PredictModel to return correct output fields#55reyna-abhyankar wants to merge 3 commits intoGenseeAI:mainfrom
PredictModel to return correct output fields#55reyna-abhyankar wants to merge 3 commits intoGenseeAI:mainfrom
Conversation
PredictModel to return correct output fields
cognify/frontends/dspy/connector.py
Outdated
| # stripping the reasoning field may crash their workflow, so we warn users instead | ||
| warnings.warn( | ||
| "Original module contained reasoning. This will be stripped. Add reasoning as a cog instead", | ||
| f"DSPy module {name} contained reasoning. This may lead to undefined behavior.", |
Contributor
There was a problem hiding this comment.
this needs more explanation to the user. say something like Cognify performs its own reasoning prompt optimization automatically, which may not work well together with DSPy's; consider removing DSPy's reasoning prompts.
| if isinstance(dspy_predictor, dspy.Retrieve): | ||
| warnings.warn( | ||
| "Original module is a `Retrieve`. This will be ignored", UserWarning | ||
| "Original module is a `dspy.Retrieve`. This will be ignored", UserWarning |
Contributor
There was a problem hiding this comment.
what does this retrive mean? why ignore?
Contributor
Author
There was a problem hiding this comment.
dspy.Retrieve is their retriever. They still consider retrieval to be a "module", and since we don't optimize retrieval, I just ignore it. This means whenever it gets called in the actual workflow, we will call the original retrieve module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modify
PredictModel(in DSPy connector) to directly use the DSPy output parsing instead of enforcing ourStructuredModelAlso, remove deletion of reasoning field from signature to maintain compatibility with user's original workflow.