DSPy

Use DSPy to call a self-hosted server that exposes your DSPy programs. Configure the server URL, authentication, input fields, and context expected by that endpoint.

The block supports Predict, Chain of Thought, and ReAct operations. The behavior of each call depends on the DSPy program and model you deploy; Sim does not host the program for you.

Use the block

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.

Actions

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
↳ thoughtstringThe reasoning thought at this step
↳ toolNamestringThe name of the tool/action called
↳ toolArgsjsonArguments passed to the tool
↳ observationstringThe observation/result from the tool execution
statusstringResponse status from the DSPy server (success or error)
rawOutputjsonThe complete raw output from the DSPy program (result.toDict())