dspy-primitives

Installation
SKILL.md

DSPy Primitives

Guide the user through DSPy's built-in primitive types for multimodal inputs, code handling, and conversation history.

What are primitives

Primitives are DSPy's custom types that go beyond plain strings. They let you pass images, audio, code, and conversation history directly into signatures. DSPy handles the formatting, encoding, and adapter logic so the LM receives the data in the right format for its provider.

The four primitives:

Primitive Purpose Typical use case
dspy.Image Images from URLs, files, or bytes Vision tasks, image analysis, multimodal Q&A
dspy.Audio Audio from files, URLs, or arrays Transcription, audio classification
dspy.Code Code with language annotation Code generation, code review, analysis
dspy.History Conversation turns Chatbots, multi-turn dialogue, follow-up questions

dspy.Image

Related skills

More from lebsral/dspy-programming-not-prompting-lms-skills

Installs
5
GitHub Stars
5
First Seen
Mar 17, 2026