Skip to content

Processor

Extracts a clean, typed result from a raw LLM provider response.

---
title: Processor
config:
  look: handDrawn
  theme: colorful
  class:
    hideEmptyMembersBox: true
---
classDiagram
    class Processor {
      <<protocol>>
        +process(agent: Prompty, response: unknown) unknown [async-capable]
        +processStream(stream: unknown) unknown [async-capable]
    }

The following helper methods are declared via @method and must be implemented by every runtime. The schema declares the logical protocol contract; each runtime maps async-capable methods to idiomatic sync/async shapes for that language.

NameSignatureRuntime shapeDescription
processprocess(agent: Prompty, response: unknown) -> unknownasync-capableExtract a clean result from a raw LLM response
processStreamprocessStream(stream: unknown) -> unknownasync-capable (optional default)Process a streaming response into a stream of StreamChunk items. Takes raw chunks from the executor and yields processed text, thinking, tool, or error chunks. Not all providers support streaming; the default implementation should signal lack of support.