Commit Graph

9 Commits

Author SHA1 Message Date
Arsham Mirehvandi
aec2758714 Enhance advice validation with application date checks
- Updated `advice_guardrails.py` to include a new validation function that rejects recommended application dates outside the range of today through the next five days.
- Modified the documentation in `_output_format.md` to specify the new constraints on `recommended_application_date`.
- Added unit tests in `test_advice_guardrails.py` to verify the new application date validation logic and ensure correct behavior for various scenarios.
2026-10-19 09:30:10 +02:00
Arsham Mirehvandi
d42fe18a52 Refactor advisory generation and update database schema
- Updated `config.yaml` to change the advice storage table from `advice` to `advisories` and adjusted the `thinking_budget` from 11264 to 9216.
- Modified `README.md` to reflect the new `advisories` table in the advisory generation process.
- Refactored SQL queries in `batch.py`, `job.py`, and `advice_context.py` to align with the new table structure.
- Enhanced the advice generation logic in `advice.py` to accommodate changes in the data model, including updates to the JSON structure for advice output.
- Updated relevant functions and documentation to ensure consistency across the codebase regarding the new advisory schema.
2026-09-30 14:43:08 +02:00
Arsham Mirehvandi
ded1ba5fd0 Update treatment interval handling and refine advice generation logic
- Increased `thinking_budget` in `config.yaml` from 9216 to 11264 to enhance LLM performance.
- Clarified conditions for including `last_applied_treatment` in the advice JSON structure, ensuring it is appended even when `allowed_products` is empty.
- Refactored product filtering logic in `products.py` to implement a new function for checking if the treatment interval is open, improving the accuracy of product recommendations.
- Updated unit tests to validate the new treatment interval logic and ensure correct behavior in various scenarios.
2026-09-22 09:57:06 +02:00
Arsham Mirehvandi
86f660cb81 Clarify internal code usage in advisory text
- Updated _output_format.md to specify that `disease_forecast` codes are for internal use only and should not be included in `full_advice` or `advice_summary`.
- Provided Italian translations for specific codes and emphasized the importance of using farmer-friendly language when referring to these phases.
2026-09-11 14:51:14 +02:00
Arsham Mirehvandi
8adab91a69 Clarify phenology phase usage in advisory text
- Updated _output_format.md to specify guidelines for using `phenology_phase` in agronomic reasoning.
- Emphasized the importance of hedging language in Italian and avoiding present-tense certainty in advisory summaries.
2026-09-10 12:26:17 +02:00
Arsham Mirehvandi
d8273b5cd1 Enhance advice context and treatment handling
- Updated README.md to clarify the conditions for including `last_applied_treatment` in the advice JSON structure.
- Modified job.py to pass `as_of` and `field_id` to the advice generation function.
- Enhanced advice_context.py to conditionally add `last_applied_treatment` based on recent treatment history and allowed products.
- Introduced new functions in treatments.py to group treatments by day and load the last treatment before the recent window.
- Updated _output_format.md to specify the conditions under which `last_applied_treatment` is included in the advisory.
2026-09-09 16:00:23 +02:00
Arsham Mirehvandi
8a6d48e5a1 Enhance advice generation and context handling
- Updated README.md to reflect changes in the `json_for_advice_generation` structure, including the addition of `date_of_today` and clarification of `last_advice` fields.
- Modified job.py to load and pass the issuance date of the last advice.
- Enhanced advice_context.py to include the issuance date in the last advice retrieval.
- Updated assemble.py to include `date_of_today` in the JSON assembly for advice generation.
- Improved advice.py to sanitize the `advice_summary` by removing relative date references and ensuring compliance with new guidelines.
2026-09-08 09:40:34 +02:00
Arsham Mirehvandi
1e696405ad Update advice summary guidelines in _output_format.md
- Clarified the requirements for the `advice_summary` field to specify the reasoning for treatment dates in the advisory text.
2026-09-07 09:41:35 +02:00
Arsham Mirehvandi
099d1e0af9 Initial commit 2026-08-22 08:47:56 +02:00