Skip to content

feat: add optional structured market sentiment tool for QueryAgent#662

Open
alexander-schneider wants to merge 2 commits into
666ghj:mainfrom
alexander-schneider:codex/adanos-market-sentiment
Open

feat: add optional structured market sentiment tool for QueryAgent#662
alexander-schneider wants to merge 2 commits into
666ghj:mainfrom
alexander-schneider:codex/adanos-market-sentiment

Conversation

@alexander-schneider

Copy link
Copy Markdown

Summary

This PR adds an optional structured market sentiment research path to QueryAgent.

It includes:

  • an optional search_market_sentiment tool backed by Adanos
  • a small fix so QueryEngine actually preserves search_tool, start_date, and end_date from the LLM output
  • config and UI wiring for an optional ADANOS_API_KEY
  • tests covering prompt toggles, tool selection preservation, fail-open behavior, structured result formatting, and date-range normalization

Why this shape

I kept the integration intentionally narrow:

  • no changes to MindSpider, InsightEngine, or ReportEngine
  • no change to the default public-opinion workflow
  • no requests unless ADANOS_API_KEY is configured

The new tool adapts Adanos stock and market sentiment responses into the existing SearchResult/TavilyResponse shape, so the current summary and report pipeline can reuse it without a separate downstream format.

Notes

  • Without ADANOS_API_KEY, the default behavior is unchanged.
  • The result links point to the public Adanos docs instead of protected API endpoints.
  • The QueryAgent prompt only advertises the structured market sentiment tool when the optional key is configured.

Validation

  • python3 -m pytest tests/test_query_engine_market_sentiment.py -q
  • python3 -m pytest tests/ -q
  • python3 -m py_compile QueryEngine/agent.py QueryEngine/nodes/search_node.py QueryEngine/tools/market_sentiment.py QueryEngine/prompts/prompts.py QueryEngine/utils/config.py app.py config.py
  • git diff --check

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. improvement New feature or request labels Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant