Predict, ChainOfThought, or ReAct. DSPy automatically compiles and optimizes prompt instructions and few-shot demonstrations against your evaluation metrics.
Setup
Install the DSPy library:Client Configuration
Initialize your language model using thedspy.LM class with the neosantara/<model> prefix.
Basic Modules: Predict and ChainOfThought
ReAct Agent with Tools
Usedspy.ReAct to build autonomous agents that invoke Python tools before synthesizing a final answer.