LettreAI Documentation
  • Home
  • User Guide
  • Nutshell
  • Manual
  • Examples
  • API
  1. Getting Started
  2. Quick Start
  • 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
  1. Getting Started
  2. Quick Start

Quick Start

Quick Start Guide

This guide will help you get started with AI-Task by creating a simple text summarization task.

Create Your First Task

  1. Create a new directory for your task:

    mkdir my_first_task
    cd my_first_task
  2. Create a task file named summarize.ai:

    name: "Text Summarizer"
    description: "Summarizes input text"
    
    pipe:
      - type: "llm"
        tmpl: |
          SYSTEM: You are a helpful AI assistant that summarizes text.
    
          USER: Please summarize this text:
          {{ pipein_text }}
    
          A: Here is the summary:
        model: "claude-3-7-sonnet-latest"
  3. Create a test input file:

    echo "This is a test text that we want to summarize. It contains multiple sentences and demonstrates the basic functionality of the AI-Task package. The package allows us to process text using AI models and create reusable task definitions." > input.txt
  4. Run the task:

    python -m ai_task.task run summarize.ai --input input.txt --output summary.txt
  5. Check the results:

    cat summary.txt

Using Templates

  1. Create a templates directory:

    mkdir templates
  2. Create a template file templates/summarize.j2:

    SYSTEM: You are a helpful AI assistant that summarizes text.
    
    USER: Please summarize this text:
    {{ pipein_text }}
    
    A: Here is the summary:
  3. Update your task file to use the template:

    name: "Text Summarizer"
    description: "Summarizes input text"
    template_dir: "templates"
    
    pipe:
      - type: "llm"
        tmpl: "summarize"
        model: "claude-3-7-sonnet-latest"
  4. Run the task again:

    python -m ai_task.task run summarize.ai --input input.txt --output summary.txt

Adding More Steps

  1. Update your task to include file operations:

    name: "Text Summarizer"
    description: "Summarizes input text"
    template_dir: "templates"
    
    pipe:
      - type: "function"
        function: "aisource"
        params:
          file: "input.txt"
    
      - type: "llm"
        tmpl: "summarize"
        model: "claude-3-7-sonnet-latest"
    
      - type: "function"
        function: "airesult"
        params:
          file: "summary.txt"
  2. Run the task:

    python -m ai_task.task run summarize.ai

Next Steps

Now that you’ve created your first pipeline, you can:

  • Learn about the core concepts of AI Task
  • Explore more complex examples
  • Customize templates for different tasks
  • Create custom functions for your specific needs
  • Check the API Reference for detailed documentation
Installation
User Guide

LettreAI Documentation

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