Imp.Adapter.Types.Code (Imp v0.5.0)

Copy Markdown View Source

Typed source code used by signature-level code inputs and outputs.

new/2 accepts plain or markdown-fenced code and removes the first fenced block's delimiters. The language defaults to "python", matching DSPy's Code type, and can be carried explicitly by a signature field.

Summary

Functions

Language-aware prompt guidance for a signature-level code field.

Returns the plain source text carried by a code value.

Types

t()

@type t() :: %Imp.Adapter.Types.Code{code: String.t(), language: String.t() | nil}

Functions

description(language \\ "python")

Language-aware prompt guidance for a signature-level code field.

format(code)

Returns the plain source text carried by a code value.

new(value, opts \\ [])