Media

Agents can receive images, PDFs, and audio through attachments. Veska prepares the media before the selected provider/model is called.

Basic usage

media.py
from veska import Agent, Audio, Image, PDF

agent = Agent(
    name="assistant",
    model="gpt-4o",
)

result = agent.run(
    "Answer using these files",
    attachments=[
        Image("screenshot.png"),
        PDF("brief.pdf"),
        Audio("voice.mp3"),
    ],
)

Audio rules

Audio is sent only through the provider/model selected on the agent. Veska does not secretly send audio to a different provider for transcription.

audio.py
# Supported by OpenAI audio-capable models
agent = Agent(model="gpt-audio")
agent.run("Transcribe this", attachments=[Audio("voice.wav")])

# If the selected model/provider does not support raw audio,
# Veska returns an error before calling the provider.
agent = Agent(model="claude-sonnet-4-6")
result = agent.run("Transcribe this", attachments=[Audio("voice.mp3")])
print(result.error)

Raw audio from a UI

ui-audio.py
audio_bytes = request.files["audio"].read()

result = agent.run(
    "Handle this voice message",
    attachments=[Audio(content=audio_bytes, format="wav")],
)