Skip to main content
Generation types define what kind of output your prompt produces. AgentMark supports four types, each suited to 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 from models like DALL-E 3
  • Speech: spoken audio for voice applications and text-to-speech

Choosing the right type

You declare each type with its frontmatter config key (text_config, object_config, image_config, or speech_config) and load it with the matching client method (loadTextPrompt, loadObjectPrompt, loadImagePrompt, loadSpeechPrompt). This page covers text, image, and speech; object generation has its own page for schema validation and $ref reuse.

Text generation

AgentMark generates text with prompts that declare a text_config in frontmatter. Text prompts use message-role tags (<System>, <User>, <Assistant>) and return a string.

Example configuration

example.prompt.mdx
These docs write model_name in the provider-prefixed form, such as openai/gpt-5-mini. The value is a free-form string that AgentMark passes through to your call site unchanged, which is why the Running prompts examples strip the openai/ prefix before constructing the provider model.

Tags

Available configuration

Running a text prompt

See the SDK usage section of Running prompts (under the Local tab) for the text-generation SDK code patterns: render the prompt with prompt.format(), then make your own model call (generateText in TypeScript, the OpenAI client in Python).

Image generation

AgentMark generates images with prompts that declare image_config in frontmatter. The image description itself goes in an <ImagePrompt> tag.

Example configuration

example.prompt.mdx

Tags

Available configuration

Set size for pixel-exact dimensions or aspect_ratio for proportional sizing. AgentMark passes both through to the model unchanged, so provider support varies. If you set both, the provider chooses which to honor.

Running an image prompt

See the SDK usage section of Running prompts (under the Local tab) for the image-generation SDK code pattern using Vercel AI SDK’s experimental_generateImage.

Tracing image generation

AgentMark’s prompt runner (deployed agents and experiments) captures the generated image on the span automatically, and the trace’s Output tab renders it inline. Your own application code has a gap. The Vercel AI SDK’s experimental_generateImage (unlike generateText) emits no OpenTelemetry telemetry, so tracing captures nothing on its own. Instrument the call yourself and set the generated media as the span output:
For the image to render, the output must be (or contain) objects shaped { mimeType, base64 }. The mediaType key also works. A value of any other shape renders as text. The same pattern applies to audio from experimental_generateSpeech. See Tracing setup for initializing the tracer.

Speech generation

AgentMark generates speech audio with prompts that declare speech_config in frontmatter. The text to speak goes in a <SpeechPrompt> tag.

Example configuration

example.prompt.mdx

Tags

Available configuration

The compiled speech_config also carries text (from the <SpeechPrompt> tag) and instructions (from the <System> tag). AgentMark populates both at compile time from the tags; you don’t author them in frontmatter.

Running a speech prompt

See the SDK usage section of Running prompts (under the Local tab) for the speech-generation SDK code pattern using Vercel AI SDK’s experimental_generateSpeech.

Have questions?

Reach out any time: