dspy-signature-designer

Solid

This skill should be used when the user asks to "create a DSPy signature", "define inputs and outputs", "design a signature", "use InputField or OutputField", "add type hints to DSPy", mentions "signature class", "type-safe DSPy", "Pydantic models in DSPy", or needs to define what a DSPy module should do with structured inputs and outputs.

AI & Automation 78 stars 10 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 90/100

Stars 20%
63
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# DSPy Signature Designer ## Goal Design clear, type-safe signatures that define what your DSPy modules should do. ## When to Use - Defining new DSPy modules - Need structured/validated outputs - Complex input/output relationships - Multi-field responses ## Inputs | Input | Type | Description | |-------|------|-------------| | `task_description` | `str` | What the module should do | | `input_fields` | `list` | Required inputs | | `output_fields` | `list` | Expected outputs | | `type_constraints` | `dict` | Type hints for fields | ## Outputs | Output | Type | Description | |--------|------|-------------| | `signature` | `dspy.Signature` | Type-safe signature class | ## Workflow ### Inline Signatures (Simple) ```python import dspy # Basic qa = dspy.Predict("question -> answer") # With types classify = dspy.Predict("sentence -> sentiment: bool") # Multiple fields rag = dspy.ChainOfThought("context: list[str], question: str -> answer: str") ``` ### Class-based Signatures (Complex) ```python from typing import Literal, Optional import dspy class EmotionClassifier(dspy.Signature): """Classify the emotion expressed in the text.""" text: str = dspy.InputField(desc="The text to analyze") emotion: Literal['joy', 'sadness', 'anger', 'fear', 'surprise'] = dspy.OutputField() confidence: float = dspy.OutputField(desc="Confidence score 0-1") ``` ## Type Hints Reference ```python from typing import Literal, Optional, List from pydantic import BaseModel...

Details

Author
OmidZamani
Repository
OmidZamani/dspy-skills
Created
5 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category