diff --git a/echo/server/dembrane/api/verify.py b/echo/server/dembrane/api/verify.py index 00ba4d89..1e090b40 100644 --- a/echo/server/dembrane/api/verify.py +++ b/echo/server/dembrane/api/verify.py @@ -878,11 +878,14 @@ async def generate_verification_artifacts( except Exception as exc: logger.warning("Failed to attach audio chunk %s: %s", chunk_id, exc) + project_language = (conversation.get("project_id") or {}).get("language") or "en" + system_prompt = render_prompt( "generate_artifact", "en", { "prompt": target_topic.prompt, + "language": project_language, }, ) @@ -973,6 +976,9 @@ async def update_verification_artifact( reference_conversation_id = body.use_conversation.conversation_id reference_timestamp = body.use_conversation.timestamp + conversation = await _get_conversation_with_project(reference_conversation_id, client) + project_language = (conversation.get("project_id") or {}).get("language") or "en" + chunks = await _get_conversation_chunks(reference_conversation_id, client) conversation_transcript = _build_transcript_text(chunks) @@ -995,6 +1001,7 @@ async def update_verification_artifact( "transcript": conversation_transcript or "No transcript available.", "outcome": artifact.get("content") or "", "feedback": feedback_text or "No textual feedback available.", + "language": project_language, }, ) diff --git a/echo/server/prompt_templates/generate_artifact.en.jinja b/echo/server/prompt_templates/generate_artifact.en.jinja index 96106fce..7d1ce549 100644 --- a/echo/server/prompt_templates/generate_artifact.en.jinja +++ b/echo/server/prompt_templates/generate_artifact.en.jinja @@ -1,6 +1,11 @@ You will receive a conversation transcript (and optionally audio fragments). Turn it into a concrete outcome that captures key decisions or insights. + +Project language: {{ language }} +Your entire response MUST be written in {{ language }}. The participants expect to read the outcome in this language. + Specific Ask: {{ prompt }} + Guidelines: Start with a clear title that reflects what was discussed @@ -8,6 +13,5 @@ Skip preambles—go directly to the outcome Use "we/our" language for collective ownership Be concise but complete enough to stand alone Include context for future readers -Match the transcript's language Acknowledge uncertainty when present Make it feel worth signing—true, not perfect \ No newline at end of file diff --git a/echo/server/prompt_templates/revise_artifact.en.jinja b/echo/server/prompt_templates/revise_artifact.en.jinja index 6d7d9083..ff4e4107 100644 --- a/echo/server/prompt_templates/revise_artifact.en.jinja +++ b/echo/server/prompt_templates/revise_artifact.en.jinja @@ -4,6 +4,9 @@ A conversation transcript An outcome artifact summarizing that conversation Participant feedback on the outcome +Project language: {{ language }} +Your entire response MUST be written in {{ language }}. The participants expect to read the revised outcome in this language. + Transcript: {{ transcript }} Outcome: @@ -19,5 +22,5 @@ Integrate all changes naturally into the main content—don't append meta-commen Address whatever participants need: add missing details, clarify ambiguities, expand on nuances, or correct errors State what something is, not what it isn't (avoid "X is not Y" unless essential) Maintain coherent structure even when adding depth or detail -Match the original language and tone +Maintain the original tone Remove any references to the feedback process itself \ No newline at end of file