/\ ATFGraph /docs
README Downloads
Examples / ATFGraph
Framework reference

This article is retained from the existing framework docs. Self-hosting commands and server-admin access differ from the managed CLI workflow. Start with Get started for the installed product.

Multimodal input

Directory examples/python/features/multimodal

Use five capabilities to try image understanding, speech generation/transcription, image generation and streaming. The media-parity tests cover their request/response handling with fixtures; live providers require their own configuration.

Agent node label media, version 1.0.0.

Capabilities

CapabilityKindSignatureModuleSummary
describetraversal(image_url: str, question: str = 'What is in this image?') -> dictexamples/python/features/multimodal/agent.pyVision: image content part + question, structured answer, usage recorded on the execution.
narratetraversal(text: str, voice: str = 'alloy', model: Optional[str] = None, format: str = 'mp3') -> dictexamples/python/features/multimodal/agent.pyText to speech via the media router; the audio is saved under ATFGRAPH_MEDIA_DIR.
narrate_streamtraversal(text: str) -> dictexamples/python/features/multimodal/agent.pyStreaming text completion: deltas are forwarded as progress notes, the final text is returned.
postertraversal(prompt: str, model: Optional[str] = None, size: str = '1024x1024') -> dictexamples/python/features/multimodal/agent.pyImage generation; inline results are saved, URL results are returned as-is (no implicit download).
transcribetraversal(audio_b64: str, format: str = 'wav', model: Optional[str] = None, language: Optional[str] = None) -> dictexamples/python/features/multimodal/agent.pySpeech to text: inline audio is uploaded as multipart (OpenAI) or a data: URL (fal).

Commands

Taken from this example's own README and module docstrings.

python -m atfgraph.worker --module examples.python.features.multimodal.agent:app
python -m examples.python.features.multimodal.call

Files

  • examples/python/features/multimodal/README.md
  • examples/python/features/multimodal/__init__.py
  • examples/python/features/multimodal/agent.py
  • examples/python/features/multimodal/agentnode.yaml
  • examples/python/features/multimodal/call.py

README

Rendered from examples/python/features/multimodal/README.md; the source file is not modified.

Use five capabilities to try image understanding, speech generation/transcription, image generation and streaming. The media-parity tests cover their request/response handling with fixtures; live providers require their own configuration.

TraversalSurfaceNotes
describe(image_url, question)app.ai(text, Image.from_url(...), schema=Findings)image content part + structured output; Anthropic gets an image block, OpenAI-compatible gets image_url
narrate(text, voice, model, format)app.ai_generate_audiotts-1 default; minimax/speech-*, fal-ai/..., openrouter/... by prefix; inline audio saved under ATFGRAPH_MEDIA_DIR
transcribe(audio_b64, format, model)app.ai_transcribe_audiomultipart upload to /audio/transcriptions (whisper-1), or data: URL to fal-ai/whisper
poster(prompt, model, size)app.ai_generate_imagedall-e-3/gpt-image-1, openrouter/google/..., fal-ai/flux/..., minimax/image-01; URL outputs are never downloaded implicitly
narrate_stream(text)app.ai(..., stream=True)SSE deltas forwarded as app.note progress events

Agent media helpers record usage progress events with per-call data and execution totals; the driver reads them using UsageEvent.from_event. Known cost can come from provider billing fields or a configured price table, labeled by source. Missing prices remain None, and calls_without_price identifies incomplete totals. Provider fields vary, so token/timing data alone does not establish a charge.

python -m atfgraph.worker --module examples.python.features.multimodal.agent:app
python -m examples.python.features.multimodal.call
ATFGraph documentationHosted workflow · Framework reference