mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-15 22:41:28 +00:00
Test metadata context in caption prompts
This commit is contained in:
@@ -21,13 +21,15 @@ class OllamaCaptionerTests(unittest.TestCase):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
image = Path(tmp) / "frame.jpg"
|
||||
image.write_bytes(b"fake-jpeg")
|
||||
result = captioner.caption(image)
|
||||
result = captioner.caption(image, context_hint="Jellyfin tags: beach, holiday")
|
||||
|
||||
self.assertEqual(result, "A person walking down a street.")
|
||||
call = captioner.session.post.call_args
|
||||
payload = call.kwargs["json"]
|
||||
self.assertEqual(payload["model"], "vision-test")
|
||||
self.assertEqual(payload["messages"][0]["role"], "user")
|
||||
self.assertIn("Jellyfin tags: beach, holiday", payload["messages"][0]["content"])
|
||||
self.assertIn("actually visible", payload["messages"][0]["content"])
|
||||
self.assertTrue(payload["messages"][0]["images"][0])
|
||||
self.assertEqual(payload["options"]["temperature"], 0.0)
|
||||
self.assertEqual(payload["options"]["num_predict"], 120)
|
||||
|
||||
Reference in New Issue
Block a user