Skip to content

The app runs with the settings and the retrieval it documents - #4

Merged
FaustoS88 merged 7 commits into
developfrom
fix/PSE-003-settings-take-effect
Nov 17, 2026
Merged

FaustoS88 merged 7 commits into
developfrom
fix/PSE-003-settings-take-effect

Conversation

@FaustoS88

Copy link
Copy Markdown
Owner

Goal

The settings in .env, in the environment and in the --model presets take effect in every entry point, and the agent retrieves with the configuration the RAGAS evaluations measured.

Changes

  • config.py loads .env itself, so the CLI, the Streamlit UI, interactive.py and db_inspect.py see the settings written there.
  • One placeholder rule, configured_key() in agent.py: an empty key, a template value such as YOUR_OPENAI_API_KEY, or sk-... counts as unset, in the CLI and in the Streamlit key check and sidebar. .env.example ships the OpenAI placeholder the code recognises and leaves OPENROUTER_API_KEY commented out.
  • The Streamlit UI answers through OpenRouter when OPENROUTER_API_KEY is set, as the CLI does.
  • A --model preset brings its own temperature and max tokens to the run.
  • The crawler, db_inspect.py and hybrid_retrieve embed with PINESCRIPT_EMBEDDING_MODEL.
  • The agent retrieves without cross-encoder reranking, the configuration of the Tier 1 and Tier 2 evaluations, where reranking with ms-marco lowered faithfulness on these docs (docs/ragas_tier1_comparison.md). The step stays available in rag_utils.
  • Contextual retrieval is switched on by the crawler's --contextual flag alone; config.py no longer reads PINESCRIPT_CONTEXTUAL_RETRIEVAL.

Tests

  • ruff check . (0.16.1, as in CI) and the offline test suite pass on every commit, on Python 3.11 with pydantic-ai 2.69.0: 109 tests at the tip.
  • New tests: a .env read by config.py in a fresh interpreter; a placeholder OpenRouter key counts as unset; a preset's temperature and max tokens reach agent.run; retrieve calls hybrid_retrieve with enable_rerank=False. tests/conftest.py keeps the developer's .env out of the test process.
  • An offline run of the agent with pydantic-ai's TestModel, retrieval mocked, completes two turns, calls the retrieve tool and returns a PineScriptResult.
  • Not covered: no live model calls and no database. The Streamlit wiring is checked by reading the code, since the UI runs at import.

@FaustoS88 FaustoS88 self-assigned this Nov 17, 2026
@FaustoS88
FaustoS88 merged commit 420e6e1 into develop Nov 17, 2026
2 checks passed
@FaustoS88
FaustoS88 deleted the fix/PSE-003-settings-take-effect branch November 17, 2026 12:53
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.

1 participant