File size: 1,282 Bytes
d7291ef
 
 
 
 
 
 
 
 
 
fe5d98f
65933cd
 
d7291ef
186c8e8
d7291ef
 
186c8e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d7291ef
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
from .vlm_service import VLMService, ModelType
from typing import Dict, Any
import asyncio

class StubVLMService(VLMService):
    """Stub VLM service for testing and development"""
    
    def __init__(self):
        super().__init__("STUB_MODEL", ModelType.CUSTOM)
    
    async def generate_caption(self, image_bytes: bytes, prompt: str, metadata_instructions: str = "") -> dict:
        """Generate a stub caption for testing purposes."""
        caption = f"This is a stub caption for testing. Image size: {len(image_bytes)} bytes. Prompt: {prompt[:50]}..."
        
        # Return data in the format expected by schema validator
        return {
            "caption": caption,
            "raw_response": {
                "stub": True,
                "analysis": caption,
                "metadata": {
                    "title": "Stub Generated Title",
                    "source": "OTHER",
                    "type": "OTHER", 
                    "countries": [],
                    "epsg": "OTHER"
                }
            },
            "metadata": {
                "title": "Stub Generated Title",
                "source": "OTHER",
                "type": "OTHER",
                "countries": [],
                "epsg": "OTHER"
            }
        }