mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
docs(ai): preserve shared schema field documentation
This commit is contained in:
parent
411fe0feae
commit
c9ff40b080
1 changed files with 18 additions and 5 deletions
|
|
@ -17,16 +17,20 @@ export const ModelThinkingLevelSchema = Type.Union([Type.Literal("off"), Thinkin
|
|||
export const TextContentSchema = StrictObject({
|
||||
type: Type.Literal("text"),
|
||||
text: Type.String(),
|
||||
/** Provider message metadata, such as an OpenAI response item identifier. */
|
||||
/** OpenAI response message metadata, as either a legacy identifier or `TextSignatureV1` JSON. */
|
||||
textSignature: Type.Optional(Type.String()),
|
||||
});
|
||||
|
||||
export const ThinkingContentSchema = StrictObject({
|
||||
type: Type.Literal("thinking"),
|
||||
thinking: Type.String(),
|
||||
/** Opaque provider reasoning identifier or encrypted payload used for multi-turn continuity. */
|
||||
/** Provider reasoning item identifier. */
|
||||
thinkingSignature: Type.Optional(Type.String()),
|
||||
/** Whether safety filters redacted the thinking content. */
|
||||
/**
|
||||
* When true, the thinking content was redacted by safety filters. The opaque
|
||||
* encrypted payload is stored in `thinkingSignature` so it can be passed back
|
||||
* to the API for multi-turn continuity.
|
||||
*/
|
||||
redacted: Type.Optional(Type.Boolean()),
|
||||
});
|
||||
|
||||
|
|
@ -34,6 +38,7 @@ export const ImageContentSchema = StrictObject({
|
|||
type: Type.Literal("image"),
|
||||
/** Base64-encoded image data. */
|
||||
data: Type.String(),
|
||||
/** Image media type, for example `image/jpeg` or `image/png`. */
|
||||
mimeType: Type.String({ minLength: 1 }),
|
||||
});
|
||||
|
||||
|
|
@ -51,9 +56,13 @@ export const UsageSchema = StrictObject({
|
|||
output: Type.Integer({ minimum: 0 }),
|
||||
cacheRead: Type.Integer({ minimum: 0 }),
|
||||
cacheWrite: Type.Integer({ minimum: 0 }),
|
||||
/** Subset of cacheWrite written with one-hour retention. */
|
||||
/** Subset of `cacheWrite` written with 1h retention. Only Anthropic reports this split. */
|
||||
cacheWrite1h: Type.Optional(Type.Integer({ minimum: 0 })),
|
||||
/** Provider-reported reasoning tokens, already included in output. */
|
||||
/**
|
||||
* Reasoning/thinking tokens, when the provider reports them. This is a subset of
|
||||
* `output`: `output` already includes these tokens. Set to a number (possibly 0) by
|
||||
* providers that expose a reasoning breakdown; left undefined by providers that don't.
|
||||
*/
|
||||
reasoning: Type.Optional(Type.Integer({ minimum: 0 })),
|
||||
totalTokens: Type.Integer({ minimum: 0 }),
|
||||
cost: StrictObject({
|
||||
|
|
@ -75,8 +84,12 @@ export const StopReasonSchema = Type.Union([
|
|||
]);
|
||||
|
||||
export const ModelCostRatesSchema = StrictObject({
|
||||
/** US dollars per million input tokens. */
|
||||
input: Type.Number({ minimum: 0 }),
|
||||
/** US dollars per million output tokens. */
|
||||
output: Type.Number({ minimum: 0 }),
|
||||
/** US dollars per million cache-read tokens. */
|
||||
cacheRead: Type.Number({ minimum: 0 }),
|
||||
/** US dollars per million cache-write tokens. */
|
||||
cacheWrite: Type.Number({ minimum: 0 }),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue