dspy-chatadapter

Installation
SKILL.md

dspy.ChatAdapter -- How DSPy Formats Prompts

Step 1: Understand what you need

Before diving into adapter internals, clarify:

  1. Are you debugging a formatting issue? (model ignores format, parse errors, wrong output structure)
  2. Do you need to customize how prompts are built? (system messages, field order, special providers)
  3. Are you generating fine-tuning data? (need OpenAI-compatible message format)
  4. Do you need native function calling or structured output? (provider-specific features)

If you just need to pick the right adapter, start with /dspy-adapters instead -- it covers the decision between ChatAdapter, JSONAdapter, TwoStepAdapter, and XMLAdapter.

What ChatAdapter does

ChatAdapter is the default adapter in DSPy. Every time a module calls an LM, ChatAdapter handles two jobs:

  1. Format: Converts signature + demos + inputs into a list of chat messages (system, user, assistant)
  2. Parse: Extracts output fields from the LM response using [[ ## field_name ## ]] delimiters
Related skills

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

Installs
2
GitHub Stars
5
First Seen
6 days ago