LettreAI Documentation
  • Home
  • User Guide
  • Nutshell
  • Manual
  • Examples
  • API
    • Getting Started
      • AI Task Documentation
      • Installation
      • Quick Start
    • User Guide
      • User Guide
    • Nutshell
      • AI-Task in a Nutshell
    • Manual
      • Core Concepts
      • Configuration
      • Instructions
      • Productions
      • Functions
      • LLM Integration - Claude
    • Examples
      • Basic Examples
      • Advanced Examples
      • Instruction Examples
      • Production Examples
    • Reports
      • AI Task Reports
    • API Reference
      • Pipeline API
      • Engine API
      • Functions API
    • Development
      • Contributing
      • Architecture

    AI Task System Quick Reference

    This document provides a quick reference for common AI Task system commands and workflows.

    Environment Setup

    Always activate the conda environment before using AI Task:

    conda activate lmu

    Set your API key:

    export GEMINI_API_KEY="your-api-key-here"

    Common Commands

    AI Partitur Command

    Run a partitur workflow for a specific profile:

    ai-partitur <partitur_name> <profile_id> [--overwrite]

    Examples:

    # Run the inqua_full partitur for profile 32101
    ai-partitur inqua_full 32101
    
    # Force regeneration of outputs
    ai-partitur inqua_full 32101 --overwrite
    
    # Use a specific partitur file path
    ai-partitur --file /path/to/custom.yml 32101
    
    # Check version
    ai-partitur --version

    YouTube Processing

    Download and transcribe a YouTube video:

    ./transcribe_youtube.sh <production_id> <instruction_file>

    Example:

    ./transcribe_youtube.sh ai_reporter_nepi_00002 ../ai-reporter-nepi/production/instructions/youtube_transcription.ai

    Local Video Processing

    Transcribe a local video file:

    python transcribe_video.py --video <video_path> --output <output_path> --template <template_path>

    Example:

    python transcribe_video.py --video ./video/sample.mp4 --output ./transcription/sample.txt --template ./templates/transcription.j2

    Directory Structure Shortcuts

    Creating Required Directories

    For a new profile with ID 32101:

    mkdir -p profile/profile_32101/{audio,transcription,sequence}

    Moving Files to Standard Locations

    Copy audio file to profile directory:

    cp /path/to/audio.m4a profile/profile_32101/audio/document_32101.m4a

    Standard File Naming Patterns

    • Audio files: document_<id>.m4a
    • Transcriptions: <prefix>_<id>_transcription_<version>.txt
    • Analysis files: <prefix>_<id>_<analysis_type>_<version>.txt
    • Document files: <prefix>_<id>_<document_type>_<version>.docx

    Where: - <prefix>: Project identifier (e.g., INQUA2) - <id>: Profile identifier (e.g., 32101) - <version>: Version number (typically 01)

    Common Workflows

    Complete Audio Processing Workflow

    1. Create profile directories:

      mkdir -p profile/profile_<id>/{audio,transcription,sequence}
    2. Place audio file in profile directory:

      cp /path/to/audio.m4a profile/profile_<id>/audio/document_<id>.m4a
    3. Run partitur to process the audio:

      ai-partitur inqua_full <id>

    Creating a Custom Partitur

    1. Create a YAML file in your partitur directory:

      nano partitur/custom_workflow.yml
    2. Define the partitur structure (see template below)

    3. Run the partitur:

      ai-partitur custom_workflow <id>

    Partitur Template

    Basic partitur template:

    name: custom_workflow
    description: "Custom workflow for audio processing"
    template_dir: "instruction"
    
    pipe:
      # Transcribe audio
      - name: transcribe_audio
        type: llm
        model: gemini-1.5-pro
        tmpl: "transcription_template.j2"
        source-file: "profile/profile_{{id}}/audio/document_{{id}}.m4a"
        result-file: "profile/profile_{{id}}/transcription/output_{{id}}_transcription_01.txt"
        overwrite: true
    
      # Additional steps as needed
      # ...

    Troubleshooting Checklist

    • ✓ Conda environment activated (conda activate lmu)
    • ✓ API key set (export GEMINI_API_KEY="...")
    • ✓ Directories exist and have correct permissions
    • ✓ File naming follows standard patterns
    • ✓ Partitur file is correctly formatted YAML
    • ✓ Templates exist in the specified template directory
    • ✓ Input files exist at the specified paths

    LettreAI Documentation

     
    • Edit this page
    • Report an issue
    • License: MIT