Skip to main content

What are Generation Types?

Generation types define what kind of output your prompt will produce. AgentMark supports four types of generation, each optimized for different use cases:
  • Text - Natural language responses for chatbots, content generation, and analysis
  • Object - Structured JSON data with schema validation for APIs and data extraction
  • Image - Visual content generation using models like DALL-E
  • Speech - Audio output for voice applications and text-to-speech

Choosing the Right Type

TypeBest ForOutput FormatExample Use Cases
TextConversational AI, content writingStringChatbots, summarization, Q&A
ObjectStructured data extractionJSON with schemaForm parsing, data normalization, API responses
ImageVisual content creationImage fileMarketing assets, illustrations, prototypes
SpeechVoice applicationsAudio filePodcasts, audiobooks, voice assistants

Configuration

Each generation type is configured in the prompt’s frontmatter using specific config keys:
---
name: my-prompt
text_config:        # For text generation
  model_name: gpt-4o
  temperature: 0.7
---
---
name: extract-data
object_config:      # For object generation
  model_name: gpt-4o
  output_schema:
    type: object
    properties:
      name: { type: string }
---
---
name: create-image
image_config:       # For image generation
  model_name: dall-e-3
  size: 1024x1024
---
---
name: text-to-speech
speech_config:      # For speech generation
  model_name: tts-1
  voice: alloy
---

Loading Prompts

Use the appropriate loader method based on your generation type:
// Text generation
const textPrompt = await client.loadTextPrompt('my-prompt');

// Object generation
const objectPrompt = await client.loadObjectPrompt('extract-data');

// Image generation
const imagePrompt = await client.loadImagePrompt('create-image');

// Speech generation
const speechPrompt = await client.loadSpeechPrompt('text-to-speech');

Detailed Guides