diff --git a/code_tests/integration_tests/test_asknews.py b/code_tests/integration_tests/test_asknews.py index 91b1e484..a076f084 100644 --- a/code_tests/integration_tests/test_asknews.py +++ b/code_tests/integration_tests/test_asknews.py @@ -40,3 +40,19 @@ async def test_formatted_deep_research() -> None: assert len(news) > 100, "News is too short" assert "" not in news, " is in the final answer" assert "" not in news, " is in the news" + + +async def test_deep_research_accepts_podcasts_source() -> None: + if not os.getenv("ASKNEWS_CLIENT_ID") or not os.getenv("ASKNEWS_SECRET"): + pytest.skip("ASKNEWS_CLIENT_ID or ASKNEWS_SECRET is not set") + response = await AskNewsSearcher().run_deep_research( + "In one sentence, what is the latest news about the US federal funds rate?", + sources=["asknews", "podcasts"], + model="open-source-best", + search_depth=1, + max_depth=1, + ) + content = response.choices[0].message.content + logger.info(f"Deep research with podcasts source: {content}") + assert content is not None, "Content is None" + assert len(content) > 100, "Content is too short" diff --git a/forecasting_tools/helpers/asknews_searcher.py b/forecasting_tools/helpers/asknews_searcher.py index 215517e0..a59a5922 100644 --- a/forecasting_tools/helpers/asknews_searcher.py +++ b/forecasting_tools/helpers/asknews_searcher.py @@ -164,7 +164,7 @@ async def call_preconfigured_version(self, preset: str, prompt: str) -> str: elif "asknews/deep-research/medium-depth" in preset: research = await self.get_formatted_deep_research( prompt, - sources=["asknews", "google", "x", "wiki"], + sources=["asknews", "google", "x", "wiki", "podcasts"], filter_params={"premium": True}, search_depth=2, max_depth=4, @@ -173,7 +173,7 @@ async def call_preconfigured_version(self, preset: str, prompt: str) -> str: elif "asknews/deep-research/high-depth" in preset: research = await self.get_formatted_deep_research( prompt, - sources=["asknews", "google", "x", "wiki"], + sources=["asknews", "google", "x", "wiki", "podcasts"], filter_params={"premium": True}, search_depth=4, max_depth=6, @@ -187,10 +187,7 @@ async def get_formatted_deep_research( self, query: str, sources: list[str] | None = None, - model: ( - Literal["deepseek", "deepseek-basic", "claude-3-7-sonnet-latest", "o3-mini"] - | str - ) = _default_model, + model: DeepNewsModel | str = _default_model, search_depth: int = _default_search_depth, max_depth: int = _default_max_depth, filter_params: dict[str, bool] | None = None, @@ -225,7 +222,7 @@ async def run_deep_research( from asknews_sdk.dto.deepnews import CreateDeepNewsResponse except ImportError: raise ImportError( - "Most recent version of asknews package not installed, deep research will not work. Run `poetry add asknews@0.11.6`" + "Most recent version of asknews package not installed, deep research will not work. Run `poetry add asknews@0.14.2`" ) async with AsyncAskNewsSDK( client_id=self.client_id, diff --git a/poetry.lock b/poetry.lock index f741fa95..c544e59b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -369,13 +369,13 @@ tests = ["mypy (>=1.14.0)", "pytest", "pytest-asyncio"] [[package]] name = "asknews" -version = "0.13.47" +version = "0.14.2" description = "Python SDK for AskNews" optional = false python-versions = ">=3.8" groups = ["main"] files = [ - {file = "asknews-0.13.47-py3-none-any.whl", hash = "sha256:45865459285f75573ce62af11ad40351090448d0b8ccd923a9e62e7a420b9243"}, + {file = "asknews-0.14.2-py3-none-any.whl", hash = "sha256:b73db86f4fae9f2fdfeef879db25cc7a4009ff801fda0c4fb1d91fb932130a1a"}, ] [package.dependencies] @@ -7902,4 +7902,4 @@ source-archive = ["boto3", "cloakbrowser", "firecrawl-py", "playwright", "pymupd [metadata] lock-version = "2.1" python-versions = "^3.11" -content-hash = "d9abd6c9194bdd4769704c8c60f48f438f9d77370b35ee739555d3b9fd3e5e22" +content-hash = "285646db0f1223467d614fd0440be78f7fb72bde6ac4a94652496f4b94921db1" diff --git a/pyproject.toml b/pyproject.toml index c8b322f6..5f3de2c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ faker = ">=37.0.0,<41.0.0" plotly = ">=5.24.1,<7.0.0" pandas = ">=2.2.3,<4.0.0" streamlit = "^1.20.0" -asknews = ">=0.9.1,<0.14.0" +asknews = ">=0.9.1,<0.15.0" unidecode = "^1.4.0" hyperbrowser = ">=0.53.0,<1.0.0" pendulum = "^3.1.0" diff --git a/run_bots.py b/run_bots.py index c4f42ab6..4ca8051d 100644 --- a/run_bots.py +++ b/run_bots.py @@ -505,7 +505,7 @@ def get_default_bot_dict() -> dict[str, RunBotConfig]: # NOSONAR sonnet_4_5_name = "anthropic/claude-sonnet-4-5-20250929" gemini_2_5_pro = "openrouter/google/gemini-2.5-pro" # Used to be gemini-2.5-pro-preview (though automatically switched to regular pro when preview was deprecated) gemini_default_timeout = 5 * 60 - deepnews_model = "asknews/deep-research/high-depth/claude-opus-4-6" # Switched to opus 4.6 Feb 23rd. Switched to high depth Feb 16th 2026. Switched from claude-sonnet-4-20250514 to sonnet 4.5 in Nov 2025. Switched from high to medium depth on Jan 2nd, 2026 + deepnews_model = "asknews/deep-research/high-depth/claude-fable-5" # Switched to claude-fable-5 and added podcasts source Sep 5th 2026. Switched to opus 4.6 Feb 23rd. Switched to high depth Feb 16th 2026. Switched from claude-sonnet-4-20250514 to sonnet 4.5 in Nov 2025. Switched from high to medium depth on Jan 2nd, 2026 roughly_sonnet_4_cost = 0.25190 roughly_gpt_5_high_cost = 0.37868