@archastro/sdk 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -0
- package/dist/auth.d.ts +143 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +187 -1
- package/dist/auth.js.map +1 -1
- package/dist/channels/api_chat_channel.d.ts +4 -0
- package/dist/channels/api_chat_channel.d.ts.map +1 -1
- package/dist/channels/api_chat_channel.js +9 -1
- package/dist/channels/api_chat_channel.js.map +1 -1
- package/dist/client.d.ts +26 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +27 -1
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/runtime/http-client.d.ts +17 -0
- package/dist/runtime/http-client.d.ts.map +1 -1
- package/dist/runtime/http-client.js +116 -0
- package/dist/runtime/http-client.js.map +1 -1
- package/dist/types/ai.d.ts +421 -14
- package/dist/types/ai.d.ts.map +1 -1
- package/dist/types/ai.js +121 -41
- package/dist/types/ai.js.map +1 -1
- package/dist/types/artifacts.d.ts +81 -24
- package/dist/types/artifacts.d.ts.map +1 -1
- package/dist/types/artifacts.js +39 -21
- package/dist/types/artifacts.js.map +1 -1
- package/dist/types/automations.d.ts +41 -9
- package/dist/types/automations.d.ts.map +1 -1
- package/dist/types/automations.js +25 -17
- package/dist/types/automations.js.map +1 -1
- package/dist/types/chat.d.ts +21560 -0
- package/dist/types/chat.d.ts.map +1 -0
- package/dist/types/chat.js +70 -0
- package/dist/types/chat.js.map +1 -0
- package/dist/types/common.d.ts +17031 -2136
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +1701 -332
- package/dist/types/common.js.map +1 -1
- package/dist/types/config.d.ts +245 -37
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +86 -34
- package/dist/types/config.js.map +1 -1
- package/dist/types/image.d.ts +27 -4
- package/dist/types/image.d.ts.map +1 -1
- package/dist/types/image.js +17 -10
- package/dist/types/image.js.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/invites.d.ts +20 -11
- package/dist/types/invites.d.ts.map +1 -1
- package/dist/types/invites.js +9 -12
- package/dist/types/invites.js.map +1 -1
- package/dist/types/notifications.d.ts +163 -0
- package/dist/types/notifications.d.ts.map +1 -0
- package/dist/types/notifications.js +44 -0
- package/dist/types/notifications.js.map +1 -0
- package/dist/types/teams.d.ts +1640 -231
- package/dist/types/teams.d.ts.map +1 -1
- package/dist/types/teams.js +76 -45
- package/dist/types/teams.js.map +1 -1
- package/dist/types/threads.d.ts +1007 -243
- package/dist/types/threads.d.ts.map +1 -1
- package/dist/types/threads.js +84 -51
- package/dist/types/threads.js.map +1 -1
- package/dist/types/users.d.ts +98 -18
- package/dist/types/users.d.ts.map +1 -1
- package/dist/types/users.js +43 -18
- package/dist/types/users.js.map +1 -1
- package/dist/v1/resources/activity_feed.d.ts +90 -0
- package/dist/v1/resources/activity_feed.d.ts.map +1 -1
- package/dist/v1/resources/activity_feed.js +56 -2
- package/dist/v1/resources/activity_feed.js.map +1 -1
- package/dist/v1/resources/agent_computers.d.ts +48 -2
- package/dist/v1/resources/agent_computers.d.ts.map +1 -1
- package/dist/v1/resources/agent_computers.js +48 -1
- package/dist/v1/resources/agent_computers.js.map +1 -1
- package/dist/v1/resources/agent_env_vars.d.ts +50 -0
- package/dist/v1/resources/agent_env_vars.d.ts.map +1 -0
- package/dist/v1/resources/agent_env_vars.js +56 -0
- package/dist/v1/resources/agent_env_vars.js.map +1 -0
- package/dist/v1/resources/agent_health_actions.d.ts +43 -0
- package/dist/v1/resources/agent_health_actions.d.ts.map +1 -0
- package/dist/v1/resources/agent_health_actions.js +50 -0
- package/dist/v1/resources/agent_health_actions.js.map +1 -0
- package/dist/v1/resources/agent_installations.d.ts +100 -0
- package/dist/v1/resources/agent_installations.d.ts.map +1 -1
- package/dist/v1/resources/agent_installations.js +106 -2
- package/dist/v1/resources/agent_installations.js.map +1 -1
- package/dist/v1/resources/agent_routine_runs.d.ts +33 -0
- package/dist/v1/resources/agent_routine_runs.d.ts.map +1 -0
- package/dist/v1/resources/agent_routine_runs.js +48 -0
- package/dist/v1/resources/agent_routine_runs.js.map +1 -0
- package/dist/v1/resources/agent_routines.d.ts +148 -2
- package/dist/v1/resources/agent_routines.d.ts.map +1 -1
- package/dist/v1/resources/agent_routines.js +168 -3
- package/dist/v1/resources/agent_routines.js.map +1 -1
- package/dist/v1/resources/agent_sessions.d.ts +118 -1
- package/dist/v1/resources/agent_sessions.d.ts.map +1 -1
- package/dist/v1/resources/agent_sessions.js +134 -2
- package/dist/v1/resources/agent_sessions.js.map +1 -1
- package/dist/v1/resources/agent_skills.d.ts +83 -1
- package/dist/v1/resources/agent_skills.d.ts.map +1 -1
- package/dist/v1/resources/agent_skills.js +87 -2
- package/dist/v1/resources/agent_skills.js.map +1 -1
- package/dist/v1/resources/agent_tools.d.ts +109 -2
- package/dist/v1/resources/agent_tools.d.ts.map +1 -1
- package/dist/v1/resources/agent_tools.js +114 -2
- package/dist/v1/resources/agent_tools.js.map +1 -1
- package/dist/v1/resources/agents.d.ts +519 -9
- package/dist/v1/resources/agents.d.ts.map +1 -1
- package/dist/v1/resources/agents.js +516 -12
- package/dist/v1/resources/agents.js.map +1 -1
- package/dist/v1/resources/ai.d.ts +174 -3
- package/dist/v1/resources/ai.d.ts.map +1 -1
- package/dist/v1/resources/ai.js +114 -3
- package/dist/v1/resources/ai.js.map +1 -1
- package/dist/v1/resources/artifacts.d.ts +73 -0
- package/dist/v1/resources/artifacts.d.ts.map +1 -1
- package/dist/v1/resources/artifacts.js +74 -2
- package/dist/v1/resources/artifacts.js.map +1 -1
- package/dist/v1/resources/automation_runs.d.ts +8 -4
- package/dist/v1/resources/automation_runs.d.ts.map +1 -1
- package/dist/v1/resources/automation_runs.js +9 -5
- package/dist/v1/resources/automation_runs.js.map +1 -1
- package/dist/v1/resources/automations.d.ts +20 -0
- package/dist/v1/resources/automations.d.ts.map +1 -1
- package/dist/v1/resources/automations.js +21 -1
- package/dist/v1/resources/automations.js.map +1 -1
- package/dist/v1/resources/bug_reports.d.ts +29 -0
- package/dist/v1/resources/bug_reports.d.ts.map +1 -0
- package/dist/v1/resources/bug_reports.js +29 -0
- package/dist/v1/resources/bug_reports.js.map +1 -0
- package/dist/v1/resources/config.d.ts +437 -4
- package/dist/v1/resources/config.d.ts.map +1 -1
- package/dist/v1/resources/config.js +497 -9
- package/dist/v1/resources/config.js.map +1 -1
- package/dist/v1/resources/custom_objects.d.ts +117 -2
- package/dist/v1/resources/custom_objects.d.ts.map +1 -1
- package/dist/v1/resources/custom_objects.js +132 -3
- package/dist/v1/resources/custom_objects.js.map +1 -1
- package/dist/v1/resources/files.d.ts +62 -0
- package/dist/v1/resources/files.d.ts.map +1 -0
- package/dist/v1/resources/files.js +58 -0
- package/dist/v1/resources/files.js.map +1 -0
- package/dist/v1/resources/index.d.ts +13 -0
- package/dist/v1/resources/index.d.ts.map +1 -1
- package/dist/v1/resources/index.js +14 -1
- package/dist/v1/resources/index.js.map +1 -1
- package/dist/v1/resources/installation_sources.d.ts +12 -0
- package/dist/v1/resources/installation_sources.d.ts.map +1 -1
- package/dist/v1/resources/installation_sources.js +13 -1
- package/dist/v1/resources/installation_sources.js.map +1 -1
- package/dist/v1/resources/invites.d.ts +15 -0
- package/dist/v1/resources/invites.d.ts.map +1 -1
- package/dist/v1/resources/invites.js +16 -1
- package/dist/v1/resources/invites.js.map +1 -1
- package/dist/v1/resources/knowledge_documents.d.ts +104 -0
- package/dist/v1/resources/knowledge_documents.d.ts.map +1 -0
- package/dist/v1/resources/knowledge_documents.js +112 -0
- package/dist/v1/resources/knowledge_documents.js.map +1 -0
- package/dist/v1/resources/knowledge_sources.d.ts +190 -0
- package/dist/v1/resources/knowledge_sources.d.ts.map +1 -0
- package/dist/v1/resources/knowledge_sources.js +176 -0
- package/dist/v1/resources/knowledge_sources.js.map +1 -0
- package/dist/v1/resources/kv.d.ts +73 -0
- package/dist/v1/resources/kv.d.ts.map +1 -1
- package/dist/v1/resources/kv.js +96 -3
- package/dist/v1/resources/kv.js.map +1 -1
- package/dist/v1/resources/notification_preferences.d.ts +61 -0
- package/dist/v1/resources/notification_preferences.d.ts.map +1 -0
- package/dist/v1/resources/notification_preferences.js +65 -0
- package/dist/v1/resources/notification_preferences.js.map +1 -0
- package/dist/v1/resources/notifications.d.ts +133 -0
- package/dist/v1/resources/notifications.d.ts.map +1 -0
- package/dist/v1/resources/notifications.js +136 -0
- package/dist/v1/resources/notifications.js.map +1 -0
- package/dist/v1/resources/orgs.d.ts +18 -0
- package/dist/v1/resources/orgs.d.ts.map +1 -1
- package/dist/v1/resources/orgs.js +30 -2
- package/dist/v1/resources/orgs.js.map +1 -1
- package/dist/v1/resources/slack_channel_bindings.d.ts +101 -0
- package/dist/v1/resources/slack_channel_bindings.d.ts.map +1 -0
- package/dist/v1/resources/slack_channel_bindings.js +114 -0
- package/dist/v1/resources/slack_channel_bindings.js.map +1 -0
- package/dist/v1/resources/solution_categories.d.ts +36 -0
- package/dist/v1/resources/solution_categories.d.ts.map +1 -0
- package/dist/v1/resources/solution_categories.js +55 -0
- package/dist/v1/resources/solution_categories.js.map +1 -0
- package/dist/v1/resources/solution_tags.d.ts +37 -0
- package/dist/v1/resources/solution_tags.d.ts.map +1 -0
- package/dist/v1/resources/solution_tags.js +54 -0
- package/dist/v1/resources/solution_tags.js.map +1 -0
- package/dist/v1/resources/solutions.d.ts +313 -0
- package/dist/v1/resources/solutions.d.ts.map +1 -0
- package/dist/v1/resources/solutions.js +218 -0
- package/dist/v1/resources/solutions.js.map +1 -0
- package/dist/v1/resources/team_memberships.d.ts +31 -0
- package/dist/v1/resources/team_memberships.d.ts.map +1 -1
- package/dist/v1/resources/team_memberships.js +49 -2
- package/dist/v1/resources/team_memberships.js.map +1 -1
- package/dist/v1/resources/teams.d.ts +461 -49
- package/dist/v1/resources/teams.d.ts.map +1 -1
- package/dist/v1/resources/teams.js +319 -27
- package/dist/v1/resources/teams.js.map +1 -1
- package/dist/v1/resources/thread_messages.d.ts +70 -0
- package/dist/v1/resources/thread_messages.d.ts.map +1 -1
- package/dist/v1/resources/thread_messages.js +85 -2
- package/dist/v1/resources/thread_messages.js.map +1 -1
- package/dist/v1/resources/threads.d.ts +221 -0
- package/dist/v1/resources/threads.d.ts.map +1 -1
- package/dist/v1/resources/threads.js +252 -4
- package/dist/v1/resources/threads.js.map +1 -1
- package/dist/v1/resources/users.d.ts +215 -39
- package/dist/v1/resources/users.d.ts.map +1 -1
- package/dist/v1/resources/users.js +121 -16
- package/dist/v1/resources/users.js.map +1 -1
- package/dist/v1.d.ts +26 -0
- package/dist/v1.d.ts.map +1 -1
- package/dist/v1.js +40 -1
- package/dist/v1.js.map +1 -1
- package/package.json +4 -2
- package/dist/types/agents.d.ts +0 -2084
- package/dist/types/agents.d.ts.map +0 -1
- package/dist/types/agents.js +0 -203
- package/dist/types/agents.js.map +0 -1
package/dist/types/ai.d.ts
CHANGED
|
@@ -1,9 +1,70 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
/**
|
|
2
|
+
/** Terminal event marking the end of a streaming chat completion (SSE `done` event). */
|
|
3
|
+
export interface AIChatStreamDone {
|
|
4
|
+
/** The overall finish reason for the completion. */
|
|
5
|
+
finish_reason?: string | undefined;
|
|
6
|
+
/** Number of model runs executed, including continuations triggered by tool calls. */
|
|
7
|
+
run_count?: number | undefined;
|
|
8
|
+
/** Aggregate token usage across every run in the completion (including tool-call continuations), keyed by model ID. */
|
|
9
|
+
total_usage?: Record<string, unknown> | undefined;
|
|
10
|
+
/** Token usage for the final run, keyed by model ID. */
|
|
11
|
+
usage?: Record<string, unknown> | undefined;
|
|
12
|
+
}
|
|
13
|
+
/** Runtime validator for {@link AIChatStreamDone}. */
|
|
14
|
+
export declare const aIChatStreamDoneSchema: z.ZodObject<{
|
|
15
|
+
/** The overall finish reason for the completion. */
|
|
16
|
+
finish_reason: z.ZodOptional<z.ZodString>;
|
|
17
|
+
/** Number of model runs executed, including continuations triggered by tool calls. */
|
|
18
|
+
run_count: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
/** Aggregate token usage across every run in the completion (including tool-call continuations), keyed by model ID. */
|
|
20
|
+
total_usage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
21
|
+
/** Token usage for the final run, keyed by model ID. */
|
|
22
|
+
usage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
run_count?: number | undefined;
|
|
25
|
+
finish_reason?: string | undefined;
|
|
26
|
+
total_usage?: Record<string, unknown> | undefined;
|
|
27
|
+
usage?: Record<string, unknown> | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
run_count?: number | undefined;
|
|
30
|
+
finish_reason?: string | undefined;
|
|
31
|
+
total_usage?: Record<string, unknown> | undefined;
|
|
32
|
+
usage?: Record<string, unknown> | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
/** Terminal error event for a streaming chat completion (SSE `error` event). */
|
|
35
|
+
export interface AIChatStreamError {
|
|
36
|
+
/** Human-readable description of the error that terminated the stream. */
|
|
37
|
+
message: string;
|
|
38
|
+
}
|
|
39
|
+
/** Runtime validator for {@link AIChatStreamError}. */
|
|
40
|
+
export declare const aIChatStreamErrorSchema: z.ZodObject<{
|
|
41
|
+
/** Human-readable description of the error that terminated the stream. */
|
|
42
|
+
message: z.ZodString;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
message: string;
|
|
45
|
+
}, {
|
|
46
|
+
message: string;
|
|
47
|
+
}>;
|
|
48
|
+
/** A tool (function) call emitted by the assistant within an AI message. Mirrors the OpenAI tool-call object format. */
|
|
49
|
+
export interface AIToolCall {
|
|
50
|
+
/** Arguments the model wants to pass to the tool, as a key-value map. Deserialize and validate these against the tool's input schema before executing. */
|
|
51
|
+
arguments: Record<string, unknown>;
|
|
52
|
+
/** Unique identifier for this tool call, assigned by the model. Use this value as `id` when submitting the corresponding tool result. */
|
|
53
|
+
id: string;
|
|
54
|
+
/** Name of the tool or function the model wants to invoke, e.g. `"web_search"` or `"run_code"`. */
|
|
55
|
+
name: string;
|
|
56
|
+
/** Opaque signature representing the model's internal reasoning that led to this tool call. `null` when the provider does not expose chain-of-thought data. */
|
|
57
|
+
thought_signature?: string | undefined;
|
|
58
|
+
}
|
|
59
|
+
/** Runtime validator for {@link AIToolCall}. */
|
|
3
60
|
export declare const aIToolCallSchema: z.ZodObject<{
|
|
61
|
+
/** Arguments the model wants to pass to the tool, as a key-value map. Deserialize and validate these against the tool's input schema before executing. */
|
|
4
62
|
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
63
|
+
/** Unique identifier for this tool call, assigned by the model. Use this value as `id` when submitting the corresponding tool result. */
|
|
5
64
|
id: z.ZodString;
|
|
65
|
+
/** Name of the tool or function the model wants to invoke, e.g. `"web_search"` or `"run_code"`. */
|
|
6
66
|
name: z.ZodString;
|
|
67
|
+
/** Opaque signature representing the model's internal reasoning that led to this tool call. `null` when the provider does not expose chain-of-thought data. */
|
|
7
68
|
thought_signature: z.ZodOptional<z.ZodString>;
|
|
8
69
|
}, "strip", z.ZodTypeAny, {
|
|
9
70
|
id: string;
|
|
@@ -16,12 +77,26 @@ export declare const aIToolCallSchema: z.ZodObject<{
|
|
|
16
77
|
arguments: Record<string, unknown>;
|
|
17
78
|
thought_signature?: string | undefined;
|
|
18
79
|
}>;
|
|
19
|
-
|
|
20
|
-
|
|
80
|
+
/** The result of executing a tool call, submitted back to the model as a tool-role message. Mirrors the OpenAI tool-result object format. */
|
|
81
|
+
export interface AIToolResult {
|
|
82
|
+
/** Plain-text output produced by the tool execution. `null` when the result is expressed entirely through `resolution`. */
|
|
83
|
+
content?: string | undefined;
|
|
84
|
+
/** ID of the tool call this result satisfies. Must match the `id` from the corresponding `AIToolCall`. */
|
|
85
|
+
id: string;
|
|
86
|
+
/** Name of the tool or function that was executed, e.g. `"web_search"`. Must match the `name` from the corresponding `AIToolCall`. */
|
|
87
|
+
name: string;
|
|
88
|
+
/** Structured result data from the tool execution. Shape varies by tool. `null` when the result is expressed as plain text in `content`. */
|
|
89
|
+
resolution?: unknown | undefined;
|
|
90
|
+
}
|
|
91
|
+
/** Runtime validator for {@link AIToolResult}. */
|
|
21
92
|
export declare const aIToolResultSchema: z.ZodObject<{
|
|
93
|
+
/** Plain-text output produced by the tool execution. `null` when the result is expressed entirely through `resolution`. */
|
|
22
94
|
content: z.ZodOptional<z.ZodString>;
|
|
95
|
+
/** ID of the tool call this result satisfies. Must match the `id` from the corresponding `AIToolCall`. */
|
|
23
96
|
id: z.ZodString;
|
|
97
|
+
/** Name of the tool or function that was executed, e.g. `"web_search"`. Must match the `name` from the corresponding `AIToolCall`. */
|
|
24
98
|
name: z.ZodString;
|
|
99
|
+
/** Structured result data from the tool execution. Shape varies by tool. `null` when the result is expressed as plain text in `content`. */
|
|
25
100
|
resolution: z.ZodOptional<z.ZodUnknown>;
|
|
26
101
|
}, "strip", z.ZodTypeAny, {
|
|
27
102
|
id: string;
|
|
@@ -34,18 +109,44 @@ export declare const aIToolResultSchema: z.ZodObject<{
|
|
|
34
109
|
content?: string | undefined;
|
|
35
110
|
resolution?: unknown;
|
|
36
111
|
}>;
|
|
37
|
-
|
|
38
|
-
|
|
112
|
+
/** A single message in an AI conversation, following the OpenAI-compatible chat format. Used in both request inputs and completion responses. */
|
|
113
|
+
export interface AIMessage {
|
|
114
|
+
/** Plain-text content of the message. Present for `system`, `user`, and `assistant` messages. `null` when the message body is expressed through `content_parts` or `tool_calls`. */
|
|
115
|
+
content?: string | undefined;
|
|
116
|
+
/** Multimodal content parts for the message, used when the body includes images or mixed media. Each part is a map with a `type` key (`"text"`, `"image_url"`, or `"image_data"`). `null` when `content` is set. */
|
|
117
|
+
content_parts?: Record<string, unknown>[] | undefined;
|
|
118
|
+
/** Opaque token that can be passed on a subsequent request to resume this conversation from the current state. `null` when the provider does not support conversation resumption. */
|
|
119
|
+
resume_token?: string | undefined;
|
|
120
|
+
/** The speaker role for this message. One of `"system"`, `"user"`, `"assistant"`, or `"tool"`. */
|
|
121
|
+
role: string;
|
|
122
|
+
/** Parsed structured data returned by the model when a JSON schema or structured-output mode was requested. Shape varies by the schema supplied at call time. `null` when structured output was not requested. */
|
|
123
|
+
structured_output?: unknown | undefined;
|
|
124
|
+
/** Tool calls requested by the model in an `assistant` message. Present only on assistant messages that invoke one or more tools. `null` on all other message roles. */
|
|
125
|
+
tool_calls?: AIToolCall[] | undefined;
|
|
126
|
+
/** Tool execution results provided in a `tool` message. Each entry corresponds to a prior tool call by its `id`. `null` on all other message roles. */
|
|
127
|
+
tool_results?: AIToolResult[] | undefined;
|
|
128
|
+
}
|
|
129
|
+
/** Runtime validator for {@link AIMessage}. */
|
|
39
130
|
export declare const aIMessageSchema: z.ZodObject<{
|
|
131
|
+
/** Plain-text content of the message. Present for `system`, `user`, and `assistant` messages. `null` when the message body is expressed through `content_parts` or `tool_calls`. */
|
|
40
132
|
content: z.ZodOptional<z.ZodString>;
|
|
133
|
+
/** Multimodal content parts for the message, used when the body includes images or mixed media. Each part is a map with a `type` key (`"text"`, `"image_url"`, or `"image_data"`). `null` when `content` is set. */
|
|
41
134
|
content_parts: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
135
|
+
/** Opaque token that can be passed on a subsequent request to resume this conversation from the current state. `null` when the provider does not support conversation resumption. */
|
|
42
136
|
resume_token: z.ZodOptional<z.ZodString>;
|
|
137
|
+
/** The speaker role for this message. One of `"system"`, `"user"`, `"assistant"`, or `"tool"`. */
|
|
43
138
|
role: z.ZodString;
|
|
139
|
+
/** Parsed structured data returned by the model when a JSON schema or structured-output mode was requested. Shape varies by the schema supplied at call time. `null` when structured output was not requested. */
|
|
44
140
|
structured_output: z.ZodOptional<z.ZodUnknown>;
|
|
141
|
+
/** Tool calls requested by the model in an `assistant` message. Present only on assistant messages that invoke one or more tools. `null` on all other message roles. */
|
|
45
142
|
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
143
|
+
/** Arguments the model wants to pass to the tool, as a key-value map. Deserialize and validate these against the tool's input schema before executing. */
|
|
46
144
|
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
145
|
+
/** Unique identifier for this tool call, assigned by the model. Use this value as `id` when submitting the corresponding tool result. */
|
|
47
146
|
id: z.ZodString;
|
|
147
|
+
/** Name of the tool or function the model wants to invoke, e.g. `"web_search"` or `"run_code"`. */
|
|
48
148
|
name: z.ZodString;
|
|
149
|
+
/** Opaque signature representing the model's internal reasoning that led to this tool call. `null` when the provider does not expose chain-of-thought data. */
|
|
49
150
|
thought_signature: z.ZodOptional<z.ZodString>;
|
|
50
151
|
}, "strip", z.ZodTypeAny, {
|
|
51
152
|
id: string;
|
|
@@ -58,10 +159,15 @@ export declare const aIMessageSchema: z.ZodObject<{
|
|
|
58
159
|
arguments: Record<string, unknown>;
|
|
59
160
|
thought_signature?: string | undefined;
|
|
60
161
|
}>, "many">>;
|
|
162
|
+
/** Tool execution results provided in a `tool` message. Each entry corresponds to a prior tool call by its `id`. `null` on all other message roles. */
|
|
61
163
|
tool_results: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
164
|
+
/** Plain-text output produced by the tool execution. `null` when the result is expressed entirely through `resolution`. */
|
|
62
165
|
content: z.ZodOptional<z.ZodString>;
|
|
166
|
+
/** ID of the tool call this result satisfies. Must match the `id` from the corresponding `AIToolCall`. */
|
|
63
167
|
id: z.ZodString;
|
|
168
|
+
/** Name of the tool or function that was executed, e.g. `"web_search"`. Must match the `name` from the corresponding `AIToolCall`. */
|
|
64
169
|
name: z.ZodString;
|
|
170
|
+
/** Structured result data from the tool execution. Shape varies by tool. `null` when the result is expressed as plain text in `content`. */
|
|
65
171
|
resolution: z.ZodOptional<z.ZodUnknown>;
|
|
66
172
|
}, "strip", z.ZodTypeAny, {
|
|
67
173
|
id: string;
|
|
@@ -111,20 +217,265 @@ export declare const aIMessageSchema: z.ZodObject<{
|
|
|
111
217
|
resolution?: unknown;
|
|
112
218
|
}[] | undefined;
|
|
113
219
|
}>;
|
|
114
|
-
|
|
115
|
-
|
|
220
|
+
/** The fully assembled assistant message for one run of a streaming chat completion (SSE `message_complete` event). */
|
|
221
|
+
export interface AIChatStreamMessageComplete {
|
|
222
|
+
/** Why the model stopped generating this message, e.g. `"stop"`, `"length"`, or `"tool_calls"`. */
|
|
223
|
+
finish_reason?: string | undefined;
|
|
224
|
+
/** The complete assistant message for this run, assembled from the preceding deltas. */
|
|
225
|
+
message: AIMessage;
|
|
226
|
+
/** Token consumption for this run, keyed by model ID. `null` when usage data is unavailable. */
|
|
227
|
+
usage?: Record<string, unknown> | undefined;
|
|
228
|
+
}
|
|
229
|
+
/** Runtime validator for {@link AIChatStreamMessageComplete}. */
|
|
230
|
+
export declare const aIChatStreamMessageCompleteSchema: z.ZodObject<{
|
|
231
|
+
/** Why the model stopped generating this message, e.g. `"stop"`, `"length"`, or `"tool_calls"`. */
|
|
232
|
+
finish_reason: z.ZodOptional<z.ZodString>;
|
|
233
|
+
/** The complete assistant message for this run, assembled from the preceding deltas. */
|
|
234
|
+
message: z.ZodObject<{
|
|
235
|
+
/** Plain-text content of the message. Present for `system`, `user`, and `assistant` messages. `null` when the message body is expressed through `content_parts` or `tool_calls`. */
|
|
236
|
+
content: z.ZodOptional<z.ZodString>;
|
|
237
|
+
/** Multimodal content parts for the message, used when the body includes images or mixed media. Each part is a map with a `type` key (`"text"`, `"image_url"`, or `"image_data"`). `null` when `content` is set. */
|
|
238
|
+
content_parts: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
239
|
+
/** Opaque token that can be passed on a subsequent request to resume this conversation from the current state. `null` when the provider does not support conversation resumption. */
|
|
240
|
+
resume_token: z.ZodOptional<z.ZodString>;
|
|
241
|
+
/** The speaker role for this message. One of `"system"`, `"user"`, `"assistant"`, or `"tool"`. */
|
|
242
|
+
role: z.ZodString;
|
|
243
|
+
/** Parsed structured data returned by the model when a JSON schema or structured-output mode was requested. Shape varies by the schema supplied at call time. `null` when structured output was not requested. */
|
|
244
|
+
structured_output: z.ZodOptional<z.ZodUnknown>;
|
|
245
|
+
/** Tool calls requested by the model in an `assistant` message. Present only on assistant messages that invoke one or more tools. `null` on all other message roles. */
|
|
246
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
247
|
+
/** Arguments the model wants to pass to the tool, as a key-value map. Deserialize and validate these against the tool's input schema before executing. */
|
|
248
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
249
|
+
/** Unique identifier for this tool call, assigned by the model. Use this value as `id` when submitting the corresponding tool result. */
|
|
250
|
+
id: z.ZodString;
|
|
251
|
+
/** Name of the tool or function the model wants to invoke, e.g. `"web_search"` or `"run_code"`. */
|
|
252
|
+
name: z.ZodString;
|
|
253
|
+
/** Opaque signature representing the model's internal reasoning that led to this tool call. `null` when the provider does not expose chain-of-thought data. */
|
|
254
|
+
thought_signature: z.ZodOptional<z.ZodString>;
|
|
255
|
+
}, "strip", z.ZodTypeAny, {
|
|
256
|
+
id: string;
|
|
257
|
+
name: string;
|
|
258
|
+
arguments: Record<string, unknown>;
|
|
259
|
+
thought_signature?: string | undefined;
|
|
260
|
+
}, {
|
|
261
|
+
id: string;
|
|
262
|
+
name: string;
|
|
263
|
+
arguments: Record<string, unknown>;
|
|
264
|
+
thought_signature?: string | undefined;
|
|
265
|
+
}>, "many">>;
|
|
266
|
+
/** Tool execution results provided in a `tool` message. Each entry corresponds to a prior tool call by its `id`. `null` on all other message roles. */
|
|
267
|
+
tool_results: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
268
|
+
/** Plain-text output produced by the tool execution. `null` when the result is expressed entirely through `resolution`. */
|
|
269
|
+
content: z.ZodOptional<z.ZodString>;
|
|
270
|
+
/** ID of the tool call this result satisfies. Must match the `id` from the corresponding `AIToolCall`. */
|
|
271
|
+
id: z.ZodString;
|
|
272
|
+
/** Name of the tool or function that was executed, e.g. `"web_search"`. Must match the `name` from the corresponding `AIToolCall`. */
|
|
273
|
+
name: z.ZodString;
|
|
274
|
+
/** Structured result data from the tool execution. Shape varies by tool. `null` when the result is expressed as plain text in `content`. */
|
|
275
|
+
resolution: z.ZodOptional<z.ZodUnknown>;
|
|
276
|
+
}, "strip", z.ZodTypeAny, {
|
|
277
|
+
id: string;
|
|
278
|
+
name: string;
|
|
279
|
+
content?: string | undefined;
|
|
280
|
+
resolution?: unknown;
|
|
281
|
+
}, {
|
|
282
|
+
id: string;
|
|
283
|
+
name: string;
|
|
284
|
+
content?: string | undefined;
|
|
285
|
+
resolution?: unknown;
|
|
286
|
+
}>, "many">>;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
role: string;
|
|
289
|
+
content?: string | undefined;
|
|
290
|
+
content_parts?: Record<string, unknown>[] | undefined;
|
|
291
|
+
resume_token?: string | undefined;
|
|
292
|
+
structured_output?: unknown;
|
|
293
|
+
tool_calls?: {
|
|
294
|
+
id: string;
|
|
295
|
+
name: string;
|
|
296
|
+
arguments: Record<string, unknown>;
|
|
297
|
+
thought_signature?: string | undefined;
|
|
298
|
+
}[] | undefined;
|
|
299
|
+
tool_results?: {
|
|
300
|
+
id: string;
|
|
301
|
+
name: string;
|
|
302
|
+
content?: string | undefined;
|
|
303
|
+
resolution?: unknown;
|
|
304
|
+
}[] | undefined;
|
|
305
|
+
}, {
|
|
306
|
+
role: string;
|
|
307
|
+
content?: string | undefined;
|
|
308
|
+
content_parts?: Record<string, unknown>[] | undefined;
|
|
309
|
+
resume_token?: string | undefined;
|
|
310
|
+
structured_output?: unknown;
|
|
311
|
+
tool_calls?: {
|
|
312
|
+
id: string;
|
|
313
|
+
name: string;
|
|
314
|
+
arguments: Record<string, unknown>;
|
|
315
|
+
thought_signature?: string | undefined;
|
|
316
|
+
}[] | undefined;
|
|
317
|
+
tool_results?: {
|
|
318
|
+
id: string;
|
|
319
|
+
name: string;
|
|
320
|
+
content?: string | undefined;
|
|
321
|
+
resolution?: unknown;
|
|
322
|
+
}[] | undefined;
|
|
323
|
+
}>;
|
|
324
|
+
/** Token consumption for this run, keyed by model ID. `null` when usage data is unavailable. */
|
|
325
|
+
usage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
326
|
+
}, "strip", z.ZodTypeAny, {
|
|
327
|
+
message: {
|
|
328
|
+
role: string;
|
|
329
|
+
content?: string | undefined;
|
|
330
|
+
content_parts?: Record<string, unknown>[] | undefined;
|
|
331
|
+
resume_token?: string | undefined;
|
|
332
|
+
structured_output?: unknown;
|
|
333
|
+
tool_calls?: {
|
|
334
|
+
id: string;
|
|
335
|
+
name: string;
|
|
336
|
+
arguments: Record<string, unknown>;
|
|
337
|
+
thought_signature?: string | undefined;
|
|
338
|
+
}[] | undefined;
|
|
339
|
+
tool_results?: {
|
|
340
|
+
id: string;
|
|
341
|
+
name: string;
|
|
342
|
+
content?: string | undefined;
|
|
343
|
+
resolution?: unknown;
|
|
344
|
+
}[] | undefined;
|
|
345
|
+
};
|
|
346
|
+
finish_reason?: string | undefined;
|
|
347
|
+
usage?: Record<string, unknown> | undefined;
|
|
348
|
+
}, {
|
|
349
|
+
message: {
|
|
350
|
+
role: string;
|
|
351
|
+
content?: string | undefined;
|
|
352
|
+
content_parts?: Record<string, unknown>[] | undefined;
|
|
353
|
+
resume_token?: string | undefined;
|
|
354
|
+
structured_output?: unknown;
|
|
355
|
+
tool_calls?: {
|
|
356
|
+
id: string;
|
|
357
|
+
name: string;
|
|
358
|
+
arguments: Record<string, unknown>;
|
|
359
|
+
thought_signature?: string | undefined;
|
|
360
|
+
}[] | undefined;
|
|
361
|
+
tool_results?: {
|
|
362
|
+
id: string;
|
|
363
|
+
name: string;
|
|
364
|
+
content?: string | undefined;
|
|
365
|
+
resolution?: unknown;
|
|
366
|
+
}[] | undefined;
|
|
367
|
+
};
|
|
368
|
+
finish_reason?: string | undefined;
|
|
369
|
+
usage?: Record<string, unknown> | undefined;
|
|
370
|
+
}>;
|
|
371
|
+
/** Incremental assistant text emitted during a streaming chat completion (SSE `message_delta` event). */
|
|
372
|
+
export interface AIChatStreamMessageDelta {
|
|
373
|
+
/** The chunk of assistant text produced since the previous `message_delta` event. Concatenate deltas in order to reconstruct the message. */
|
|
374
|
+
delta: string;
|
|
375
|
+
}
|
|
376
|
+
/** Runtime validator for {@link AIChatStreamMessageDelta}. */
|
|
377
|
+
export declare const aIChatStreamMessageDeltaSchema: z.ZodObject<{
|
|
378
|
+
/** The chunk of assistant text produced since the previous `message_delta` event. Concatenate deltas in order to reconstruct the message. */
|
|
379
|
+
delta: z.ZodString;
|
|
380
|
+
}, "strip", z.ZodTypeAny, {
|
|
381
|
+
delta: string;
|
|
382
|
+
}, {
|
|
383
|
+
delta: string;
|
|
384
|
+
}>;
|
|
385
|
+
/** Incremental tool-call data emitted as the model assembles a tool invocation (SSE `tool_call_delta` event). */
|
|
386
|
+
export interface AIChatStreamToolCallDelta {
|
|
387
|
+
/** A chunk of the tool call's serialized arguments. Concatenate deltas to reconstruct the arguments JSON. */
|
|
388
|
+
delta?: string | undefined;
|
|
389
|
+
/** Identifier of the tool call this delta belongs to, once the model has assigned one. */
|
|
390
|
+
id?: string | undefined;
|
|
391
|
+
/** Name of the tool being called, once known. */
|
|
392
|
+
name?: string | undefined;
|
|
393
|
+
}
|
|
394
|
+
/** Runtime validator for {@link AIChatStreamToolCallDelta}. */
|
|
395
|
+
export declare const aIChatStreamToolCallDeltaSchema: z.ZodObject<{
|
|
396
|
+
/** A chunk of the tool call's serialized arguments. Concatenate deltas to reconstruct the arguments JSON. */
|
|
397
|
+
delta: z.ZodOptional<z.ZodString>;
|
|
398
|
+
/** Identifier of the tool call this delta belongs to, once the model has assigned one. */
|
|
399
|
+
id: z.ZodOptional<z.ZodString>;
|
|
400
|
+
/** Name of the tool being called, once known. */
|
|
401
|
+
name: z.ZodOptional<z.ZodString>;
|
|
402
|
+
}, "strip", z.ZodTypeAny, {
|
|
403
|
+
id?: string | undefined;
|
|
404
|
+
name?: string | undefined;
|
|
405
|
+
delta?: string | undefined;
|
|
406
|
+
}, {
|
|
407
|
+
id?: string | undefined;
|
|
408
|
+
name?: string | undefined;
|
|
409
|
+
delta?: string | undefined;
|
|
410
|
+
}>;
|
|
411
|
+
/** The result of a server-executed tool, streamed back into the run (SSE `tool_result` event). */
|
|
412
|
+
export interface AIChatStreamToolResult {
|
|
413
|
+
/** The tool's output, serialized as a string. */
|
|
414
|
+
content?: string | undefined;
|
|
415
|
+
/** ID of the tool call this result satisfies. */
|
|
416
|
+
id?: string | undefined;
|
|
417
|
+
/** Name of the tool that produced this result. */
|
|
418
|
+
name?: string | undefined;
|
|
419
|
+
/** How the tool call resolved, e.g. `"ok"` or `"error"`. */
|
|
420
|
+
resolution?: string | undefined;
|
|
421
|
+
}
|
|
422
|
+
/** Runtime validator for {@link AIChatStreamToolResult}. */
|
|
423
|
+
export declare const aIChatStreamToolResultSchema: z.ZodObject<{
|
|
424
|
+
/** The tool's output, serialized as a string. */
|
|
425
|
+
content: z.ZodOptional<z.ZodString>;
|
|
426
|
+
/** ID of the tool call this result satisfies. */
|
|
427
|
+
id: z.ZodOptional<z.ZodString>;
|
|
428
|
+
/** Name of the tool that produced this result. */
|
|
429
|
+
name: z.ZodOptional<z.ZodString>;
|
|
430
|
+
/** How the tool call resolved, e.g. `"ok"` or `"error"`. */
|
|
431
|
+
resolution: z.ZodOptional<z.ZodString>;
|
|
432
|
+
}, "strip", z.ZodTypeAny, {
|
|
433
|
+
content?: string | undefined;
|
|
434
|
+
id?: string | undefined;
|
|
435
|
+
name?: string | undefined;
|
|
436
|
+
resolution?: string | undefined;
|
|
437
|
+
}, {
|
|
438
|
+
content?: string | undefined;
|
|
439
|
+
id?: string | undefined;
|
|
440
|
+
name?: string | undefined;
|
|
441
|
+
resolution?: string | undefined;
|
|
442
|
+
}>;
|
|
443
|
+
/** The result of an AI chat completion request. Returned by chat completion endpoints after the model finishes generating. */
|
|
444
|
+
export interface AICompletionResult {
|
|
445
|
+
/** The reason the model stopped generating. Common values include `"stop"` (natural end), `"length"` (token limit reached), and `"tool_calls"` (the model invoked a tool). */
|
|
446
|
+
finish_reason: string;
|
|
447
|
+
/** The final assistant message produced by the completion. */
|
|
448
|
+
message: AIMessage;
|
|
449
|
+
/** The complete message history for the conversation, including all user, assistant, and tool messages in order. */
|
|
450
|
+
messages: AIMessage[];
|
|
451
|
+
/** Token consumption breakdown keyed by model ID. Each value is a map with `"input_tokens"` and `"output_tokens"` counts. `null` when usage data is unavailable. */
|
|
452
|
+
token_usage?: Record<string, unknown> | undefined;
|
|
453
|
+
}
|
|
454
|
+
/** Runtime validator for {@link AICompletionResult}. */
|
|
116
455
|
export declare const aICompletionResultSchema: z.ZodObject<{
|
|
456
|
+
/** The reason the model stopped generating. Common values include `"stop"` (natural end), `"length"` (token limit reached), and `"tool_calls"` (the model invoked a tool). */
|
|
117
457
|
finish_reason: z.ZodString;
|
|
458
|
+
/** The final assistant message produced by the completion. */
|
|
118
459
|
message: z.ZodObject<{
|
|
460
|
+
/** Plain-text content of the message. Present for `system`, `user`, and `assistant` messages. `null` when the message body is expressed through `content_parts` or `tool_calls`. */
|
|
119
461
|
content: z.ZodOptional<z.ZodString>;
|
|
462
|
+
/** Multimodal content parts for the message, used when the body includes images or mixed media. Each part is a map with a `type` key (`"text"`, `"image_url"`, or `"image_data"`). `null` when `content` is set. */
|
|
120
463
|
content_parts: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
464
|
+
/** Opaque token that can be passed on a subsequent request to resume this conversation from the current state. `null` when the provider does not support conversation resumption. */
|
|
121
465
|
resume_token: z.ZodOptional<z.ZodString>;
|
|
466
|
+
/** The speaker role for this message. One of `"system"`, `"user"`, `"assistant"`, or `"tool"`. */
|
|
122
467
|
role: z.ZodString;
|
|
468
|
+
/** Parsed structured data returned by the model when a JSON schema or structured-output mode was requested. Shape varies by the schema supplied at call time. `null` when structured output was not requested. */
|
|
123
469
|
structured_output: z.ZodOptional<z.ZodUnknown>;
|
|
470
|
+
/** Tool calls requested by the model in an `assistant` message. Present only on assistant messages that invoke one or more tools. `null` on all other message roles. */
|
|
124
471
|
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
472
|
+
/** Arguments the model wants to pass to the tool, as a key-value map. Deserialize and validate these against the tool's input schema before executing. */
|
|
125
473
|
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
474
|
+
/** Unique identifier for this tool call, assigned by the model. Use this value as `id` when submitting the corresponding tool result. */
|
|
126
475
|
id: z.ZodString;
|
|
476
|
+
/** Name of the tool or function the model wants to invoke, e.g. `"web_search"` or `"run_code"`. */
|
|
127
477
|
name: z.ZodString;
|
|
478
|
+
/** Opaque signature representing the model's internal reasoning that led to this tool call. `null` when the provider does not expose chain-of-thought data. */
|
|
128
479
|
thought_signature: z.ZodOptional<z.ZodString>;
|
|
129
480
|
}, "strip", z.ZodTypeAny, {
|
|
130
481
|
id: string;
|
|
@@ -137,10 +488,15 @@ export declare const aICompletionResultSchema: z.ZodObject<{
|
|
|
137
488
|
arguments: Record<string, unknown>;
|
|
138
489
|
thought_signature?: string | undefined;
|
|
139
490
|
}>, "many">>;
|
|
491
|
+
/** Tool execution results provided in a `tool` message. Each entry corresponds to a prior tool call by its `id`. `null` on all other message roles. */
|
|
140
492
|
tool_results: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
493
|
+
/** Plain-text output produced by the tool execution. `null` when the result is expressed entirely through `resolution`. */
|
|
141
494
|
content: z.ZodOptional<z.ZodString>;
|
|
495
|
+
/** ID of the tool call this result satisfies. Must match the `id` from the corresponding `AIToolCall`. */
|
|
142
496
|
id: z.ZodString;
|
|
497
|
+
/** Name of the tool or function that was executed, e.g. `"web_search"`. Must match the `name` from the corresponding `AIToolCall`. */
|
|
143
498
|
name: z.ZodString;
|
|
499
|
+
/** Structured result data from the tool execution. Shape varies by tool. `null` when the result is expressed as plain text in `content`. */
|
|
144
500
|
resolution: z.ZodOptional<z.ZodUnknown>;
|
|
145
501
|
}, "strip", z.ZodTypeAny, {
|
|
146
502
|
id: string;
|
|
@@ -190,16 +546,27 @@ export declare const aICompletionResultSchema: z.ZodObject<{
|
|
|
190
546
|
resolution?: unknown;
|
|
191
547
|
}[] | undefined;
|
|
192
548
|
}>;
|
|
549
|
+
/** The complete message history for the conversation, including all user, assistant, and tool messages in order. */
|
|
193
550
|
messages: z.ZodArray<z.ZodObject<{
|
|
551
|
+
/** Plain-text content of the message. Present for `system`, `user`, and `assistant` messages. `null` when the message body is expressed through `content_parts` or `tool_calls`. */
|
|
194
552
|
content: z.ZodOptional<z.ZodString>;
|
|
553
|
+
/** Multimodal content parts for the message, used when the body includes images or mixed media. Each part is a map with a `type` key (`"text"`, `"image_url"`, or `"image_data"`). `null` when `content` is set. */
|
|
195
554
|
content_parts: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
555
|
+
/** Opaque token that can be passed on a subsequent request to resume this conversation from the current state. `null` when the provider does not support conversation resumption. */
|
|
196
556
|
resume_token: z.ZodOptional<z.ZodString>;
|
|
557
|
+
/** The speaker role for this message. One of `"system"`, `"user"`, `"assistant"`, or `"tool"`. */
|
|
197
558
|
role: z.ZodString;
|
|
559
|
+
/** Parsed structured data returned by the model when a JSON schema or structured-output mode was requested. Shape varies by the schema supplied at call time. `null` when structured output was not requested. */
|
|
198
560
|
structured_output: z.ZodOptional<z.ZodUnknown>;
|
|
561
|
+
/** Tool calls requested by the model in an `assistant` message. Present only on assistant messages that invoke one or more tools. `null` on all other message roles. */
|
|
199
562
|
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
563
|
+
/** Arguments the model wants to pass to the tool, as a key-value map. Deserialize and validate these against the tool's input schema before executing. */
|
|
200
564
|
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
565
|
+
/** Unique identifier for this tool call, assigned by the model. Use this value as `id` when submitting the corresponding tool result. */
|
|
201
566
|
id: z.ZodString;
|
|
567
|
+
/** Name of the tool or function the model wants to invoke, e.g. `"web_search"` or `"run_code"`. */
|
|
202
568
|
name: z.ZodString;
|
|
569
|
+
/** Opaque signature representing the model's internal reasoning that led to this tool call. `null` when the provider does not expose chain-of-thought data. */
|
|
203
570
|
thought_signature: z.ZodOptional<z.ZodString>;
|
|
204
571
|
}, "strip", z.ZodTypeAny, {
|
|
205
572
|
id: string;
|
|
@@ -212,10 +579,15 @@ export declare const aICompletionResultSchema: z.ZodObject<{
|
|
|
212
579
|
arguments: Record<string, unknown>;
|
|
213
580
|
thought_signature?: string | undefined;
|
|
214
581
|
}>, "many">>;
|
|
582
|
+
/** Tool execution results provided in a `tool` message. Each entry corresponds to a prior tool call by its `id`. `null` on all other message roles. */
|
|
215
583
|
tool_results: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
584
|
+
/** Plain-text output produced by the tool execution. `null` when the result is expressed entirely through `resolution`. */
|
|
216
585
|
content: z.ZodOptional<z.ZodString>;
|
|
586
|
+
/** ID of the tool call this result satisfies. Must match the `id` from the corresponding `AIToolCall`. */
|
|
217
587
|
id: z.ZodString;
|
|
588
|
+
/** Name of the tool or function that was executed, e.g. `"web_search"`. Must match the `name` from the corresponding `AIToolCall`. */
|
|
218
589
|
name: z.ZodString;
|
|
590
|
+
/** Structured result data from the tool execution. Shape varies by tool. `null` when the result is expressed as plain text in `content`. */
|
|
219
591
|
resolution: z.ZodOptional<z.ZodUnknown>;
|
|
220
592
|
}, "strip", z.ZodTypeAny, {
|
|
221
593
|
id: string;
|
|
@@ -265,6 +637,7 @@ export declare const aICompletionResultSchema: z.ZodObject<{
|
|
|
265
637
|
resolution?: unknown;
|
|
266
638
|
}[] | undefined;
|
|
267
639
|
}>, "many">;
|
|
640
|
+
/** Token consumption breakdown keyed by model ID. Each value is a map with `"input_tokens"` and `"output_tokens"` counts. `null` when usage data is unavailable. */
|
|
268
641
|
token_usage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
269
642
|
}, "strip", z.ZodTypeAny, {
|
|
270
643
|
message: {
|
|
@@ -349,44 +722,78 @@ export declare const aICompletionResultSchema: z.ZodObject<{
|
|
|
349
722
|
}[];
|
|
350
723
|
token_usage?: Record<string, unknown> | undefined;
|
|
351
724
|
}>;
|
|
352
|
-
|
|
353
|
-
|
|
725
|
+
/** The result returned by an AI image generation or editing operation. Contains the generated image (as inline data or a URL) along with dimension, size, and usage metadata. */
|
|
726
|
+
export interface AIImageResult {
|
|
727
|
+
/** Aspect ratio of the generated image, e.g. `"16:9"` or `"1:1"`. `null` when not reported by the provider. */
|
|
728
|
+
aspect_ratio?: string | undefined;
|
|
729
|
+
/** Height of the generated image in pixels. `null` when the provider does not report dimensions. */
|
|
730
|
+
height?: number | undefined;
|
|
731
|
+
/** The generated image encoded as a base64 string. Present when the provider returns inline image data. `null` when `image_url` is set instead. */
|
|
732
|
+
image_data?: string | undefined;
|
|
733
|
+
/** Resolution tier label for the image, e.g. `"1K"` or `"2K"`. `null` when the provider does not include a tier label. */
|
|
734
|
+
image_size?: string | undefined;
|
|
735
|
+
/** MIME type of the generated image, e.g. `"image/png"` or `"image/jpeg"`. `null` when the provider does not report a content type. */
|
|
736
|
+
image_type?: string | undefined;
|
|
737
|
+
/** Temporary URL pointing to the generated image hosted by the provider. Present when the provider returns a URL rather than inline data. `null` when `image_data` is set instead. */
|
|
738
|
+
image_url?: string | undefined;
|
|
739
|
+
/** Identifier of the model that produced the image, e.g. `"dall-e-3"` or `"imagen-3"`. */
|
|
740
|
+
model: string;
|
|
741
|
+
/** The prompt as rewritten by the provider before generation. Some providers (e.g. DALL-E 3) automatically expand or safety-check the original prompt. `null` when the provider does not revise prompts. */
|
|
742
|
+
revised_prompt?: string | undefined;
|
|
743
|
+
/** Canonical size string as returned by the provider, e.g. `"1024x1024"`. `null` when not reported. */
|
|
744
|
+
size?: string | undefined;
|
|
745
|
+
/** Provider-reported token and compute usage for the request. Structure varies by provider. `null` when usage data is unavailable. */
|
|
746
|
+
usage?: Record<string, unknown> | undefined;
|
|
747
|
+
/** Width of the generated image in pixels. `null` when the provider does not report dimensions. */
|
|
748
|
+
width?: number | undefined;
|
|
749
|
+
}
|
|
750
|
+
/** Runtime validator for {@link AIImageResult}. */
|
|
354
751
|
export declare const aIImageResultSchema: z.ZodObject<{
|
|
752
|
+
/** Aspect ratio of the generated image, e.g. `"16:9"` or `"1:1"`. `null` when not reported by the provider. */
|
|
355
753
|
aspect_ratio: z.ZodOptional<z.ZodString>;
|
|
754
|
+
/** Height of the generated image in pixels. `null` when the provider does not report dimensions. */
|
|
356
755
|
height: z.ZodOptional<z.ZodNumber>;
|
|
756
|
+
/** The generated image encoded as a base64 string. Present when the provider returns inline image data. `null` when `image_url` is set instead. */
|
|
357
757
|
image_data: z.ZodOptional<z.ZodString>;
|
|
758
|
+
/** Resolution tier label for the image, e.g. `"1K"` or `"2K"`. `null` when the provider does not include a tier label. */
|
|
358
759
|
image_size: z.ZodOptional<z.ZodString>;
|
|
760
|
+
/** MIME type of the generated image, e.g. `"image/png"` or `"image/jpeg"`. `null` when the provider does not report a content type. */
|
|
359
761
|
image_type: z.ZodOptional<z.ZodString>;
|
|
762
|
+
/** Temporary URL pointing to the generated image hosted by the provider. Present when the provider returns a URL rather than inline data. `null` when `image_data` is set instead. */
|
|
360
763
|
image_url: z.ZodOptional<z.ZodString>;
|
|
764
|
+
/** Identifier of the model that produced the image, e.g. `"dall-e-3"` or `"imagen-3"`. */
|
|
361
765
|
model: z.ZodString;
|
|
766
|
+
/** The prompt as rewritten by the provider before generation. Some providers (e.g. DALL-E 3) automatically expand or safety-check the original prompt. `null` when the provider does not revise prompts. */
|
|
362
767
|
revised_prompt: z.ZodOptional<z.ZodString>;
|
|
768
|
+
/** Canonical size string as returned by the provider, e.g. `"1024x1024"`. `null` when not reported. */
|
|
363
769
|
size: z.ZodOptional<z.ZodString>;
|
|
770
|
+
/** Provider-reported token and compute usage for the request. Structure varies by provider. `null` when usage data is unavailable. */
|
|
364
771
|
usage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
772
|
+
/** Width of the generated image in pixels. `null` when the provider does not report dimensions. */
|
|
365
773
|
width: z.ZodOptional<z.ZodNumber>;
|
|
366
774
|
}, "strip", z.ZodTypeAny, {
|
|
367
775
|
model: string;
|
|
368
776
|
height?: number | undefined;
|
|
369
777
|
width?: number | undefined;
|
|
370
778
|
image_url?: string | undefined;
|
|
779
|
+
size?: string | undefined;
|
|
780
|
+
usage?: Record<string, unknown> | undefined;
|
|
371
781
|
aspect_ratio?: string | undefined;
|
|
372
782
|
image_data?: string | undefined;
|
|
373
783
|
image_size?: string | undefined;
|
|
374
784
|
image_type?: string | undefined;
|
|
375
785
|
revised_prompt?: string | undefined;
|
|
376
|
-
size?: string | undefined;
|
|
377
|
-
usage?: Record<string, unknown> | undefined;
|
|
378
786
|
}, {
|
|
379
787
|
model: string;
|
|
380
788
|
height?: number | undefined;
|
|
381
789
|
width?: number | undefined;
|
|
382
790
|
image_url?: string | undefined;
|
|
791
|
+
size?: string | undefined;
|
|
792
|
+
usage?: Record<string, unknown> | undefined;
|
|
383
793
|
aspect_ratio?: string | undefined;
|
|
384
794
|
image_data?: string | undefined;
|
|
385
795
|
image_size?: string | undefined;
|
|
386
796
|
image_type?: string | undefined;
|
|
387
797
|
revised_prompt?: string | undefined;
|
|
388
|
-
size?: string | undefined;
|
|
389
|
-
usage?: Record<string, unknown> | undefined;
|
|
390
798
|
}>;
|
|
391
|
-
export type AIImageResult = z.infer<typeof aIImageResultSchema>;
|
|
392
799
|
//# sourceMappingURL=ai.d.ts.map
|
package/dist/types/ai.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/types/ai.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/types/ai.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wFAAwF;AACxF,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,sFAAsF;IACtF,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,uHAAuH;IACvH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAClD,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC7C;AAED,sDAAsD;AACtD,eAAO,MAAM,sBAAsB;IACjC,oDAAoD;;IAEpD,sFAAsF;;IAEtF,uHAAuH;;IAEvH,wDAAwD;;;;;;;;;;;;EAE4E,CAAC;AAEvI,gFAAgF;AAChF,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,uDAAuD;AACvD,eAAO,MAAM,uBAAuB;IAClC,0EAA0E;;;;;;EAEmD,CAAC;AAEhI,wHAAwH;AACxH,MAAM,WAAW,UAAU;IACzB,0JAA0J;IAC1J,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,yIAAyI;IACzI,EAAE,EAAE,MAAM,CAAC;IACX,mGAAmG;IACnG,IAAI,EAAE,MAAM,CAAC;IACb,+JAA+J;IAC/J,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;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