From cc5c322ec07124fe1a0101f91aecf410b8e05d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20D=2E=20M=C3=BCller?= Date: Tue, 11 Jun 2024 21:43:12 +0200 Subject: [PATCH 1/2] remove redundant line the line removed was redundant - the `source_text` gets already replaced through the f"-string --- src/translation_agent/utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/translation_agent/utils.py b/src/translation_agent/utils.py index 1256281..a7d12c9 100755 --- a/src/translation_agent/utils.py +++ b/src/translation_agent/utils.py @@ -93,9 +93,7 @@ def one_chunk_initial_translation( {target_lang}:""" - prompt = translation_prompt.format(source_text=source_text) - - translation = get_completion(prompt, system_message=system_message) + translation = get_completion(translation_prompt, system_message=system_message) return translation From 9b628feeedd50e684e20e73bc8fedc1b40549d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20D=2E=20M=C3=BCller?= Date: Sat, 6 Jul 2024 12:33:03 +0200 Subject: [PATCH 2/2] Update utils.py --- src/translation_agent/utils.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/translation_agent/utils.py b/src/translation_agent/utils.py index a7d12c9..0a0ddf7 100755 --- a/src/translation_agent/utils.py +++ b/src/translation_agent/utils.py @@ -169,13 +169,7 @@ def one_chunk_reflect_on_translation( Each suggestion should address one specific part of the translation. Output only the suggestions and nothing else.""" - prompt = reflection_prompt.format( - source_lang=source_lang, - target_lang=target_lang, - source_text=source_text, - translation_1=translation_1, - ) - reflection = get_completion(prompt, system_message=system_message) + reflection = get_completion(reflection_prompt, system_message=system_message) return reflection