compare • AI Agent SDK

compare: Compare multiple images.

compare

Method

</div>

This is a method of the VisionAgent class in the vision_agent module.

Compare multiple images.

Signature

python
def compare(images: List[str], prompt: Optional[str], detail: Optional[str], model: Optional[str]) -> str

Parameters

ParamField List[str]

List of image URLs or file paths

ParamField Optional[str]

Custom comparison prompt

ParamField Optional[str]

Detail level (low, high, auto)

ParamField Optional[str]

Override model for this call **kwargs: Additional parameters

Returns

ResponseField str

Comparison analysis text

Usage

python
agent = VisionAgent()
    comparison = agent.compare([
        "before.jpg",
        "after.jpg"
    ], prompt="What changed between these images?")

Uses

  • ValueError
  • completion

Source

View on GitHub

praisonaiagents/agent/vision_agent.py at line 300