File size: 1,896 Bytes
20a2a36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e14270b
 
20a2a36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29b829b
13614a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
"""
Entry point script for analyzing images with the forensic agent.
"""

import argparse
import sys
from pathlib import Path

# Add src to path
sys.path.insert(0, str(Path(__file__).parent.parent))

from src.agents import ForensicAgent


def main():
    parser = argparse.ArgumentParser(
        description="Analyze an image using the forensic agent"
    )
    parser.add_argument(
        "--image",
        type=str,
        required=True,
        help="Path to the image file to analyze"
    )
    parser.add_argument(
        "--query",
        type=str,
        default=None,
        help="Optional specific question about the image"
    )
    parser.add_argument(
        "--model",
        type=str,
        default="gpt-5.1",
        help="LLM model to use (default: gpt-5.1)"
    )
    parser.add_argument(
        "--temperature",
        type=float,
        default=0.2,
        help="LLM temperature (default: 0.2)"
    )
    
    args = parser.parse_args()
    
    # Initialize agent
    print(f"Initializing forensic agent with model: {args.model}...")
    agent = ForensicAgent(
        llm_model=args.model,
        temperature=args.temperature
    )
    
    # Analyze image
    print(f"\nAnalyzing image: {args.image}")
    if args.query:
        print(f"Query: {args.query}")
    print("-" * 60)
    
    try:
        result = agent.analyze(args.image, args.query)
        
        print("\n" + "=" * 60)
        print("ANALYSIS RESULTS")
        print("=" * 60)
        print(f"\nConclusion:\n{result['conclusion']}")
        
        if result['tool_usage']:
            print(f"\nTools used: {', '.join(result['tool_usage'])}")
        else:
            print("\nNo tools were used.")
        
        print("\n" + "=" * 60)
        
    except Exception as e:
        print(f"\nError: {e}", file=sys.stderr)
        sys.exit(1)


if __name__ == "__main__":
    main()