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

EvoResearcher Tool: prediction_with_research_report #153

Merged

Conversation

namesty
Copy link
Contributor

@namesty namesty commented Jan 17, 2024

Overview

This PR aims to add a new tool that uses: https://github.com/polywrap/evo.researcher in order to generate a research report which is then injected as additional_information to the already existing prediction prompt from the prediction_sentence_embedding tool.

This has shown to consistently impact the scores of predictions for questions such as: "Will Twitter implement a new misinformation policy before the 2024 elections?", "Will the goal of not surpassing 1.5 degrees Celsius set by the Paris Agreement be reached by 2030?", among others taken from Omen's subgraph. It makes prediction scores more nuanced and information_utility scores higher.

Evo researcher's repo contains the implementation of the research function.

Costs & Time

Average times in seconds (s):

Using gpt-3.5-turbo-1106: 58
Using gpt-4-1106-preview: 120

Average costs in USD ($):

Using gpt-3.5-turbo-1106: 0,0099
Using gpt-4-1106-preview: 0,1012

Notes

  • Sometimes behavior is not consistent when using gpt-3.5-turbo-1106
  • Prediction prompt and generation are untouched - taken directly from prediction_sentence_embedding

#
# ------------------------------------------------------------------------------

"""This module contains the bet amount per threshold strategy."""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update the docstring.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should it be any different? I see it's the same in all tools

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see 😞
Opened #157.

Ideally, it should include a description of the corresponding module. Something like:

Suggested change
"""This module contains the bet amount per threshold strategy."""
"""This module contains the evo researcher tool."""

)

openai_api_key = kwargs["api_keys"]["openai"]
tavily_api_key = kwargs["api_keys"]["tavily"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We currently don't utilize this service. It seems like a good addition, we will take a look.

pyproject.toml Outdated
@@ -61,4 +61,4 @@ pandas = "==2.1.1"
tiktoken = "==0.5.1"
python-dateutil = "==2.8.2"
tomte = {version = "==0.2.15", extras = ["cli", "tests"]}

evo_researcher = "==0.1.8"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The mech specifies ^3.10 for the allowed python versions. But this package (or one of its deps) requires sqlite3>3.35.0, which doesnt come with all ^3.10 versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. This is due to ChromaDB: https://docs.trychroma.com/troubleshooting#sqlite

I went with their second proposed approach (the first being just upgrading to a later Python 3.10 version): https://gist.github.com/defulmere/8b9695e415a44271061cc8e272f3c300

But do let me know if this should be handled differently

@namesty namesty force-pushed the namesty/prediction-with-research-report branch from b197ad5 to 1e4ae61 Compare February 1, 2024 16:44
@0xArdi
Copy link
Collaborator

0xArdi commented Feb 2, 2024

@namesty we are aiming to include this next week on the mech. There are two things required to do that:

  • Deps introduced here should be satisfied in the mech agent.
  • Dynamic pricing of requests is introduced in the mech.

@0xArdi
Copy link
Collaborator

0xArdi commented Feb 15, 2024

Dynamic pricing was added on #166

@namesty
Copy link
Contributor Author

namesty commented Feb 16, 2024

@0xArdi I've updated the deps, added token counting for dynamic pricing as per the other example tools, and re-pinned everything to IPFS

@0xArdi 0xArdi merged commit 6570a7f into valory-xyz:main Feb 16, 2024
@dOrgJelli
Copy link

I believe in this PR there should have been updates to the mech's api_keys, as it adds a new dependency on tavily:

Not sure what needs to be updated though, would appreciate some guidance @0xArdi @Adamantios @kongzii
https://github.com/search?q=repo%3Avalory-xyz%2Fmech%20api_keys&type=code

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.

5 participants