Add satellite image summarization tool (#7)

* Add dspy & jupyterlab as dependency

* Add image summarizer agent tool

* Add test for summarize tool

* Remove try except

---------

Co-authored-by: Daniel Wiesmann <yellowcap@users.noreply.github.com>
This commit is contained in:
Soumya Ranjan Mohanty
2025-12-04 20:39:10 +05:30
committed by GitHub
parent bcc331bd5e
commit 2d34ee0a16
5 changed files with 2102 additions and 3 deletions
+30
View File
@@ -0,0 +1,30 @@
"""Tests for the satellite image summarization tool."""
import pytest
import uuid
from langchain_core.tools.base import ToolCall
from geo_assistant.tools.summarize import summarize_sat_img
# Sample test data
TEST_IMAGE_URL = "https://petapixel.com/assets/uploads/2022/08/French-Officials-Use-Satellite-Photos-and-AI-to-Spot-Unregistered-Pools-1536x806.jpg"
@pytest.mark.parametrize(
"img_url,summary",
[
(TEST_IMAGE_URL, "building"),
],
)
def test_summarize_sat_img(img_url, summary):
command = summarize_sat_img.invoke(
ToolCall(
name="summarize_sat_img",
type="tool_call",
args={"img_url": img_url},
id=str(uuid.uuid4()),
)
)
print(command.update.get("messages"))
assert summary in command.update.get("messages")[-1].content