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
| Parameter | Type | Required | Description |
|---|---|---|---|
baseUrl | string | Yes | Base URL of the DSPy server (e.g., https://your-dspy-server.com) |
apiKey | string | No | API key for authentication (if required by your server) |
endpoint | string | No | API endpoint path (defaults to /predict) |
input | string | Yes | The input text to send to the DSPy program |
inputField | string | No | Name of the input field expected by the DSPy program (defaults to "text") |
context | string | No | Additional context to provide to the DSPy program |
additionalInputs | json | No | Additional key-value pairs to include in the request body |
Output
| Parameter | Type | Description |
|---|---|---|
answer | string | The main output/answer from the DSPy program |
reasoning | string | The reasoning or rationale behind the answer (if available) |
status | string | Response status from the DSPy server (success or error) |
rawOutput | json | The 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
| Parameter | Type | Required | Description |
|---|---|---|---|
baseUrl | string | Yes | Base URL of the DSPy server (e.g., https://your-dspy-server.com) |
apiKey | string | No | API key for authentication (if required by your server) |
endpoint | string | No | API endpoint path (defaults to /predict) |
question | string | Yes | The question to answer using chain of thought reasoning |
context | string | No | Additional context to provide for answering the question |
Output
| Parameter | Type | Description |
|---|---|---|
answer | string | The answer generated through chain of thought reasoning |
reasoning | string | The step-by-step reasoning that led to the answer |
status | string | Response status from the DSPy server (success or error) |
rawOutput | json | The 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
| Parameter | Type | Required | Description |
|---|---|---|---|
baseUrl | string | Yes | Base URL of the DSPy server (e.g., https://your-dspy-server.com) |
apiKey | string | No | API key for authentication (if required by your server) |
endpoint | string | No | API endpoint path (defaults to /predict) |
task | string | Yes | The task or question for the ReAct agent to work on |
context | string | No | Additional context to provide for the task |
maxIterations | number | No | Maximum number of reasoning iterations (defaults to server setting) |
Output
| Parameter | Type | Description |
|---|---|---|
answer | string | The final answer or result from the ReAct agent |
reasoning | string | The overall reasoning summary from the agent |
trajectory | array | The step-by-step trajectory of thoughts, actions, and observations |
↳ thought | string | The reasoning thought at this step |
↳ toolName | string | The name of the tool/action called |
↳ toolArgs | json | Arguments passed to the tool |
↳ observation | string | The observation/result from the tool execution |
status | string | Response status from the DSPy server (success or error) |
rawOutput | json | The complete raw output from the DSPy program (result.toDict()) |