Quick start to write a script querying a language model
Configure DSPy with a model:
import dspy
dspy.configure(lm=dspy.LM(model="litellm_proxy/anthropic/Claude Opus 5",
api_base="https://api_url/litellm",
api_key="your-key-here"))Analyze a string:
from arsgrammatica import analyze_passage
sentences, results = analyze_passage("Gallia est omnis divisa in partes tres.")Analyze an entire citable corpus from a CEX source file:
from arsgrammatica import analyze_ctsdata
sentences, results = analyze_ctsdata("corpus.cex")See the guides section for examples of how to use results of an analysis.