Develop#2
Open
oscarcitoz wants to merge 368 commits into
Open
Conversation
add scrapper dropi
add new services dropi
add logic for create context and brand for store
comment variants.
new logic for alibaba and price
elminate render
add logic resolution.
…eaming-images feat(section-html): SDK migration + image pipeline + dynamic prompts
Two minimal, surgical logging additions to SectionImageService._do_generate that close the biggest visibility gaps we've hit during incident investigations. Change 1 — persist Gemini raw text response on success Previously `log_prompt()` received no `response_text`, leaving the `prompt_logs.response_text` column NULL for all 11k+ section_image rows. Any debug of "why did this section turn out weird?" required reproducing the call end-to-end against Gemini (~60s + API cost) to see what the model actually replied. Now we capture the first 10KB of `text_response` right before `del`, and pass it through to `log_prompt`. Change 2 — log every failed Gemini attempt, not only the final outcome Previously the 5-retry loop only logged the final outcome (success, fallback or error). Transient failures like "Gemini no image in response. finishReason: STOP, text: BOTONES:" or "empty parts" lived in stdout only and rotated out of CloudWatch within days. With this change each retry emits its own row with `status=attempt_failed`, its own `attempt_number`, `elapsed_ms`, and the truncated `error_message`, so failure-mode analysis (how often, what pattern, when in bursts) becomes a single SQL query against `prompt_logs`. No existing behavior changes: success/fallback/error paths keep their exact prior semantics. The final error log after fallback-also-fails is preserved as-is. All prior fields of the success log are preserved. Tests 11 new unit tests in test_section_image_logging.py cover: - success path: response_text logged and truncated at 10KB - None/empty text_response is coerced to "" (no crash) - retry path: N attempt_failed rows + 1 final success - gemini-fail + openai-fallback-works: 5 + 1 rows - gemini-fail + openai-fail: 5 + 1 (original error raised) - error_message truncated at 1000 chars - backward-compat: every prior log field still present Full suite: 416 passed, 1 skipped, 0 regressions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
feat(logs): persist AI raw response + log each failed retry attempt
Two minimal, surgical logging additions to SectionImageService._do_generate that close the biggest visibility gaps we've hit during incident investigations. Change 1 — persist Gemini raw text response on success Previously `log_prompt()` received no `response_text`, leaving the `prompt_logs.response_text` column NULL for all 11k+ section_image rows. Any debug of "why did this section turn out weird?" required reproducing the call end-to-end against Gemini (~60s + API cost) to see what the model actually replied. Now we capture the first 10KB of `text_response` right before `del`, and pass it through to `log_prompt`. Change 2 — log every failed Gemini attempt, not only the final outcome Previously the 5-retry loop only logged the final outcome (success, fallback or error). Transient failures like "Gemini no image in response. finishReason: STOP, text: BOTONES:" or "empty parts" lived in stdout only and rotated out of CloudWatch within days. With this change each retry emits its own row with `status=attempt_failed`, its own `attempt_number`, `elapsed_ms`, and the truncated `error_message`, so failure-mode analysis (how often, what pattern, when in bursts) becomes a single SQL query against `prompt_logs`. No existing behavior changes: success/fallback/error paths keep their exact prior semantics. The final error log after fallback-also-fails is preserved as-is. All prior fields of the success log are preserved. Tests 11 new unit tests in test_section_image_logging.py cover: - success path: response_text logged and truncated at 10KB - None/empty text_response is coerced to "" (no crash) - retry path: N attempt_failed rows + 1 final success - gemini-fail + openai-fallback-works: 5 + 1 rows - gemini-fail + openai-fail: 5 + 1 (original error raised) - error_message truncated at 1000 chars - backward-compat: every prior log field still present Full suite: 416 passed, 1 skipped, 0 regressions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…master feat(logs): persist AI raw response + log each failed retry attempt (PROD)
Adds POST /analyze-funnel endpoint that analyzes ad funnel metrics and returns a structured action plan. Ported from the n8n workflow "Identificar constraints y prioridades", using Gemini Flash with structured JSON output. - AnalyzeFunnelRequest/Response DTOs with ad context, raw metrics, rates - Semáforo (traffic-light) classifier with dropshipping_prospecting thresholds for hook_rate, thruplay_rate, ctr, cpc, roas, click_to_purchase - Cerebro Estratégico system prompt ported verbatim from n8n - Uses call_gemini_structured with gemini-flash-latest + responseSchema - Audit logging via log_prompt to prompt_logs - @require_api_key auth (server-to-server call from ecommerce-service) - 28 unit tests covering classifier thresholds and service orchestration Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
feat: add funnel analysis AI agent ("Cerebro Estratégico")
Drop the interactive checklist section from SYSTEM_PROMPT, RESPONSE_SCHEMA, and AnalyzeFunnelResponse. The action_plan list already covers the "what to do" surface; the separate checklist was redundant and drove unnecessary UI complexity (optimistic updates, rollback, PATCH endpoint). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…list refactor: remove today_checklist from funnel analysis agent
# Conflicts: # app/services/section_image_service.py # scripts/seed_ai_prompts.sql
add dropy gt key
Add dropi gt key
Add dropi gt key
cloudfront dropi guatemala
…hema-sync feat: add UGC voiceover director support
…ture-cleanup refactor: add voiceover service interfaces
…evelop-20260526 Merge production hotfixes into develop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.