Skip to content

Commit

Permalink
Merge pull request #54 from polywrap/rename-evo-researcher
Browse files Browse the repository at this point in the history
chore: rename evo_researcher to evo_prophet
  • Loading branch information
namesty authored Mar 13, 2024
2 parents 46afc9e + 2dd4a33 commit 1aaf269
Show file tree
Hide file tree
Showing 40 changed files with 64 additions and 98 deletions.
34 changes: 0 additions & 34 deletions assistants.json

This file was deleted.

File renamed without changes.
10 changes: 5 additions & 5 deletions evo_researcher/app.py → evo_prophet/app.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import os
from typing import cast
from evo_researcher.benchmark.agents import _make_prediction
from evo_researcher.functions.evaluate_question import is_predictable as evaluate_if_predictable
from evo_researcher.functions.research import research
from evo_prophet.benchmark.agents import _make_prediction
from evo_prophet.functions.evaluate_question import is_predictable as evaluate_if_predictable
from evo_prophet.functions.research import research
from prediction_market_agent_tooling.benchmark.utils import (
OutcomePrediction
)
from evo_researcher.utils.logger import BaseLogger
from evo_prophet.utils.logger import BaseLogger
from prediction_market_agent_tooling.tools.utils import secret_str_from_env
from pydantic.types import SecretStr
import streamlit as st
Expand All @@ -31,7 +31,7 @@ def log(self, msg: str) -> None:
st.stop()

st.set_page_config(layout="wide")
st.title("Evo Predict")
st.title("Evo Prophet")

with st.form("question_form", clear_on_submit=True):
question = st.text_input(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
from langchain_openai import OpenAIEmbeddings

from dateutil import parser
from evo_researcher.functions.utils import check_not_none
from evo_prophet.functions.utils import check_not_none
from prediction_market_agent_tooling.tools.utils import secret_str_from_env
from evo_researcher.functions.cache import persistent_inmemory_cache
from evo_researcher.functions.parallelism import par_map
from evo_prophet.functions.cache import persistent_inmemory_cache
from evo_prophet.functions.parallelism import par_map
from pydantic.types import SecretStr
from prediction_market_agent_tooling.gtypes import secretstr_to_v1_secretstr

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
Prediction,
)
from datetime import datetime
from evo_researcher.autonolas.research import EmbeddingModel
from evo_researcher.autonolas.research import make_prediction, get_urls_from_queries
from evo_researcher.autonolas.research import research as research_autonolas
from evo_researcher.functions.evaluate_question import is_predictable
from evo_researcher.functions.rephrase_question import rephrase_question
from evo_researcher.functions.research import research as research_evo
from evo_researcher.functions.search import search
from evo_researcher.functions.utils import url_is_older_than
from evo_researcher.models.WebSearchResult import WebSearchResult
from evo_prophet.autonolas.research import EmbeddingModel
from evo_prophet.autonolas.research import make_prediction, get_urls_from_queries
from evo_prophet.autonolas.research import research as research_autonolas
from evo_prophet.functions.evaluate_question import is_predictable
from evo_prophet.functions.rephrase_question import rephrase_question
from evo_prophet.functions.research import research as research_evo
from evo_prophet.functions.search import search
from evo_prophet.functions.utils import url_is_older_than
from evo_prophet.models.WebSearchResult import WebSearchResult
from unittest.mock import patch
from evo_researcher.functions.search import search
from evo_prophet.functions.search import search
from prediction_market_agent_tooling.benchmark.utils import (
OutcomePrediction,
Prediction,
)
from pydantic.types import SecretStr
from evo_researcher.autonolas.research import Prediction as LLMCompletionPredictionDict
from evo_prophet.autonolas.research import Prediction as LLMCompletionPredictionDict

def _make_prediction(
market_question: str,
Expand Down Expand Up @@ -146,7 +146,7 @@ def side_effect(*args: t.Any, **kwargs: t.Any) -> list[str]:
]
return results_filtered

with patch('evo_researcher.autonolas.research.get_urls_from_queries', side_effect=side_effect, autospec=True):
with patch('evo_prophet.autonolas.research.get_urls_from_queries', side_effect=side_effect, autospec=True):
return self.predict(market_question)


Expand Down Expand Up @@ -206,7 +206,7 @@ def side_effect(*args: t.Any, **kwargs: t.Any) -> list[tuple[str, WebSearchResul
]
return results_filtered

with patch('evo_researcher.functions.research.search', side_effect=side_effect, autospec=True):
with patch('evo_prophet.functions.research.search', side_effect=side_effect, autospec=True):
return self.predict(market_question)

class RephrasingOlasAgent(OlasAgent):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytz
from decimal import Decimal
from datetime import datetime, timedelta
from evo_researcher.benchmark.agents import EvoAgent, OlasAgent, EmbeddingModel
from evo_prophet.benchmark.agents import EvoAgent, OlasAgent, EmbeddingModel
from prediction_market_agent_tooling.benchmark.agents import AbstractBenchmarkedAgent
from prediction_market_agent_tooling.markets.agent_market import AgentMarket
from prediction_market_agent_tooling.markets.manifold.manifold import ManifoldAgentMarket
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
from langchain_openai import OpenAIEmbeddings
from langchain.vectorstores.chroma import Chroma
from evo_researcher.models.WebScrapeResult import WebScrapeResult
from evo_prophet.models.WebScrapeResult import WebScrapeResult
from langchain.text_splitter import RecursiveCharacterTextSplitter
from pydantic.types import SecretStr
from prediction_market_agent_tooling.tools.utils import secret_str_from_env
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import json
import os
from evo_researcher.autonolas.research import clean_completion_json
from evo_prophet.autonolas.research import clean_completion_json
from langchain_openai import ChatOpenAI
from langchain.prompts import ChatPromptTemplate
from evo_researcher.functions.cache import persistent_inmemory_cache
from evo_prophet.functions.cache import persistent_inmemory_cache
from pydantic.types import SecretStr
from prediction_market_agent_tooling.tools.utils import secret_str_from_env
from prediction_market_agent_tooling.gtypes import secretstr_to_v1_secretstr
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from langchain_openai import ChatOpenAI
from langchain.prompts import ChatPromptTemplate
from langchain.schema.output_parser import StrOutputParser
from evo_researcher.functions.cache import persistent_inmemory_cache
from evo_researcher.functions.utils import trim_to_n_tokens
from evo_prophet.functions.cache import persistent_inmemory_cache
from evo_prophet.functions.utils import trim_to_n_tokens
from prediction_market_agent_tooling.tools.utils import secret_str_from_env
from prediction_market_agent_tooling.gtypes import secretstr_to_v1_secretstr
from pydantic.types import SecretStr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import tiktoken
from pydantic import BaseModel
from langchain_openai import ChatOpenAI
from evo_researcher.autonolas.research import clean_completion_json
from evo_prophet.autonolas.research import clean_completion_json
from langchain.prompts import ChatPromptTemplate


Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from evo_researcher.utils.logger import BaseLogger
from evo_prophet.utils.logger import BaseLogger

from langchain.text_splitter import RecursiveCharacterTextSplitter
from evo_researcher.functions.create_embeddings_from_results import create_embeddings_from_results
from evo_researcher.functions.generate_subqueries import generate_subqueries
from evo_researcher.functions.prepare_report import prepare_report, prepare_summary
from evo_researcher.models.WebScrapeResult import WebScrapeResult
from evo_researcher.functions.rerank_subqueries import rerank_subqueries
from evo_researcher.functions.scrape_results import scrape_results
from evo_researcher.functions.search import search
from evo_prophet.functions.create_embeddings_from_results import create_embeddings_from_results
from evo_prophet.functions.generate_subqueries import generate_subqueries
from evo_prophet.functions.prepare_report import prepare_report, prepare_summary
from evo_prophet.models.WebScrapeResult import WebScrapeResult
from evo_prophet.functions.rerank_subqueries import rerank_subqueries
from evo_prophet.functions.scrape_results import scrape_results
from evo_prophet.functions.search import search
from pydantic.types import SecretStr

def research(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from evo_researcher.models.WebScrapeResult import WebScrapeResult
from evo_researcher.functions.web_search import WebSearchResult
from evo_researcher.functions.web_scrape import web_scrape
from evo_researcher.functions.parallelism import par_map
from evo_prophet.models.WebScrapeResult import WebScrapeResult
from evo_prophet.functions.web_search import WebSearchResult
from evo_prophet.functions.web_scrape import web_scrape
from evo_prophet.functions.parallelism import par_map


def scrape_results(results: list[WebSearchResult]) -> list[WebScrapeResult]:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import requests
import typing as t
from evo_researcher.functions.web_search import WebSearchResult, web_search
from evo_prophet.functions.web_search import WebSearchResult, web_search
from concurrent.futures import ThreadPoolExecutor, as_completed
from pydantic.types import SecretStr

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import datetime
from typing import NoReturn, Type, TypeVar, Optional
from googleapiclient.discovery import build
from evo_researcher.functions.cache import persistent_inmemory_cache
from evo_prophet.functions.cache import persistent_inmemory_cache

T = TypeVar("T")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from bs4 import BeautifulSoup
from requests import Response
import tenacity
from evo_researcher.functions.cache import persistent_inmemory_cache
from evo_prophet.functions.cache import persistent_inmemory_cache


@tenacity.retry(stop=tenacity.stop_after_attempt(3), wait=tenacity.wait_fixed(1), reraise=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from pydantic.types import SecretStr

from prediction_market_agent_tooling.tools.utils import secret_str_from_env
from evo_researcher.models.WebSearchResult import WebSearchResult
from evo_researcher.functions.cache import persistent_inmemory_cache
from evo_prophet.models.WebSearchResult import WebSearchResult
from evo_prophet.functions.cache import persistent_inmemory_cache


@tenacity.retry(stop=tenacity.stop_after_attempt(3), wait=tenacity.wait_fixed(1), reraise=True)
Expand Down
4 changes: 2 additions & 2 deletions evo_researcher/main.py → evo_prophet/main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import click
import time
from dotenv import load_dotenv
from evo_researcher.benchmark.agents import _make_prediction
from evo_prophet.benchmark.agents import _make_prediction
from langchain_community.callbacks import get_openai_callback
from evo_researcher.functions.research import research as evo_research
from evo_prophet.functions.research import research as evo_research

load_dotenv()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[mypy]
python_version = 3.10
files = evo_researcher/, scripts/, tests/
files = evo_prophet/, scripts/, tests/
plugins = pydantic.mypy
warn_redundant_casts = True
warn_unused_ignores = True
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "evo_researcher"
name = "evo_prophet"
version = "0.1.10"
description = ""
authors = ["Nestor Amesty <[email protected]>"]
Expand Down Expand Up @@ -38,8 +38,8 @@ langchain-community = "^0.0.21"
mypy = "^1.8.0"

[tool.poetry.scripts]
research= "evo_researcher.main:research"
predict= "evo_researcher.main:predict"
research= "evo_prophet.main:research"
predict= "evo_prophet.main:predict"

[build-system]
requires = ["poetry-core"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/agent_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from enum import Enum
from prediction_market_agent_tooling.benchmark.utils import get_markets, MarketSource
from prediction_market_agent_tooling.benchmark.agents import AbstractBenchmarkedAgent
from evo_researcher.benchmark.agents import AGENTS
from evo_prophet.benchmark.agents import AGENTS

SENTINTEL = object()

Expand Down
6 changes: 3 additions & 3 deletions scripts/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from prediction_market_agent_tooling.benchmark.benchmark import Benchmarker
from prediction_market_agent_tooling.benchmark.utils import MarketSource, get_markets, MarketFilter, MarketSort

from evo_researcher.autonolas.research import EmbeddingModel
from evo_researcher.benchmark.agents import EvoAgent, OlasAgent, QuestionOnlyAgent
from evo_researcher.functions.cache import ENABLE_CACHE
from evo_prophet.autonolas.research import EmbeddingModel
from evo_prophet.benchmark.agents import EvoAgent, OlasAgent, QuestionOnlyAgent
from evo_prophet.functions.cache import ENABLE_CACHE


def main(
Expand Down
4 changes: 2 additions & 2 deletions scripts/compare_manual_scrap_vs_tavily_raw_content.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import streamlit as st
from dotenv import load_dotenv
from evo_researcher.functions.web_search import web_search
from evo_researcher.functions.scrape_results import scrape_results
from evo_prophet.functions.web_search import web_search
from evo_prophet.functions.scrape_results import scrape_results

load_dotenv()
st.set_page_config(layout="wide")
Expand Down
4 changes: 2 additions & 2 deletions scripts/compare_search_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from urllib.parse import urlparse
from collections import defaultdict
from prediction_market_agent_tooling.benchmark.utils import get_markets, MarketSource
from evo_researcher.functions.web_search import web_search
from evo_researcher.autonolas.research import safe_get_urls_from_query
from evo_prophet.functions.web_search import web_search
from evo_prophet.autonolas.research import safe_get_urls_from_query

ENGINES: dict[str, t.Callable[[str, int], list[str]]] = {
"tavily": lambda q, limit: [x.url for x in web_search(q, max_results=limit)],
Expand Down
4 changes: 2 additions & 2 deletions scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from git import Repo
from datetime import datetime
from prediction_market_agent_tooling.markets.markets import MarketType
from evo_researcher.deployment.models import DeployableAgentER, DeployableAgentER_EvoGPT3, DeployableAgentER_OlasEmbeddingOA
from evo_prophet.deployment.models import DeployableAgentER, DeployableAgentER_EvoGPT3, DeployableAgentER_OlasEmbeddingOA
from prediction_market_agent_tooling.config import APIKeys
from prediction_market_agent_tooling.gtypes import private_key_type, DatetimeWithTimezone
from prediction_market_agent_tooling.tools.web3_utils import verify_address
Expand Down Expand Up @@ -40,7 +40,7 @@ def deploy(
chosen_agent_class: t.Type[DeployableAgentER] = [agent for agent in DEPLOYABLE_AGENTS if agent.__name__ == deployable_agent_name][0]

chosen_agent_class().deploy_gcp(
repository=f"git+https://github.com/polywrap/evo.researcher.git@{Repo('.').active_branch.name}",
repository=f"git+https://github.com/polywrap/evo.prophet.git@{Repo('.').active_branch.name}",
market_type=market_type,
api_keys=APIKeys(
BET_FROM_ADDRESS=verify_address(bet_from_address),
Expand Down
4 changes: 2 additions & 2 deletions tests/test_benchmark.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import json

import prediction_market_agent_tooling.benchmark.benchmark as bm
from evo_researcher.autonolas.research import clean_completion_json
from evo_researcher.benchmark.agents import completion_prediction_json_to_pydantic_model
from evo_prophet.autonolas.research import clean_completion_json
from evo_prophet.benchmark.agents import completion_prediction_json_to_pydantic_model


def test_parse_result_str_to_json() -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_evaluate_question.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from evo_researcher.functions.evaluate_question import is_predictable
from evo_prophet.functions.evaluate_question import is_predictable


@pytest.mark.parametrize("question, answerable", [
Expand Down

0 comments on commit 1aaf269

Please sign in to comment.