Mandala
Tools

DSPy

Run predictions using self-hosted DSPy programs

Usage Instructions

Integrate with your self-hosted DSPy programs for LLM-powered predictions. Supports Predict, Chain of Thought, and ReAct agents. DSPy is the framework for programming—not prompting—language models.

Tools

dspy_predict

Run a prediction using a self-hosted DSPy program endpoint

Input

ParameterTypeRequiredDescription
baseUrlstringYesBase URL of the DSPy server (e.g., https://your-dspy-server.com\)
apiKeystringNoAPI key for authentication (if required by your server)
endpointstringNoAPI endpoint path (defaults to /predict)
inputstringYesThe input text to send to the DSPy program
inputFieldstringNoName of the input field expected by the DSPy program (defaults to "text")
contextstringNoAdditional context to provide to the DSPy program
additionalInputsjsonNoAdditional key-value pairs to include in the request body

Output

ParameterTypeDescription
answerstringThe main output/answer from the DSPy program
reasoningstringThe reasoning or rationale behind the answer (if available)
statusstringResponse status from the DSPy server (success or error)
rawOutputjsonThe complete raw output from the DSPy program (result.toDict())

dspy_chain_of_thought

Run a Chain of Thought prediction using a self-hosted DSPy ChainOfThought program endpoint

Input

ParameterTypeRequiredDescription
baseUrlstringYesBase URL of the DSPy server (e.g., https://your-dspy-server.com\)
apiKeystringNoAPI key for authentication (if required by your server)
endpointstringNoAPI endpoint path (defaults to /predict)
questionstringYesThe question to answer using chain of thought reasoning
contextstringNoAdditional context to provide for answering the question

Output

ParameterTypeDescription
answerstringThe answer generated through chain of thought reasoning
reasoningstringThe step-by-step reasoning that led to the answer
statusstringResponse status from the DSPy server (success or error)
rawOutputjsonThe complete raw output from the DSPy program (result.toDict())

dspy_react

Run a ReAct agent using a self-hosted DSPy ReAct program endpoint for multi-step reasoning and action

Input

ParameterTypeRequiredDescription
baseUrlstringYesBase URL of the DSPy server (e.g., https://your-dspy-server.com\)
apiKeystringNoAPI key for authentication (if required by your server)
endpointstringNoAPI endpoint path (defaults to /predict)
taskstringYesThe task or question for the ReAct agent to work on
contextstringNoAdditional context to provide for the task
maxIterationsnumberNoMaximum number of reasoning iterations (defaults to server setting)

Output

ParameterTypeDescription
answerstringThe final answer or result from the ReAct agent
reasoningstringThe overall reasoning summary from the agent
trajectoryarrayThe step-by-step trajectory of thoughts, actions, and observations
statusstringResponse status from the DSPy server (success or error)
rawOutputjsonThe complete raw output from the DSPy program (result.toDict())

Notes

  • Category: tools
  • Type: dspy
DSPy