1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! JSON Schemas the standard library sends to a model or an agent.
//!
//! Two kinds, never mixed. A **schema call** (`llm.call<T>`, `llm.batch<T>`,
//! `agents.run<T>`) sends the schema codegen emits from `T`, carried in the
//! type descriptor (`abi::read_type_argument`), and checks the answer against
//! `T`; [`checked_call`](super::checked_call::checked_call) is the table the
//! typechecker gates those calls by. A **text form** (`llm.text`,
//! `llm.texts`, `agents.runText`) may send a schema the program wrote
//! ([`read_written_schema`]), as written, and never checks the answer.
use ;
/// The most bytes a JSON Schema may have: what one request may carry
/// ([`DEFAULT_MAX_PROMPT_BYTES`](crate::runtime::llm::DEFAULT_MAX_PROMPT_BYTES)).
/// The typechecker refuses a direct call at a type whose schema is larger,
/// and codegen gives such a type no schema.
pub const MAX_SCHEMA_BYTES: usize = crateDEFAULT_MAX_PROMPT_BYTES as usize;
use crateStoreData;
use cratefuel;
use crate;
use crateundefined;
/// The optional `schema?: string` a text form (`llm.text`, `agents.runText`)
/// takes from the program: `None` when omitted, otherwise the text, which
/// must be a JSON Schema object. The host sends it as written and never
/// checks an answer against it, but anything else (a scalar, an array, or
/// the boolean schemas structured-output endpoints do not take) would be
/// dropped or refused on the way to the provider, so it is refused here with
/// a catchable `TypeError`. Parsing it is charged as parsing, since its size
/// is the program's.
pub