-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use get jobs from PMAT #474
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe changes involve a refactoring of the Changes
Possibly related PRs
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: 0
Outside diff range and nitpick comments (2)
prediction_market_agent/agents/microchain_agent/market_functions.py (2)
17-17
: Provide more context on the simplification of the Kelly bet calculation.The
get_kelly_bet
function is replaced withget_kelly_bet_simplified
. While the name suggests a simplification or optimization, it would be helpful to understand:
- What specific changes were made in the
get_kelly_bet_simplified
implementation compared toget_kelly_bet
?- How do these changes impact the correctness and performance of the betting strategy?
- Were there any trade-offs or assumptions made in the simplified version?
Adding comments or a docstring to explain the changes would improve the maintainability of this code.
Line range hint
423-428
: Verify the usage of the hardcoded confidence value.The
get_kelly_bet_simplified
function is called with a hardcodedconfidence
value of 0.5. Based on the comment, this seems to be a temporary placeholder until the actual confidence score is available.Please confirm if this understanding is correct. If so, consider adding a TODO comment to revisit this once the confidence score feature is implemented. This will help track and update this part of the code in the future.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
poetry.lock
is excluded by!**/*.lock
,!**/*.lock
pyproject.toml
is excluded by!**/*.toml
Files selected for processing (3)
- prediction_market_agent/agents/microchain_agent/call_api.py (2 hunks)
- prediction_market_agent/agents/microchain_agent/market_functions.py (2 hunks)
- prediction_market_agent/agents/microchain_agent/prompts.py (4 hunks)
Files skipped from review due to trivial changes (1)
- prediction_market_agent/agents/microchain_agent/prompts.py
Additional comments not posted (4)
prediction_market_agent/agents/microchain_agent/call_api.py (4)
6-7
: LGTM!The import statements for
xDai
andget_jobs
are correctly added.
78-83
: LGTM!The renaming of the class from
GetTasks
toGetJobs
aligns with the updated functionality. The description is clear and concise, explaining the purpose of the class and the required input parameter.
86-88
: LGTM!The changes to the
example_args
method to return a list containing a single integer representing the maximum bond value are consistent with the updated__call__
method signature.
89-91
: LGTM!The changes to the
__call__
method to accept amax_bond
argument and retrieve jobs based on the bond value using theget_jobs
function are well-implemented. Converting the retrieved jobs to a JSON format usingjson.dumps
before returning them is a good practice for easy consumption by the clients.
|
||
def __call__(self, max_bond: xDai) -> str: | ||
jobs = get_jobs(max_bond) | ||
return json.dumps([j.model_dump() for j in jobs], indent=2, default=str) |
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.
🎉
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: 0
Outside diff range and nitpick comments (1)
prediction_market_agent/agents/microchain_agent/microchain_agent.py (1)
124-125
: Changes look good!The conditional block correctly includes the job functions based on the
functions_config.include_job_functions
flag. The job functions are properly extended to the existing list of functions using a list comprehension, and each job function is invoked with the required parameters.Consider adding a brief comment above the conditional block to explain its purpose, such as:
# Include job functions if configured if functions_config.include_job_functions: functions.extend([f(market_type=market_type, keys=keys) for f in JOB_FUNCTIONS])
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
poetry.lock
is excluded by!**/*.lock
,!**/*.lock
pyproject.toml
is excluded by!**/*.toml
Files selected for processing (4)
- prediction_market_agent/agents/microchain_agent/call_api.py (0 hunks)
- prediction_market_agent/agents/microchain_agent/jobs_functions.py (1 hunks)
- prediction_market_agent/agents/microchain_agent/microchain_agent.py (2 hunks)
- prediction_market_agent/agents/microchain_agent/prompts.py (5 hunks)
Files not reviewed due to no reviewable changes (1)
- prediction_market_agent/agents/microchain_agent/call_api.py
Files skipped from review as they are similar to previous changes (1)
- prediction_market_agent/agents/microchain_agent/prompts.py
Additional comments not posted (3)
prediction_market_agent/agents/microchain_agent/jobs_functions.py (2)
12-20
: LGTM!The
JobFunction
class is well-structured and follows object-oriented principles. Thecurrency
property provides a convenient way to access the currency associated with the market type. The implementation looks good.
23-40
: LGTM!The
GetJobs
class is well-structured and provides a convenient way to fetch and process jobs within the prediction market framework. Thedescription
andexample_args
properties provide clear documentation and usage examples. The__call__
method implements the core functionality effectively, and the use ofjson.dumps
ensures well-formatted output. The implementation looks good.prediction_market_agent/agents/microchain_agent/microchain_agent.py (1)
31-31
: LGTM!The import statement for
JOB_FUNCTIONS
is correctly added.
No description provided.