Files
photools3/test/test_llm_session_integration.py
mathias2784 401488fa7e
Tests / test_and_lint (push) Successful in 14s
Llm client quality (#14)
Reviewed-on: #14
Co-authored-by: Mathias Scheider <mathias2784@web.de>
2026-10-02 21:31:21 +00:00

28 lines
842 B
Python

import pytest
from photools3.llm_session import LlmSession
@pytest.mark.skipif(
not LlmSession(system_prompt="").is_api_reachable(), reason="API not available"
)
def test_llm_session(llm_session, test_photo):
llm_session.system_prompt = "Return only JSON format: {'text': '...'}"
result = llm_session.call(
prompt="keywords for the attached picture", photos=[test_photo]
)
assert result is not None
@pytest.mark.skipif(
not LlmSession(system_prompt="").is_api_reachable(), reason="API not available"
)
def test_llm_session_captions_and_keywords(
llm_session_captions_and_keywords, test_photo
):
result = llm_session_captions_and_keywords.call(photos=[test_photo])
assert result.caption
assert result.tags
assert isinstance(result.caption, str)
assert isinstance(result.tags, list)