Skip to content
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

Add description to agent market #308

Merged
merged 2 commits into from
Jul 12, 2024
Merged

Add description to agent market #308

merged 2 commits into from
Jul 12, 2024

Conversation

kongzii
Copy link
Contributor

@kongzii kongzii commented Jul 12, 2024

No description provided.

Copy link

coderabbitai bot commented Jul 12, 2024

Walkthrough

The recent changes introduce a description attribute to various classes within the prediction_market_agent_tooling module. This modification affects class declarations, methods, and test files, ensuring that the description attribute is either a str or None. Additionally, some class and function names have been updated for better clarity.

Changes

File Path Change Summary
prediction_market_agent_tooling/markets/agent_market.py Added a description field of type str or None to the AgentMarket class.
prediction_market_agent_tooling/markets/manifold/manifold.py Renamed ManifoldMarket to FullManifoldMarket. Modified method parameters and return statements to include description.
prediction_market_agent_tooling/markets/metaculus/metaculus.py Added a description attribute to the MetaculusAgentMarket class.
prediction_market_agent_tooling/markets/omen/omen.py Added a description attribute to the OmenAgentMarket class.
prediction_market_agent_tooling/markets/polymarket/polymarket.py Updated the from_data_model function in the PolymarketAgentMarket class to include description in its return value.
tests/markets/test_betting_strategies.py Added a description=None parameter to the ManifoldAgentMarket instantiation in test_minimum_bet_to_win_manifold.
tests/test_benchmark.py Added a description=None parameter to the PolymarketAgentMarket constructor in multiple test functions.

Sequence Diagram(s)

No sequence diagrams necessary as the changes are primarily attribute additions and minor renaming across multiple files.


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 24af401 and a783df7.

Files selected for processing (7)
  • prediction_market_agent_tooling/markets/agent_market.py (1 hunks)
  • prediction_market_agent_tooling/markets/manifold/manifold.py (3 hunks)
  • prediction_market_agent_tooling/markets/metaculus/metaculus.py (1 hunks)
  • prediction_market_agent_tooling/markets/omen/omen.py (1 hunks)
  • prediction_market_agent_tooling/markets/polymarket/polymarket.py (1 hunks)
  • tests/markets/test_betting_strategies.py (1 hunks)
  • tests/test_benchmark.py (8 hunks)
Files skipped from review due to trivial changes (1)
  • prediction_market_agent_tooling/markets/omen/omen.py
Additional comments not posted (13)
prediction_market_agent_tooling/markets/polymarket/polymarket.py (1)

34-34: LGTM!

The description attribute is correctly added to the from_data_model method.

prediction_market_agent_tooling/markets/metaculus/metaculus.py (1)

28-30: LGTM!

The description attribute is correctly added to the MetaculusAgentMarket class with a default value of None.

prediction_market_agent_tooling/markets/manifold/manifold.py (1)

21-21: LGTM!

The description attribute is correctly added to the from_data_model method, and the class name references are updated to FullManifoldMarket.

Also applies to: 62-66, 105-105

tests/markets/test_betting_strategies.py (1)

146-146: LGTM!

The description parameter is correctly added to the ManifoldAgentMarket instantiation with a default value of None.

prediction_market_agent_tooling/markets/agent_market.py (1)

50-50: LGTM! The addition of the description attribute is correctly implemented.

The description attribute is added with appropriate type hints.

tests/test_benchmark.py (8)

69-69: LGTM! The addition of the description parameter is correctly implemented.

The description parameter is added with a default value of None to the instantiation of PolymarketAgentMarket.


116-116: LGTM! The addition of the description parameter is correctly implemented.

The description parameter is added with a default value of None to the instantiation of PolymarketAgentMarket.


184-184: LGTM! The addition of the description parameter is correctly implemented.

The description parameter is added with a default value of None to the instantiation of PolymarketAgentMarket.


210-210: LGTM! The addition of the description parameter is correctly implemented.

The description parameter is added with a default value of None to the instantiation of PolymarketAgentMarket.


224-224: LGTM! The addition of the description parameter is correctly implemented.

The description parameter is added with a default value of None to the instantiation of PolymarketAgentMarket.


239-239: LGTM! The addition of the description parameter is correctly implemented.

The description parameter is added with a default value of None to the instantiation of PolymarketAgentMarket.


254-254: LGTM! The addition of the description parameter is correctly implemented.

The description parameter is added with a default value of None to the instantiation of PolymarketAgentMarket.


269-269: LGTM! The addition of the description parameter is correctly implemented.

The description parameter is added with a default value of None to the instantiation of PolymarketAgentMarket.

@@ -25,6 +25,9 @@ class MetaculusAgentMarket(AgentMarket):

have_predicted: bool
base_url: t.ClassVar[str] = METACULUS_API_BASE_URL
description: str | None = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They do have Resolution Criteria and Fine Print, which are similar to manifold descriptions. Could do description = resolution_criteria or description = resolution_criteria + "\n" + fine_print.

Happy if you create an issue for a separate PR though.

e.g. see https://www.metaculus.com/questions/25755/biden-announces-drop-out-before-july-15-2024/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like they aren't available in the MetaculusQuestion model:

@coderabbitai Please create an issue to check out if we can get this extra information from some API.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kongzii, I have created an issue to investigate if we can fetch the resolution criteria and fine print for Metaculus markets from some API. You can track the progress of this issue here: Issue #310.

Analysis chain
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
gh issue create --title "Investigate fetching resolution criteria and fine print for Metaculus markets from API" --body "The current implementation for MetaculusAgentMarket in the PR [#308](https://github.com/gnosis/prediction-market-agent-tooling/pull/308) does not include resolution criteria and fine print as part of the description because they are not available in the MetaculusQuestion model.

Please investigate if it's possible to fetch this additional information (resolution criteria and fine print) from some API endpoint.

For reference, see the discussion in [this comment](https://github.com/gnosis/prediction-market-agent-tooling/pull/308#discussion_r1675603063)." --assignee kongzii

Length of output: 773


Learnings added
Learnt from: kongzii
PR: gnosis/prediction-market-agent-tooling#308
File: prediction_market_agent_tooling/markets/metaculus/metaculus.py:28-28
Timestamp: 2024-07-12T09:59:36.342Z
Learning: When the user requests to create an issue for investigating additional information from an API, include the relevant PR and comment links in the issue description.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah you're right, from a quick look it seems the fields are only available on the question creation and updating endpoints https://www.metaculus.com/api2/schema/redoc/#tag/questions/operation/questions_list

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

@kongzii kongzii merged commit 3cb9487 into main Jul 12, 2024
7 checks passed
@kongzii kongzii deleted the peter/agentmarketdesc branch July 12, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants