DSPy

DSPy é um framework open-source para programar — em vez de apenas fazer prompting — modelos de linguagem. O DSPy permite construir agentes LLM interpretáveis e modulares usando funções Python, módulos estruturados e signatures declarativas, facilitando compor, depurar e implantar aplicações de modelos de linguagem de forma confiável.

Com o DSPy no Zoen, você pode:

  • Executar predições personalizadas: Conecte seu servidor DSPy self-hosted e invoque endpoints de predição para diversas tarefas de linguagem natural.
  • Raciocínio Chain of Thought e ReAct: Aproveite módulos avançados do DSPy para raciocínio passo a passo, diálogos multi-turno e loops de ação-observação.
  • Integrar aos seus fluxos de trabalho: Automatize predições e raciocínio LLM como parte de qualquer automação ou rotina de agente no Zoen.
  • Fornecer endpoints e contexto personalizados: Chame flexivelmente suas próprias APIs powered by DSPy com autenticação, endpoints, campos de entrada e contexto personalizados.

Esses recursos permitem que seus agentes Zoen acessem programas LLM modulares e interpretáveis para tarefas como perguntas e respostas, análise de documentos, suporte à decisão e muito mais — mantendo você no controle do modelo, dos dados e da lógica.

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.

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())

On this page