-
Notifications
You must be signed in to change notification settings - Fork 6
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
Cheaper think thoroughly prophet agent #539
Conversation
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
prediction_market_agent/agents/think_thoroughly_agent/deploy.py (1)
Line range hint
1-70
: Consider architectural implications of hardcoded model selection.Moving model selection from deployment configuration to base classes reduces flexibility. This architectural change makes it harder to:
- Override model choice at deployment time
- A/B test different models
- Quickly respond to model deprecations or upgrades
Consider maintaining deployment-time model configuration capability while defaulting to gpt-4o.
Consider adding an optional model parameter to maintain flexibility:
def load(self) -> None: - self.agent = self.agent_class(enable_langfuse=self.enable_langfuse) + self.agent = self.agent_class( + enable_langfuse=self.enable_langfuse, + model=getattr(self, 'model', None) # Use default if not specified + )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
prediction_market_agent/agents/think_thoroughly_agent/deploy.py
(1 hunks)prediction_market_agent/agents/think_thoroughly_agent/think_thoroughly_agent.py
(4 hunks)
🔇 Additional comments (4)
prediction_market_agent/agents/think_thoroughly_agent/deploy.py (1)
24-24
: Verify model configuration in base classes.
The removal of the model parameter from agent initialization suggests that model configuration has been moved to the base classes. While this aligns with the PR objective to use gpt-4o, ensure that the model is properly configured in ThinkThoroughlyBase
or its subclasses.
✅ Verification successful
Model configuration is properly handled in base classes
The removal of the model parameter from agent initialization is correct as the model configuration is properly defined in the class hierarchy:
ThinkThoroughlyBase
declares the model attributesThinkThoroughlyWithPredictionProphetResearch
setsmodel_for_generate_prediction_for_one_outcome = "gpt-4o-2024-08-06"
as intended by the PR- The change aligns with the goal of making the prophet agent cheaper while maintaining the architecture
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify model configuration in base classes
# Expected: Find model configuration in ThinkThoroughlyBase or its subclasses
# Search for model configuration in the base classes
rg -A 5 "gpt-4" prediction_market_agent/agents/think_thoroughly_agent/think_thoroughly_agent.py
Length of output: 539
Script:
#!/bin/bash
# Let's verify the class hierarchy and model configuration
ast-grep --pattern 'class $_ {
$$$
model = $_
$$$
}'
Length of output: 60
Script:
#!/bin/bash
# Let's check the class definitions and their inheritance
rg -A 5 "^class.*ThinkThoroughly" prediction_market_agent/agents/think_thoroughly_agent/think_thoroughly_agent.py
Length of output: 817
prediction_market_agent/agents/think_thoroughly_agent/think_thoroughly_agent.py (3)
108-109
: LGTM! Good separation of model configurations.
The addition of separate model attributes for different operations provides flexibility and allows derived classes to optimize their model usage independently.
343-343
: LGTM! Correct model attribute usage.
The method now correctly uses the specialized model attribute for prediction generation, aligning with the PR's objective of optimizing model usage.
378-379
: LGTM! Consistent model usage for research-based agent.
Using the same GPT-4 Turbo model for all operations in this research-based agent is appropriate, as it maintains consistency in the quality of both research and predictions.
model = "gpt-4-turbo-2024-04-09" | ||
model_for_generate_prediction_for_one_outcome = "gpt-4o-2024-08-06" |
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.
💡 Codebase verification
Model version inconsistency detected in codebase
The model version "gpt-4o-2024-08-06" appears to be consistently used across multiple files as a default model, suggesting it's an intentional configuration rather than a typo. However, this model version is dated August 2024, which is beyond the current date. Consider:
- Using the available "gpt-4-turbo-2024-04-09" model which is consistently used in other parts of the codebase
- Updating the model version to match currently available OpenAI models
🔗 Analysis chain
Verify the availability and correctness of the model version.
While using different models for research and predictions aligns with the PR's cost optimization goal, the model version "gpt-4o-2024-08-06" appears to be from a future date. Please verify:
- Is this model currently available?
- Is this the correct version string?
Let's verify the model availability:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for other occurrences of this model version to ensure consistency
rg "gpt-4o-2024-08-06"
# Search for model version patterns to see what other versions are in use
rg -e "gpt-[0-9a-z-]+-[0-9]{4}-[0-9]{2}-[0-9]{2}"
Length of output: 2088
I think we can safely make think thoroughly prophet cheaper, by using gpt 4o on its prophet-research part.
Looking at Dune, gpt-4o prophet agent is among the best:
So if we switch to 4o only in the prophet-research part, it should still be good (if not better).