image_lingo.json


Overview

The image_lingo.json file defines the configuration and DSL (Domain-Specific Language) specification for ImageLingo, a consumer application designed to perform real-time image-based text recognition and multilingual translation. The core functionality of ImageLingo is to allow users to snap photos containing text—such as menus, signs, or documents—and instantly extract, recognize, and translate the text into a target language. It leverages advanced AI-powered OCR (Optical Character Recognition) and translation technology with context-aware adaptations for natural and meaningful translations.

This file primarily serves as a declarative specification describing:


Detailed Explanation

Metadata Section

DSL Section (Core Application Logic)

The DSL models ImageLingo’s workflow using interconnected components. Each component has configurations and parameters governing its behavior.

1. Components

a. Begin Component (begin)

Usage Example:
When the app launches, it greets the user:

"Hi there! I’m ImageLingo, your on-the-go image translation assistant—just snap a photo, and I’ll instantly translate and adapt it into your language."


b. Agent:CoolPandasCrash (Translation Agent with Vision)

Return Values:

Usage Example:
User snaps a photo of a Japanese train schedule. The agent extracts and translates the text:

7:30 AM – 東京駅 (Tokyo Station)
8:15 AM – 新大阪 (Shin-Osaka)

c. Message:CurlyApplesRelate (Message Display)

2. Globals

Defines system-wide variables used during conversation and processing:


3. Graph Structure


Important Implementation Details and Algorithms


Interaction with Other System Components


Visual Diagram

The following Mermaid class diagram represents the structure of the main components and their interactions in the ImageLingo DSL:

classDiagram
    class Begin {
        +enablePrologue: bool
        +prologue: string
        +mode: string
    }
    class Agent {
        +llm_id: string
        +llm_filter: string
        +max_tokens: int
        +max_retries: int
        +max_rounds: int
        +temperature: float
        +frequency_penalty: float
        +presence_penalty: float
        +message_history_window_size: int
        +prompts: list
        +sys_prompt: string
        +visual_files_var: string
        +processImageAndTranslate(sys.files, sys.query)
    }
    class Message {
        +content: string
        +displayTranslatedText()
    }

    Begin --> Agent : passes user query & files
    Agent --> Message : sends translated content

Summary


This documentation should help developers, analysts, and technical writers understand how the ImageLingo app is structured, how the AI agent operates, and how data flows through the system.