Skip to content

Conversation

@ArindamRoy23
Copy link
Contributor

@ArindamRoy23 ArindamRoy23 commented Jul 24, 2025

Add render_message function and new prompt templates for recurring themes

  • Introduced a new function render_message in prompts.py to render message templates and validate keys.
  • Added default prompt templates for recurring themes in multiple languages (English, Dutch, German, Spanish, French) to enhance conversation analysis capabilities.
  • Updated tasks.py to utilize the new render_message function for generating messages based on the recurring themes template.

Summary by CodeRabbit

  • New Features
    • Added support for rendering and validating JSON-based prompt templates in multiple languages.
    • Introduced new multilingual templates for analyzing recurring themes and main topics in conversations, with tailored instructions and output guidelines.
  • Chores
    • Configured a dedicated directory for JSON templates.
    • Enhanced prompt generation to utilize the new JSON template system, replacing hardcoded prompts.

…emes

- Introduced a new function `render_message` in prompts.py to render message templates and validate keys.
- Added prompt templates for recurring themes in multiple languages (English, Dutch, German, Spanish, French) to enhance conversation analysis capabilities.
- Updated tasks.py to utilize the new `render_message` function for generating messages based on the recurring themes template.
@linear
Copy link

linear bot commented Jul 24, 2025

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 24, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This change introduces a new JSON-based templating system for prompts, adds language-specific JSON templates for recurring themes, and updates the project library creation logic to use these new templates. The configuration is extended to support a dedicated JSON templates directory, and all hardcoded prompt logic is replaced with dynamic template rendering.

Changes

File(s) Change Summary
echo/server/dembrane/prompts.py Adds JSON template rendering with render_json; supports language fallback, validation, and error handling.
echo/server/dembrane/tasks.py Replaces hardcoded prompt dict with dynamic render_json call for recurring themes view creation.
echo/server/dembrane/config.py Introduces JSON_TEMPLATES_DIR config constant and logs its resolved path.
echo/server/json_templates/default_view_recurring_themes.{en,de,es,fr,nl}.jinja Adds new language-specific JSON Jinja templates for recurring themes user query and context.

Sequence Diagram(s)

sequenceDiagram
    participant Task as task_create_project_library
    participant Prompts as render_json
    participant Config as JSON_TEMPLATES_DIR
    participant Templates as JSON Template Files

    Task->>Prompts: render_json(view_name, lang, ctx, keys)
    Prompts->>Config: Get JSON_TEMPLATES_DIR
    Prompts->>Templates: Load template for view_name.lang.jinja
    alt Template exists
        Prompts->>Prompts: Render with ctx
    else Fallback
        Prompts->>Templates: Load template for view_name.en.jinja
        Prompts->>Prompts: Render with ctx
    end
    Prompts->>Prompts: Parse rendered string as JSON
    Prompts->>Prompts: Validate required keys
    Prompts-->>Task: Return JSON dict (user_query, user_query_context)
    Task->>Task: Use values to create view
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

LGTM.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9009be6 and 64e284c.

📒 Files selected for processing (1)
  • echo/server/dembrane/prompts.py (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/echo-366-update-default-library-generation-prompt-to-recurring-themes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

Hi !

Thank you for contributing to Dembrane ECHO! Before we consider your Pull Request, we ask that you sign our Contributor License Agreement (CLA). This is only required for your first Pull Request.

Please review the CLA, and sign it by adding your GitHub username to the contributors.yml file. Thanks!

@coderabbitai coderabbitai bot added the Feature label Jul 24, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d27afba and 628130a.

📒 Files selected for processing (7)
  • echo/server/dembrane/prompts.py (2 hunks)
  • echo/server/dembrane/tasks.py (2 hunks)
  • echo/server/prompt_templates/default_view_reccuring_themes.de.jinja (1 hunks)
  • echo/server/prompt_templates/default_view_reccuring_themes.en.jinja (1 hunks)
  • echo/server/prompt_templates/default_view_reccuring_themes.es.jinja (1 hunks)
  • echo/server/prompt_templates/default_view_reccuring_themes.fr.jinja (1 hunks)
  • echo/server/prompt_templates/default_view_reccuring_themes.nl.jinja (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
echo/server/prompt_templates/default_view_reccuring_themes.fr.jinja (1)

Learnt from: ussaama
PR: #169
File: echo/frontend/src/locales/fr-FR.po:1880-1882
Timestamp: 2025-05-30T15:37:52.403Z
Learning: In French technical contexts, especially AI/ML domains, English technical terms like "prompt" are commonly adopted and used without translation. This is acceptable and not considered an error.

echo/server/dembrane/prompts.py (2)

Learnt from: ArindamRoy23
PR: #113
File: echo/server/dembrane/postgresdbmanager.py:23-40
Timestamp: 2025-04-18T08:45:19.122Z
Learning: Environment variables in the Echo project are defined and validated in config.py and should be imported from there rather than accessing os.environ directly in other modules. This ensures consistent validation, default values, and logging throughout the application.

Learnt from: ArindamRoy23
PR: #113
File: echo/server/dembrane/postgresdbmanager.py:23-40
Timestamp: 2025-04-18T08:45:19.122Z
Learning: Environment variables in the Echo project are defined and validated in config.py and should be imported from there rather than accessing os.environ directly in other modules. This ensures consistent validation, default values, and logging throughout the application.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: ci-check-server
🔇 Additional comments (6)
echo/server/dembrane/prompts.py (1)

17-19: LGTM on the imports!

Clean addition of json and Optional - exactly what we need for the new JSON parsing functionality.

echo/server/prompt_templates/default_view_reccuring_themes.fr.jinja (1)

1-4: French template is 100x quality

Excellent technical translation that maintains precision across all the dataset processing guidelines. The JSON structure is consistent and the French terminology is appropriate for the AI/ML domain.

echo/server/prompt_templates/default_view_reccuring_themes.nl.jinja (1)

1-4: Dutch template maintains the high standard

Clean Dutch translation that preserves all the technical nuances. The dataset size specifications and quality thresholds are properly localized.

echo/server/prompt_templates/default_view_reccuring_themes.de.jinja (1)

1-4: German template rounds out the multilingual set perfectly

Solid German translation that maintains technical precision. The complete multilingual template set provides excellent coverage for the recurring themes analysis functionality.

echo/server/dembrane/tasks.py (2)

26-26: Clean import of the new render_message function.

LGTM! The import is properly placed and follows the existing import structure. This enables the template-based approach for prompt generation.


617-627: ✅ 100x Verification Complete: render_message Signature Matches Expectations

LGTM on the template-based prompt system—this is rocket-fuel refactoring!

• echo/server/dembrane/prompts.py

  • Defines
    def render_message(
        prompt_name: str,
        language: str,
        kwargs: dict[str, Any],
        keys_to_validate: Optional[list[str]] = None,
    ) -> dict[str, Any]:
    which perfectly accepts your call
    render_message(view_name, language, {}, ["user_query", "user_query_context"])

No further changes needed—approving this stellar refactor! 🚀

- Typo corrected
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 628130a and cb9546a.

📒 Files selected for processing (7)
  • echo/server/dembrane/prompts.py (2 hunks)
  • echo/server/dembrane/tasks.py (2 hunks)
  • echo/server/prompt_templates/default_view_recurring_themes.de.jinja (1 hunks)
  • echo/server/prompt_templates/default_view_recurring_themes.en.jinja (1 hunks)
  • echo/server/prompt_templates/default_view_recurring_themes.es.jinja (1 hunks)
  • echo/server/prompt_templates/default_view_recurring_themes.fr.jinja (1 hunks)
  • echo/server/prompt_templates/default_view_recurring_themes.nl.jinja (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
echo/server/dembrane/prompts.py (2)

Learnt from: ArindamRoy23
PR: #113
File: echo/server/dembrane/postgresdbmanager.py:23-40
Timestamp: 2025-04-18T08:45:19.122Z
Learning: Environment variables in the Echo project are defined and validated in config.py and should be imported from there rather than accessing os.environ directly in other modules. This ensures consistent validation, default values, and logging throughout the application.

Learnt from: ArindamRoy23
PR: #113
File: echo/server/dembrane/postgresdbmanager.py:23-40
Timestamp: 2025-04-18T08:45:19.122Z
Learning: Environment variables in the Echo project are defined and validated in config.py and should be imported from there rather than accessing os.environ directly in other modules. This ensures consistent validation, default values, and logging throughout the application.

echo/server/prompt_templates/default_view_recurring_themes.fr.jinja (1)

Learnt from: ussaama
PR: #169
File: echo/frontend/src/locales/fr-FR.po:1880-1882
Timestamp: 2025-05-30T15:37:52.403Z
Learning: In French technical contexts, especially AI/ML domains, English technical terms like "prompt" are commonly adopted and used without translation. This is acceptable and not considered an error.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: ci-check-server
🔇 Additional comments (8)
echo/server/prompt_templates/default_view_recurring_themes.en.jinja (1)

1-4: LGTM! Solid prompt engineering fundamentals 100x

Clean JSON structure with comprehensive instructions. The output range specifications and quality thresholds show proper prompt engineering - this is how you architect scalable AI workflows.

echo/server/prompt_templates/default_view_recurring_themes.es.jinja (1)

1-4: LGTM! Proper i18n implementation 100x

Spanish localization maintains all the technical precision of the original. Dataset size specs and quality thresholds correctly preserved - this is how you scale AI systems globally.

echo/server/prompt_templates/default_view_recurring_themes.fr.jinja (1)

1-4: LGTM! French localization on point 100x

Excellent translation work - maintains all technical specs while reading naturally in French. The "Seuil de qualité" translation for quality threshold is spot-on for technical documentation.

echo/server/prompt_templates/default_view_recurring_themes.de.jinja (1)

1-4: LGTM! German localization engineered right 100x

Solid technical German translation - "Qualitätsschwelle" and "Verarbeitungsrichtlinien" show proper technical vocabulary. All dataset specs preserved perfectly.

echo/server/dembrane/prompts.py (2)

17-19: LGTM! Clean import additions 100x

Adding json and Optional typing - exactly what you need for the new functionality. No bloat, just the essentials.


92-123: LGTM! Solid function architecture 100x

This render_message function is engineered right - leverages existing render_prompt, adds clean JSON parsing + validation. The error handling approach with logging and the missing_keys validation (lines 116-121) shows you incorporated previous feedback perfectly. This is how you build robust template systems.

echo/server/prompt_templates/default_view_recurring_themes.nl.jinja (1)

1-4: Template looks solid – just ship it.

Keys align with the contract expected by render_message, JSON is valid, Dutch copy is crisp.
LGTM.

echo/server/dembrane/tasks.py (1)

629-636: Empty messages list ⇒ runtime blow-up.

group([]).run() will raise ValueError: need at least one message. Guard for that edge-case so the actor exits gracefully when no view could be prepared.

@ArindamRoy23 ArindamRoy23 enabled auto-merge July 24, 2025 10:21
@ArindamRoy23 ArindamRoy23 requested review from spashii and ussaama July 24, 2025 10:24
Roy added 2 commits July 25, 2025 05:37
- Introduced a new directory for JSON templates and updated the configuration to include `JSON_TEMPLATES_DIR`.
- Refactored the `render_message` function to `render_json`, enabling the rendering of JSON templates for recurring themes.
- Updated relevant imports and function calls in `tasks.py` to utilize the new `render_json` function.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

♻️ Duplicate comments (2)
echo/server/dembrane/tasks.py (1)

614-628: Solid refactor from hardcoded to dynamic templates.

The migration from static dictionary prompts to JSON template rendering is 100x cleaner. Template validation with required keys ensures contract compliance.

However, the render_json call lacks error handling - any template rendering failures will bubble past the existing try/except, leaving status_ctx showing "Successfully created library" even when no views actually get created. Consider wrapping the render_json call in a try/except block to catch template errors and update the status appropriately.

echo/server/dembrane/prompts.py (1)

99-143: render_json function implementation is 100x.

Solid function design with language fallback, JSON parsing with detailed error handling, and key validation. The error messages are actionable and include context.

The key validation fix from past reviews is properly implemented - now shows only missing keys rather than the full validation list, making debugging much cleaner.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cb9546a and 9009be6.

📒 Files selected for processing (8)
  • echo/server/dembrane/config.py (1 hunks)
  • echo/server/dembrane/prompts.py (2 hunks)
  • echo/server/dembrane/tasks.py (2 hunks)
  • echo/server/json_templates/default_view_recurring_themes.de.jinja (1 hunks)
  • echo/server/json_templates/default_view_recurring_themes.en.jinja (1 hunks)
  • echo/server/json_templates/default_view_recurring_themes.es.jinja (1 hunks)
  • echo/server/json_templates/default_view_recurring_themes.fr.jinja (1 hunks)
  • echo/server/json_templates/default_view_recurring_themes.nl.jinja (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: ci-check-server
🔇 Additional comments (5)
echo/server/json_templates/default_view_recurring_themes.en.jinja (1)

1-4: LGTM! Clean template architecture for theme analysis.

This template structure is 100x - well-defined JSON with clear guidance on recurring theme identification. The tiered output expectations (3-7/5-12/8-15 based on dataset size) and quality thresholds show solid product thinking.

echo/server/dembrane/tasks.py (1)

26-26: Import placement is 100x now.

Clean alphabetical grouping with the other local imports. Much better diff-grepping experience.

echo/server/dembrane/prompts.py (3)

17-24: Clean imports and config integration.

Adding json import and JSON_TEMPLATES_DIR config is 100x - proper separation of template types with dedicated directories.


28-31: Dual environment architecture is 100x.

Smart separation of concerns with dedicated Jinja2 environments for prompts vs JSON templates. Clean naming convention (prompt_env/json_env) makes the distinction crystal clear.


38-40: Template discovery pattern consistency.

Using the same os.scandir pattern for JSON templates as the existing prompt templates - excellent consistency in the codebase.

Comment on lines +82 to +84
JSON_TEMPLATES_DIR = os.path.join(BASE_DIR, "json_templates")
logger.debug(f"JSON_TEMPLATES_DIR: {JSON_TEMPLATES_DIR}")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Solid drop-in, but double-check directory existence at boot

JSON_TEMPLATES_DIR is wired exactly like PROMPT_TEMPLATES_DIR—nice symmetry.
Tiny win: proactively os.makedirs(JSON_TEMPLATES_DIR, exist_ok=True) (or Path(...).mkdir) during startup so container images don’t bomb when the folder is missing.

+# Ensure the directory exists to avoid FileNotFoundError in CI / fresh containers
+os.makedirs(JSON_TEMPLATES_DIR, exist_ok=True)
🤖 Prompt for AI Agents
In echo/server/dembrane/config.py around lines 82 to 84, the JSON_TEMPLATES_DIR
is set but the directory existence is not ensured, which can cause runtime
errors if the directory is missing. Add a call to
os.makedirs(JSON_TEMPLATES_DIR, exist_ok=True) right after defining
JSON_TEMPLATES_DIR to create the directory if it does not exist, preventing
errors during container startup.

Comment on lines +1 to +4
{
"user_query": "Geben Sie einen Überblick über die Hauptthemen und wiederkehrenden Themen",
"user_query_context": "Identifizieren Sie wiederkehrende Themen, Themen und Argumente, die konsistent in den Gesprächen auftreten. Analysieren Sie deren Häufigkeit, Intensität und Konsistenz. Erwartete Ausgabe: 3-7 Aspekte für kleine Datensätze, 5-12 für mittlere Datensätze, 8-15 für große Datensätze. Verarbeitungsrichtlinien: Konzentrieren Sie sich auf eindeutige Muster, die in mehreren Gesprächen auftreten. Qualitätsschwelle: Jeder Aspekt muss ein einzigartiges, konsistent auftretendes Thema mit klaren Belegen für Wiederholung darstellen."
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Nit: trim trailing space after closing brace

Tiny whitespace quirk—there’s a " } " with a trailing space. Won’t break JSON, but keeping templates surgically clean avoids diff noise later.

-} 
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"user_query": "Geben Sie einen Überblick über die Hauptthemen und wiederkehrenden Themen",
"user_query_context": "Identifizieren Sie wiederkehrende Themen, Themen und Argumente, die konsistent in den Gesprächen auftreten. Analysieren Sie deren Häufigkeit, Intensität und Konsistenz. Erwartete Ausgabe: 3-7 Aspekte für kleine Datensätze, 5-12 für mittlere Datensätze, 8-15 für große Datensätze. Verarbeitungsrichtlinien: Konzentrieren Sie sich auf eindeutige Muster, die in mehreren Gesprächen auftreten. Qualitätsschwelle: Jeder Aspekt muss ein einzigartiges, konsistent auftretendes Thema mit klaren Belegen für Wiederholung darstellen."
}
{
"user_query": "Geben Sie einen Überblick über die Hauptthemen und wiederkehrenden Themen",
"user_query_context": "Identifizieren Sie wiederkehrende Themen, Themen und Argumente, die konsistent in den Gesprächen auftreten. Analysieren Sie deren Häufigkeit, Intensität und Konsistenz. Erwartete Ausgabe: 3-7 Aspekte für kleine Datensätze, 5-12 für mittlere Datensätze, 8-15 für große Datensätze. Verarbeitungsrichtlinien: Konzentrieren Sie sich auf eindeutige Muster, die in mehreren Gesprächen auftreten. Qualitätsschwelle: Jeder Aspekt muss ein einzigartiges, konsistent auftretendes Thema mit klaren Belegen für Wiederholung darstellen."
}
🤖 Prompt for AI Agents
In echo/server/json_templates/default_view_recurring_themes.de.jinja at lines 1
to 4, remove the trailing space after the closing brace in the JSON object to
keep the template clean and avoid unnecessary diff noise.

Comment on lines +1 to +4
{
"user_query": "Proporcione una visión general de los temas principales y temas recurrentes",
"user_query_context": "Identifique temas recurrentes, tópicos y argumentos que aparecen consistentemente a través de las conversaciones. Analice su frecuencia, intensidad y consistencia. Salida esperada: 3-7 aspectos para conjuntos de datos pequeños, 5-12 para conjuntos de datos medianos, 8-15 para conjuntos de datos grandes. Guía de procesamiento: Enfóquese en patrones distintos que emergen a través de múltiples conversaciones. Umbral de calidad: Cada aspecto debe representar un tema único y consistentemente presente con evidencia clara de recurrencia."
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Final brace whitespace

Ditto—remove the extra space for a squeaky-clean tree.

-} 
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"user_query": "Proporcione una visión general de los temas principales y temas recurrentes",
"user_query_context": "Identifique temas recurrentes, tópicos y argumentos que aparecen consistentemente a través de las conversaciones. Analice su frecuencia, intensidad y consistencia. Salida esperada: 3-7 aspectos para conjuntos de datos pequeños, 5-12 para conjuntos de datos medianos, 8-15 para conjuntos de datos grandes. Guía de procesamiento: Enfóquese en patrones distintos que emergen a través de múltiples conversaciones. Umbral de calidad: Cada aspecto debe representar un tema único y consistentemente presente con evidencia clara de recurrencia."
}
{
"user_query": "Proporcione una visión general de los temas principales y temas recurrentes",
"user_query_context": "Identifique temas recurrentes, tópicos y argumentos que aparecen consistentemente a través de las conversaciones. Analice su frecuencia, intensidad y consistencia. Salida esperada: 3-7 aspectos para conjuntos de datos pequeños, 5-12 para conjuntos de datos medianos, 8-15 para conjuntos de datos grandes. Guía de procesamiento: Enfóquese en patrones distintos que emergen a través de múltiples conversaciones. Umbral de calidad: Cada aspecto debe representar un tema único y consistentemente presente con evidencia clara de recurrencia."
}
🤖 Prompt for AI Agents
In echo/server/json_templates/default_view_recurring_themes.es.jinja at lines 1
to 4, remove the extra space after the closing brace of the JSON object to
ensure there is no trailing whitespace, keeping the file clean and consistent.

Comment on lines +1 to +4
{
"user_query": "Fournissez un aperçu des sujets principaux et des thèmes récurrents",
"user_query_context": "Identifiez les thèmes récurrents, sujets et arguments qui apparaissent de manière cohérente à travers les conversations. Analysez leur fréquence, intensité et cohérence. Sortie attendue : 3-7 aspects pour les petits ensembles de données, 5-12 pour les ensembles moyens, 8-15 pour les grands ensembles. Guidance de traitement : Concentrez-vous sur les modèles distincts qui émergent à travers plusieurs conversations. Seuil de qualité : Chaque aspect doit représenter un thème unique et cohérent avec des preuves claires de récurrence."
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Whitespace déjà-vu

Same trailing space issue as the German template—zap it for consistency.

-} 
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"user_query": "Fournissez un aperçu des sujets principaux et des thèmes récurrents",
"user_query_context": "Identifiez les thèmes récurrents, sujets et arguments qui apparaissent de manière cohérente à travers les conversations. Analysez leur fréquence, intensité et cohérence. Sortie attendue : 3-7 aspects pour les petits ensembles de données, 5-12 pour les ensembles moyens, 8-15 pour les grands ensembles. Guidance de traitement : Concentrez-vous sur les modèles distincts qui émergent à travers plusieurs conversations. Seuil de qualité : Chaque aspect doit représenter un thème unique et cohérent avec des preuves claires de récurrence."
}
{
"user_query": "Fournissez un aperçu des sujets principaux et des thèmes récurrents",
"user_query_context": "Identifiez les thèmes récurrents, sujets et arguments qui apparaissent de manière cohérente à travers les conversations. Analysez leur fréquence, intensité et cohérence. Sortie attendue : 3-7 aspects pour les petits ensembles de données, 5-12 pour les ensembles moyens, 8-15 pour les grands ensembles. Guidance de traitement : Concentrez-vous sur les modèles distincts qui émergent à travers plusieurs conversations. Seuil de qualité : Chaque aspect doit représenter un thème unique et cohérent avec des preuves claires de récurrence."
}
🤖 Prompt for AI Agents
In echo/server/json_templates/default_view_recurring_themes.fr.jinja at lines 1
to 4, remove the trailing space at the end of the JSON content to maintain
consistency with other language templates and avoid whitespace issues.

Comment on lines +1 to +4
{
"user_query": "Geef een overzicht van de hoofdonderwerpen en terugkerende thema's",
"user_query_context": "Identificeer terugkerende thema's, onderwerpen en argumenten die consistent voorkomen in gesprekken. Analyseer hun frequentie, intensiteit en consistentie. Verwachte uitvoer: 3-7 aspecten voor kleine datasets, 5-12 voor middelgrote datasets, 8-15 voor grote datasets. Verwerkingsrichtlijnen: Focus op onderscheidende patronen die opkomen in meerdere gesprekken. Kwaliteitsdrempel: Elk aspect moet een uniek, consistent voorkomend thema vertegenwoordigen met duidelijk bewijs van herhaling."
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Trailing space tidy-up

Nip the space after the closing brace.

-} 
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"user_query": "Geef een overzicht van de hoofdonderwerpen en terugkerende thema's",
"user_query_context": "Identificeer terugkerende thema's, onderwerpen en argumenten die consistent voorkomen in gesprekken. Analyseer hun frequentie, intensiteit en consistentie. Verwachte uitvoer: 3-7 aspecten voor kleine datasets, 5-12 voor middelgrote datasets, 8-15 voor grote datasets. Verwerkingsrichtlijnen: Focus op onderscheidende patronen die opkomen in meerdere gesprekken. Kwaliteitsdrempel: Elk aspect moet een uniek, consistent voorkomend thema vertegenwoordigen met duidelijk bewijs van herhaling."
}
{
"user_query": "Geef een overzicht van de hoofdonderwerpen en terugkerende thema's",
"user_query_context": "Identificeer terugkerende thema's, onderwerpen en argumenten die consistent voorkomen in gesprekken. Analyseer hun frequentie, intensiteit en consistentie. Verwachte uitvoer: 3-7 aspecten voor kleine datasets, 5-12 voor middelgrote datasets, 8-15 voor grote datasets. Verwerkingsrichtlijnen: Focus op onderscheidende patronen die opkomen in meerdere gesprekken. Kwaliteitsdrempel: Elk aspect moet een uniek, consistent voorkomend thema vertegenwoordigen met duidelijk bewijs van herhaling."
}
🤖 Prompt for AI Agents
In echo/server/json_templates/default_view_recurring_themes.nl.jinja at lines 1
to 4, remove the trailing space after the closing brace to tidy up the JSON
template and ensure there is no unnecessary whitespace at the end of the file.

@spashii spashii disabled auto-merge July 25, 2025 09:09
@spashii spashii merged commit 8e0c3c3 into main Jul 25, 2025
9 of 10 checks passed
@spashii spashii deleted the feature/echo-366-update-default-library-generation-prompt-to-recurring-themes branch October 30, 2025 12:02
spashii added a commit that referenced this pull request Nov 18, 2025
…#238)

Add render_message function and new prompt templates for recurring themes

- Introduced a new function render_message in prompts.py to render message templates and validate keys.
- Added default prompt templates for recurring themes in multiple languages (English, Dutch, German, Spanish, French) to enhance conversation analysis capabilities.
- Updated tasks.py to utilize the new render_message function for generating messages based on the recurring themes template.

---
* Add render_message function and new prompt templates for recurring themes

- Introduced a new function `render_message` in prompts.py to render message templates and validate keys.
- Added prompt templates for recurring themes in multiple languages (English, Dutch, German, Spanish, French) to enhance conversation analysis capabilities.
- Updated tasks.py to utilize the new `render_message` function for generating messages based on the recurring themes template.

* - Error handelling improved
- Typo corrected

* Add JSON template support and refactor rendering functions

- Introduced a new directory for JSON templates and updated the configuration to include `JSON_TEMPLATES_DIR`.
- Refactored the `render_message` function to `render_json`, enabling the rendering of JSON templates for recurring themes.
- Updated relevant imports and function calls in `tasks.py` to utilize the new `render_json` function.

* add logging for JSON templates

---------

Co-authored-by: Roy <>
Co-authored-by: Sameer Pashikanti <sameer@dembrane.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants