input() describes one input field for the explicit form of
signature(): its name, its type and an optional description.
Arguments
- name
The field name. Callers pass the value under this name, as in
run(mod, review = "...").- type
An ellmer type, one of the labels
"string","number","integer","boolean","array"(an array of strings) or"object", orNULLfor a string.- description
Optional description. Unless the module has its own template, it is written above the value in the prompt, as
# description. With a label orNULLtype, it also becomes the ellmer type's description.- ...
Extra fields stored in the specification.
See also
Other signatures:
has_reasoning(),
signature(),
with_instructions(),
with_reasoning(),
without_reasoning()
Examples
review <- input("review", description = "A customer review")
stars <- input("stars", "integer")
tags <- input("tags", ellmer::type_array(ellmer::type_string()))
# Inputs make up the explicit form of a signature
signature(
inputs = list(review, stars, tags),
output_type = ellmer::type_object(summary = ellmer::type_string())
)
#>
#> ── Signature ──
#>
#> ── Inputs
#> • review: "string" - A customer review
#> • stars: "integer"
#> • tags: "array(string)"
#>
#> ── Output
#> Type: "object(summary: string)"