Better Prompt #45

Merged
Simo93-rgb merged 5 commits from 41-better-prompt into main 2025-10-29 15:45:05 +01:00
Simo93-rgb commented 2025-10-24 16:16:17 +02:00 (Migrated from github.com)

Miglioramento prompt LLM idioti

Miglioramento prompt LLM idioti
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-10-29 13:56:29 +01:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull Request Overview

This PR modernizes documentation and improves code clarity by migrating prompt instructions from .txt to .md format and adding comprehensive docstrings to API tools and the plan memory tool. The changes enhance developer experience through better documentation while adding dynamic date injection and new model configurations.

  • Migrated all agent prompt files from .txt to .md format with significantly expanded and structured instructions
  • Added comprehensive docstrings to API tool methods (market_tool.py, news_tool.py, social_tool.py, plan_memory_tool.py)
  • Implemented dynamic {{CURRENT_DATE}} placeholder replacement in prompt loading
  • Added new model options and updated default agent configurations

Reviewed Changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/app/api/tools/social_tool.py Added detailed docstrings explaining provider behavior and aggregation strategies
src/app/api/tools/news_tool.py Added docstrings for headline and news retrieval methods with provider fallback explanations
src/app/api/tools/market_tool.py Added comprehensive docstrings for market data retrieval and aggregation methods
src/app/agents/prompts/team_social.txt Removed (migrated to .md)
src/app/agents/prompts/team_social.md New structured prompt with detailed role, context, and output requirements
src/app/agents/prompts/team_news.txt Removed (migrated to .md)
src/app/agents/prompts/team_news.md New structured prompt with JSON output schemas and error handling
src/app/agents/prompts/team_market.txt Removed (migrated to .md)
src/app/agents/prompts/team_market.md New structured prompt with JSON output formats and mandatory rules
src/app/agents/prompts/team_leader.txt Removed (migrated to .md)
src/app/agents/prompts/team_leader.md New comprehensive prompt with agent output schemas and workflow details
src/app/agents/prompts/report_generation.txt Removed (migrated to .md)
src/app/agents/prompts/report_generation.md New formatting prompt with critical rules and example conditional logic
src/app/agents/prompts/query_check.txt Removed (migrated to .md)
src/app/agents/prompts/query_check.md New classification prompt with clear rules and response messages
src/app/agents/prompts/__init__.py Updated to load .md files and inject current date dynamically
src/app/agents/plan_memory_tool.py Added detailed docstrings for all public methods
docs/Flow_Sequence_Diagrams.md New documentation with Mermaid diagrams for system flows
docs/Docs_Obsolescenza_Report.md New document evaluating existing documentation status
docs/Current_Architecture.md New comprehensive architecture documentation with diagrams
configs.yaml Added new model options and updated default agent model assignments
.gitignore Added chat.json to ignored files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## Pull Request Overview This PR modernizes documentation and improves code clarity by migrating prompt instructions from `.txt` to `.md` format and adding comprehensive docstrings to API tools and the plan memory tool. The changes enhance developer experience through better documentation while adding dynamic date injection and new model configurations. - Migrated all agent prompt files from `.txt` to `.md` format with significantly expanded and structured instructions - Added comprehensive docstrings to API tool methods (`market_tool.py`, `news_tool.py`, `social_tool.py`, `plan_memory_tool.py`) - Implemented dynamic `{{CURRENT_DATE}}` placeholder replacement in prompt loading - Added new model options and updated default agent configurations ### Reviewed Changes Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments. <details> <summary>Show a summary per file</summary> | File | Description | | ---- | ----------- | | `src/app/api/tools/social_tool.py` | Added detailed docstrings explaining provider behavior and aggregation strategies | | `src/app/api/tools/news_tool.py` | Added docstrings for headline and news retrieval methods with provider fallback explanations | | `src/app/api/tools/market_tool.py` | Added comprehensive docstrings for market data retrieval and aggregation methods | | `src/app/agents/prompts/team_social.txt` | Removed (migrated to .md) | | `src/app/agents/prompts/team_social.md` | New structured prompt with detailed role, context, and output requirements | | `src/app/agents/prompts/team_news.txt` | Removed (migrated to .md) | | `src/app/agents/prompts/team_news.md` | New structured prompt with JSON output schemas and error handling | | `src/app/agents/prompts/team_market.txt` | Removed (migrated to .md) | | `src/app/agents/prompts/team_market.md` | New structured prompt with JSON output formats and mandatory rules | | `src/app/agents/prompts/team_leader.txt` | Removed (migrated to .md) | | `src/app/agents/prompts/team_leader.md` | New comprehensive prompt with agent output schemas and workflow details | | `src/app/agents/prompts/report_generation.txt` | Removed (migrated to .md) | | `src/app/agents/prompts/report_generation.md` | New formatting prompt with critical rules and example conditional logic | | `src/app/agents/prompts/query_check.txt` | Removed (migrated to .md) | | `src/app/agents/prompts/query_check.md` | New classification prompt with clear rules and response messages | | `src/app/agents/prompts/__init__.py` | Updated to load .md files and inject current date dynamically | | `src/app/agents/plan_memory_tool.py` | Added detailed docstrings for all public methods | | `docs/Flow_Sequence_Diagrams.md` | New documentation with Mermaid diagrams for system flows | | `docs/Docs_Obsolescenza_Report.md` | New document evaluating existing documentation status | | `docs/Current_Architecture.md` | New comprehensive architecture documentation with diagrams | | `configs.yaml` | Added new model options and updated default agent model assignments | | `.gitignore` | Added chat.json to ignored files | </details> --- 💡 <a href="/Berack96/upo-appAI/new/main/.github?filename=*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
@@ -8,0 +8,4 @@
content = file_path.read_text(encoding='utf-8').strip()
# Replace {{CURRENT_DATE}} placeholder with actual current date
current_date = datetime.now().strftime("%Y-%m-%d")
content = content.replace("{{CURRENT_DATE}}", current_date)
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-29 13:56:29 +01:00

Using datetime.now() without timezone information can lead to inconsistent behavior in different environments. Consider using datetime.now(timezone.utc) to explicitly specify UTC timezone for consistent date handling across deployments.

Using `datetime.now()` without timezone information can lead to inconsistent behavior in different environments. Consider using `datetime.now(timezone.utc)` to explicitly specify UTC timezone for consistent date handling across deployments.
@@ -0,0 +6,4 @@
**CRITICAL DATA PRINCIPLES:**
1. **Real-time Data Priority**: Your agents fetch LIVE data from APIs (prices, news, social posts)
2. **Timestamps Matter**: All data your agents provide is current (as of {{CURRENT\_DATE}})
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-29 13:56:29 +01:00

Escaped underscore in placeholder. Should be {{CURRENT_DATE}} without backslashes.

**CONTEXT:** Current date is {{CURRENT_DATE}}.
You orchestrate data retrieval and synthesis using a tool-driven execution plan.

**CRITICAL DATA PRINCIPLES:**
1.  **Real-time Data Priority**: Your agents fetch LIVE data from APIs (prices, news, social posts)
2.  **Timestamps Matter**: All data your agents provide is current (as of {{CURRENT_DATE}})
Escaped underscore in placeholder. Should be `{{CURRENT_DATE}}` without backslashes. ```suggestion **CONTEXT:** Current date is {{CURRENT_DATE}}. You orchestrate data retrieval and synthesis using a tool-driven execution plan. **CRITICAL DATA PRINCIPLES:** 1. **Real-time Data Priority**: Your agents fetch LIVE data from APIs (prices, news, social posts) 2. **Timestamps Matter**: All data your agents provide is current (as of {{CURRENT_DATE}}) ```
@@ -0,0 +231,4 @@
**CRITICAL REMINDERS:**
1. Data from agents is ALWAYS current (today is {{CURRENT\_DATE}})
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-29 13:56:29 +01:00

Escaped underscore in placeholder. Should be {{CURRENT_DATE}} without backslashes.

Escaped underscore in placeholder. Should be `{{CURRENT_DATE}}` without backslashes.
Berack96 (Migrated from github.com) reviewed 2025-10-29 15:12:56 +01:00
Berack96 (Migrated from github.com) commented 2025-10-29 15:08:36 +01:00

Questo documento non serve

Questo documento non serve
Berack96 (Migrated from github.com) commented 2025-10-29 15:09:13 +01:00

Non so se serve questo documento

Non so se serve questo documento
Berack96 (Migrated from github.com) commented 2025-10-29 15:09:30 +01:00

Questo documento non serve

Questo documento non serve
Berack96 (Migrated from github.com) commented 2025-10-29 15:09:47 +01:00

Non saprei se è utile questo documento

Non saprei se è utile questo documento
filibertomelis-ors (Migrated from github.com) approved these changes 2025-10-29 15:34:37 +01:00
filibertomelis-ors (Migrated from github.com) approved these changes 2025-10-29 15:37:54 +01:00
filibertomelis-ors (Migrated from github.com) approved these changes 2025-10-29 15:43:21 +01:00
trojanhorse47 (Migrated from github.com) approved these changes 2025-10-29 15:45:04 +01:00
Sign in to join this conversation.