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

Use PMAT package #28

Merged
merged 5 commits into from
Feb 12, 2024
Merged

Use PMAT package #28

merged 5 commits into from
Feb 12, 2024

Conversation

kongzii
Copy link
Contributor

@kongzii kongzii commented Feb 11, 2024

Summary by CodeRabbit

  • Refactor
    • Updated import paths and method invocations across various modules to reflect new package structure and improve module organization.
  • Bug Fixes
    • Adjusted logic in llama_ai_models.py for handling roles in messages more explicitly.
    • Updated parse_result_to_boolean function to handle lowercase input more accurately.
  • Chores
    • Removed deprecated imports and methods, streamlining the utility functions and class properties for better efficiency and readability.
  • Tests
    • Updated import paths in test modules to align with the new project structure.

Copy link
Contributor

coderabbitai bot commented Feb 11, 2024

Walkthrough

The recent updates involve a significant reorganization of import paths and method invocations across the prediction market agent's codebase. Key changes include transitioning to a new module structure under prediction_market_agent_tooling, updating the way API keys are managed and accessed, and refining the logic in specific functions. This restructure aims to streamline the codebase, enhance maintainability, and adapt to the new package architecture.

Changes

File(s) Change Summary
main.py Updated import paths for the prediction market agent module and changed get_keys() to APIKeys().
prediction_market_agent/__init__.py Removed imports for manifold and omen from the markets module.
prediction_market_agent/agents/...
(abstract.py, always_yes.py, autogen_agent.py, crewai_agent.py, custom_agent.py, langchain_agent.py, llamaindex_agent.py, metagpt_agent.py)
Updated import paths for AgentMarket and replaced get_keys() with APIKeys() in relevant files.
prediction_market_agent/ai_models/llama_ai_models.py
prediction_market_agent/tools/...
(betting_strategies.py, google_search.py)
prediction_market_agent/utils.py
tests/tools/test_betting_strategies.py
Adjusted import paths, reorganized imports to use prediction_market_agent_tooling, and updated logic and method invocations.

🏈🐰 Poem by CodeRabbit 🐰🏈

In the field of green, under the bright light's gleam,

Chiefs and 49ers chase the ultimate dream.

With a hop and a sprint, the ball takes flight,

Rivals in a dance, on Super Bowl night.

🎉 Let's cheer and shout, in this spirited fight,

For in the heart of the game, joy takes its flight. 🏆

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 424b1b4 and 882feb7.
Files ignored due to path filters (6)
  • mypy.ini is excluded by: !**/*.ini
  • poetry.lock is excluded by: !**/*.lock
  • prediction_market_agent/abis/omen_fpmm.abi.json is excluded by: !**/*.json
  • prediction_market_agent/abis/omen_fpmm_conditionaltokens.abi.json is excluded by: !**/*.json
  • prediction_market_agent/abis/wxdai.abi.json is excluded by: !**/*.json
  • pyproject.toml is excluded by: !**/*.toml
Files selected for processing (15)
  • main.py (2 hunks)
  • prediction_market_agent/init.py (1 hunks)
  • prediction_market_agent/agents/abstract.py (1 hunks)
  • prediction_market_agent/agents/always_yes.py (1 hunks)
  • prediction_market_agent/agents/autogen_agent.py (1 hunks)
  • prediction_market_agent/agents/crewai_agent.py (1 hunks)
  • prediction_market_agent/agents/custom_agent.py (3 hunks)
  • prediction_market_agent/agents/langchain_agent.py (1 hunks)
  • prediction_market_agent/agents/llamaindex_agent.py (1 hunks)
  • prediction_market_agent/agents/metagpt_agent.py (1 hunks)
  • prediction_market_agent/ai_models/llama_ai_models.py (2 hunks)
  • prediction_market_agent/tools/betting_strategies.py (1 hunks)
  • prediction_market_agent/tools/google_search.py (1 hunks)
  • prediction_market_agent/utils.py (2 hunks)
  • tests/tools/test_betting_strategies.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • tests/tools/test_betting_strategies.py
Additional comments: 15
prediction_market_agent/__init__.py (1)
  • 1-2: Changes align with the PR objectives of removing specific imports.
prediction_market_agent/agents/always_yes.py (1)
  • 2-2: Correctly updated import path for AgentMarket.
prediction_market_agent/agents/abstract.py (1)
  • 1-1: Correctly updated import path for AgentMarket.
prediction_market_agent/tools/google_search.py (1)
  • 7-7: Correctly updated the method for accessing the API key.
prediction_market_agent/agents/langchain_agent.py (2)
  • 8-8: Correctly updated import path for AgentMarket.
  • 13-13: Correctly updated the method for accessing API keys.
prediction_market_agent/agents/llamaindex_agent.py (1)
  • 9-9: Correctly updated import path for AgentMarket.
prediction_market_agent/utils.py (1)
  • 1-28: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [2-44]

Refactoring and updates in this file align with the PR objectives, enhancing functionality and maintainability.

main.py (2)
  • 5-5: Correctly refactored imports to align with the new package structure.
  • 21-21: Correctly updated the method for accessing API keys.
prediction_market_agent/ai_models/llama_ai_models.py (2)
  • 7-7: Correctly updated import path for should_not_happen.
  • 59-63: Logic adjustment in construct_llama_prompt enhances clarity and functionality.
prediction_market_agent/agents/metagpt_agent.py (1)
  • 7-8: Correctly updated import paths for utility functions and data models.
prediction_market_agent/agents/custom_agent.py (1)
  • 17-21: Correctly reorganized imports to align with the new package structure.
prediction_market_agent/tools/betting_strategies.py (1)
  • 6-23: Correctly reorganized imports and adjusted import paths to align with the new package structure.

@@ -48,7 +51,7 @@ def __init__(self, model: AbstractAiChatModel, max_cycles: int, verbose: bool):

self.verbose = verbose
self.max_cycles = max_cycles
self.keys = utils.get_keys()
self.keys = utils.APIKeys()
Copy link
Contributor

Choose a reason for hiding this comment

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

Usage of utils.APIKeys() should be updated to reflect the new method for accessing API keys.

- self.keys = utils.APIKeys()
+ self.keys = APIKeys()

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
self.keys = utils.APIKeys()
self.keys = APIKeys()

Copy link
Contributor

@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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 882feb7 and 6a25d30.
Files selected for processing (2)
  • prediction_market_agent/agents/autogen_agent.py (1 hunks)
  • prediction_market_agent/agents/langchain_agent.py (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • prediction_market_agent/agents/autogen_agent.py
  • prediction_market_agent/agents/langchain_agent.py

Copy link
Contributor

@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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 6a25d30 and 37d355d.
Files ignored due to path filters (2)
  • poetry.lock is excluded by: !**/*.lock
  • pyproject.toml is excluded by: !**/*.toml
Files selected for processing (1)
  • main.py (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • main.py

@@ -35,6 +35,9 @@ poetry = "^1.7.1"
poetry-plugin-export = "^1.6.0"
functions-framework = "^3.5.0"
cron-validator = "^1.0.8"
# TODO: Change to the correct version once it's released.
prediction-market-agent-tooling = { git = "https://github.com/gnosis/prediction-market-agent-tooling.git", branch = "peter/fix-apikeys" }
Copy link
Contributor

Choose a reason for hiding this comment

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

woooo!

@kongzii kongzii merged commit ba112e6 into main Feb 12, 2024
4 checks passed
@kongzii kongzii deleted the peter/use-pmat branch February 12, 2024 12:43
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