Provide Gemini with the list of IDs in correction request
This commit is contained in:
1 parent
f978310c4c
commit
2d0f7a219f
9 files changed
+242
-9
No files matched your search
@@ -1,10 +1,26 @@
|
||||
import unittest
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
from copienator import prompting
|
||||
|
||||
|
||||
class PromptingTests(unittest.TestCase):
|
||||
def test_live_prompt_includes_only_metadata_ids_in_order(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
image = Path(directory) / "Group_16.jpg"
|
||||
image.write_bytes(b"image")
|
||||
image.with_suffix(".json").write_text(
|
||||
'[["22", 50, 834, 1], ["37", 904, 3250, 1], '
|
||||
'["13", 3320, 4072, 1], ["05", 4142, 4892, 1]]'
|
||||
)
|
||||
contents, _ = prompting.generate_request(directory, image, "I)12)")
|
||||
prompt = contents[0].parts[1].text
|
||||
self.assertIn('["22", "37", "13", "05"]', prompt)
|
||||
self.assertIn("exactement un résultat par identifiant", prompt)
|
||||
self.assertIn("ignore les numéros manuscrits", prompt)
|
||||
|
||||
def test_perspective_is_inserted_with_alternative_method_guidance(self) -> None:
|
||||
with patch.object(
|
||||
prompting, "get_label_text_content", return_value="Question"
|
||||
|
||||
Reference in new issue
Block a user