@opencode/ai 0.0.0-reserved → 2.0.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 +879 -2
- package/dist/cache-policy.d.ts +2 -0
- package/dist/cache-policy.js +129 -0
- package/dist/image-client.d.ts +19 -0
- package/dist/image-client.js +28 -0
- package/dist/image.d.ts +110 -0
- package/dist/image.js +103 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +12 -0
- package/dist/llm.d.ts +252 -0
- package/dist/llm.js +74 -0
- package/dist/protocols/alibaba-chat.d.ts +225 -0
- package/dist/protocols/alibaba-chat.js +75 -0
- package/dist/protocols/alibaba-messages.d.ts +350 -0
- package/dist/protocols/alibaba-messages.js +40 -0
- package/dist/protocols/alibaba-responses.d.ts +255 -0
- package/dist/protocols/alibaba-responses.js +80 -0
- package/dist/protocols/anthropic-messages.d.ts +980 -0
- package/dist/protocols/anthropic-messages.js +1460 -0
- package/dist/protocols/bedrock-converse.d.ts +499 -0
- package/dist/protocols/bedrock-converse.js +643 -0
- package/dist/protocols/bedrock-event-stream.d.ts +9 -0
- package/dist/protocols/bedrock-event-stream.js +97 -0
- package/dist/protocols/gemini.d.ts +285 -0
- package/dist/protocols/gemini.js +671 -0
- package/dist/protocols/google-images.d.ts +30 -0
- package/dist/protocols/google-images.js +181 -0
- package/dist/protocols/index.d.ts +12 -0
- package/dist/protocols/index.js +12 -0
- package/dist/protocols/meta-images.d.ts +26 -0
- package/dist/protocols/meta-images.js +89 -0
- package/dist/protocols/meta-messages.d.ts +356 -0
- package/dist/protocols/meta-messages.js +41 -0
- package/dist/protocols/meta-responses.d.ts +473 -0
- package/dist/protocols/meta-responses.js +173 -0
- package/dist/protocols/mistral-chat.d.ts +540 -0
- package/dist/protocols/mistral-chat.js +624 -0
- package/dist/protocols/open-responses-channel.d.ts +25 -0
- package/dist/protocols/open-responses-channel.js +141 -0
- package/dist/protocols/open-responses-continuation.d.ts +16 -0
- package/dist/protocols/open-responses-continuation.js +170 -0
- package/dist/protocols/open-responses.d.ts +1715 -0
- package/dist/protocols/open-responses.js +1228 -0
- package/dist/protocols/openai-chat.d.ts +860 -0
- package/dist/protocols/openai-chat.js +966 -0
- package/dist/protocols/openai-compatible-chat.d.ts +109 -0
- package/dist/protocols/openai-compatible-chat.js +19 -0
- package/dist/protocols/openai-compatible-responses.d.ts +172 -0
- package/dist/protocols/openai-compatible-responses.js +18 -0
- package/dist/protocols/openai-images.d.ts +32 -0
- package/dist/protocols/openai-images.js +183 -0
- package/dist/protocols/openai-responses.d.ts +1389 -0
- package/dist/protocols/openai-responses.js +260 -0
- package/dist/protocols/shared.d.ts +193 -0
- package/dist/protocols/shared.js +290 -0
- package/dist/protocols/utils/bedrock-auth.d.ts +60 -0
- package/dist/protocols/utils/bedrock-auth.js +85 -0
- package/dist/protocols/utils/bedrock-cache.d.ts +19 -0
- package/dist/protocols/utils/bedrock-cache.js +49 -0
- package/dist/protocols/utils/bedrock-media.d.ts +55 -0
- package/dist/protocols/utils/bedrock-media.js +73 -0
- package/dist/protocols/utils/cache.d.ts +6 -0
- package/dist/protocols/utils/cache.js +5 -0
- package/dist/protocols/utils/gemini-tool-schema.d.ts +2 -0
- package/dist/protocols/utils/gemini-tool-schema.js +103 -0
- package/dist/protocols/utils/image-input.d.ts +21 -0
- package/dist/protocols/utils/image-input.js +20 -0
- package/dist/protocols/utils/lifecycle.d.ts +24 -0
- package/dist/protocols/utils/lifecycle.js +72 -0
- package/dist/protocols/utils/meta-image.d.ts +2 -0
- package/dist/protocols/utils/meta-image.js +13 -0
- package/dist/protocols/utils/open-responses-options.d.ts +56 -0
- package/dist/protocols/utils/open-responses-options.js +61 -0
- package/dist/protocols/utils/openai-image.d.ts +5 -0
- package/dist/protocols/utils/openai-image.js +18 -0
- package/dist/protocols/utils/openai-options.d.ts +16 -0
- package/dist/protocols/utils/openai-options.js +14 -0
- package/dist/protocols/utils/partial-json-options.d.ts +62 -0
- package/dist/protocols/utils/partial-json-options.js +52 -0
- package/dist/protocols/utils/partial-json.d.ts +8 -0
- package/dist/protocols/utils/partial-json.js +279 -0
- package/dist/protocols/utils/responses-checkpoint.d.ts +4 -0
- package/dist/protocols/utils/responses-checkpoint.js +107 -0
- package/dist/protocols/utils/responses-compaction.d.ts +4 -0
- package/dist/protocols/utils/responses-compaction.js +129 -0
- package/dist/protocols/utils/responses-hosted-tools.d.ts +26 -0
- package/dist/protocols/utils/responses-hosted-tools.js +32 -0
- package/dist/protocols/utils/tool-schema.d.ts +8 -0
- package/dist/protocols/utils/tool-schema.js +54 -0
- package/dist/protocols/utils/tool-stream.d.ts +710 -0
- package/dist/protocols/utils/tool-stream.js +155 -0
- package/dist/protocols/xai-images.d.ts +26 -0
- package/dist/protocols/xai-images.js +106 -0
- package/dist/protocols/xai-responses.d.ts +250 -0
- package/dist/protocols/xai-responses.js +81 -0
- package/dist/protocols/zai-chat.d.ts +202 -0
- package/dist/protocols/zai-chat.js +49 -0
- package/dist/protocols/zai-images.d.ts +22 -0
- package/dist/protocols/zai-images.js +79 -0
- package/dist/protocols/zai-messages.d.ts +344 -0
- package/dist/protocols/zai-messages.js +27 -0
- package/dist/protocols.d.ts +1 -0
- package/dist/protocols.js +1 -0
- package/dist/provider-error.d.ts +15 -0
- package/dist/provider-error.js +125 -0
- package/dist/provider-package.d.ts +15 -0
- package/dist/provider-package.js +1 -0
- package/dist/provider.d.ts +23 -0
- package/dist/provider.js +2 -0
- package/dist/providers/alibaba/chat.d.ts +1 -0
- package/dist/providers/alibaba/chat.js +1 -0
- package/dist/providers/alibaba/messages.d.ts +3 -0
- package/dist/providers/alibaba/messages.js +1 -0
- package/dist/providers/alibaba/responses.d.ts +3 -0
- package/dist/providers/alibaba/responses.js +1 -0
- package/dist/providers/alibaba.d.ts +711 -0
- package/dist/providers/alibaba.js +94 -0
- package/dist/providers/amazon-bedrock/mantle/chat.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/chat.js +1 -0
- package/dist/providers/amazon-bedrock/mantle/responses.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/responses.js +1 -0
- package/dist/providers/amazon-bedrock/mantle.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle.js +1 -0
- package/dist/providers/amazon-bedrock-mantle.d.ts +313 -0
- package/dist/providers/amazon-bedrock-mantle.js +79 -0
- package/dist/providers/amazon-bedrock.d.ts +173 -0
- package/dist/providers/amazon-bedrock.js +41 -0
- package/dist/providers/anthropic-compatible.d.ts +309 -0
- package/dist/providers/anthropic-compatible.js +50 -0
- package/dist/providers/anthropic.d.ts +307 -0
- package/dist/providers/anthropic.js +42 -0
- package/dist/providers/azure/chat.d.ts +2 -0
- package/dist/providers/azure/chat.js +1 -0
- package/dist/providers/azure/responses.d.ts +2 -0
- package/dist/providers/azure/responses.js +1 -0
- package/dist/providers/azure.d.ts +598 -0
- package/dist/providers/azure.js +115 -0
- package/dist/providers/baseten.d.ts +228 -0
- package/dist/providers/baseten.js +38 -0
- package/dist/providers/cerebras.d.ts +227 -0
- package/dist/providers/cerebras.js +40 -0
- package/dist/providers/cloudflare-ai-gateway.d.ts +237 -0
- package/dist/providers/cloudflare-ai-gateway.js +65 -0
- package/dist/providers/cloudflare-workers-ai.d.ts +231 -0
- package/dist/providers/cloudflare-workers-ai.js +51 -0
- package/dist/providers/deepinfra.d.ts +227 -0
- package/dist/providers/deepinfra.js +43 -0
- package/dist/providers/deepseek.d.ts +228 -0
- package/dist/providers/deepseek.js +41 -0
- package/dist/providers/fireworks.d.ts +228 -0
- package/dist/providers/fireworks.js +38 -0
- package/dist/providers/google-vertex/chat.d.ts +2 -0
- package/dist/providers/google-vertex/chat.js +1 -0
- package/dist/providers/google-vertex/gemini.d.ts +2 -0
- package/dist/providers/google-vertex/gemini.js +1 -0
- package/dist/providers/google-vertex/messages.d.ts +2 -0
- package/dist/providers/google-vertex/messages.js +1 -0
- package/dist/providers/google-vertex/responses.d.ts +2 -0
- package/dist/providers/google-vertex/responses.js +1 -0
- package/dist/providers/google-vertex-chat.d.ts +132 -0
- package/dist/providers/google-vertex-chat.js +55 -0
- package/dist/providers/google-vertex-messages.d.ts +306 -0
- package/dist/providers/google-vertex-messages.js +75 -0
- package/dist/providers/google-vertex-responses.d.ts +197 -0
- package/dist/providers/google-vertex-responses.js +56 -0
- package/dist/providers/google-vertex-shared.d.ts +22 -0
- package/dist/providers/google-vertex-shared.js +72 -0
- package/dist/providers/google-vertex.d.ts +119 -0
- package/dist/providers/google-vertex.js +98 -0
- package/dist/providers/google.d.ts +114 -0
- package/dist/providers/google.js +42 -0
- package/dist/providers/groq.d.ts +314 -0
- package/dist/providers/groq.js +81 -0
- package/dist/providers/index.d.ts +31 -0
- package/dist/providers/index.js +31 -0
- package/dist/providers/meta/chat.d.ts +2 -0
- package/dist/providers/meta/chat.js +1 -0
- package/dist/providers/meta/messages.d.ts +2 -0
- package/dist/providers/meta/messages.js +1 -0
- package/dist/providers/meta/responses.d.ts +2 -0
- package/dist/providers/meta/responses.js +1 -0
- package/dist/providers/meta.d.ts +636 -0
- package/dist/providers/meta.js +113 -0
- package/dist/providers/minimax/chat.d.ts +4 -0
- package/dist/providers/minimax/chat.js +8 -0
- package/dist/providers/minimax/messages.d.ts +1 -0
- package/dist/providers/minimax/messages.js +1 -0
- package/dist/providers/minimax/responses.d.ts +4 -0
- package/dist/providers/minimax/responses.js +8 -0
- package/dist/providers/minimax.d.ts +598 -0
- package/dist/providers/minimax.js +89 -0
- package/dist/providers/mistral.d.ts +207 -0
- package/dist/providers/mistral.js +28 -0
- package/dist/providers/moonshot/chat.d.ts +1 -0
- package/dist/providers/moonshot/chat.js +1 -0
- package/dist/providers/moonshot/messages.d.ts +4 -0
- package/dist/providers/moonshot/messages.js +8 -0
- package/dist/providers/moonshot/responses.d.ts +4 -0
- package/dist/providers/moonshot/responses.js +8 -0
- package/dist/providers/moonshot.d.ts +596 -0
- package/dist/providers/moonshot.js +90 -0
- package/dist/providers/open-responses-options.d.ts +6 -0
- package/dist/providers/open-responses-options.js +1 -0
- package/dist/providers/openai/chat.d.ts +2 -0
- package/dist/providers/openai/chat.js +1 -0
- package/dist/providers/openai/responses.d.ts +2 -0
- package/dist/providers/openai/responses.js +1 -0
- package/dist/providers/openai-compatible/responses.d.ts +1 -0
- package/dist/providers/openai-compatible/responses.js +1 -0
- package/dist/providers/openai-compatible-responses.d.ts +195 -0
- package/dist/providers/openai-compatible-responses.js +32 -0
- package/dist/providers/openai-compatible.d.ts +130 -0
- package/dist/providers/openai-compatible.js +33 -0
- package/dist/providers/openai-options.d.ts +26 -0
- package/dist/providers/openai-options.js +41 -0
- package/dist/providers/openai.d.ts +404 -0
- package/dist/providers/openai.js +82 -0
- package/dist/providers/openrouter.d.ts +563 -0
- package/dist/providers/openrouter.js +114 -0
- package/dist/providers/togetherai.d.ts +227 -0
- package/dist/providers/togetherai.js +40 -0
- package/dist/providers/xai.d.ts +163 -0
- package/dist/providers/xai.js +88 -0
- package/dist/providers/zai/chat.d.ts +1 -0
- package/dist/providers/zai/chat.js +1 -0
- package/dist/providers/zai-coding-plan/chat.d.ts +1 -0
- package/dist/providers/zai-coding-plan/chat.js +1 -0
- package/dist/providers/zai-coding-plan/messages.d.ts +4 -0
- package/dist/providers/zai-coding-plan/messages.js +8 -0
- package/dist/providers/zai-coding-plan/responses.d.ts +4 -0
- package/dist/providers/zai-coding-plan/responses.js +8 -0
- package/dist/providers/zai-coding-plan.d.ts +577 -0
- package/dist/providers/zai-coding-plan.js +63 -0
- package/dist/providers/zai.d.ts +149 -0
- package/dist/providers/zai.js +53 -0
- package/dist/providers.d.ts +1 -0
- package/dist/providers.js +1 -0
- package/dist/route/auth-options.d.ts +34 -0
- package/dist/route/auth-options.js +14 -0
- package/dist/route/auth.d.ts +51 -0
- package/dist/route/auth.js +87 -0
- package/dist/route/client.d.ts +430 -0
- package/dist/route/client.js +307 -0
- package/dist/route/endpoint.d.ts +28 -0
- package/dist/route/endpoint.js +21 -0
- package/dist/route/executor.d.ts +27 -0
- package/dist/route/executor.js +183 -0
- package/dist/route/framing.d.ts +29 -0
- package/dist/route/framing.js +14 -0
- package/dist/route/index.d.ts +16 -0
- package/dist/route/index.js +9 -0
- package/dist/route/protocol.d.ts +76 -0
- package/dist/route/protocol.js +16 -0
- package/dist/route/transport/http.d.ts +34 -0
- package/dist/route/transport/http.js +68 -0
- package/dist/route/transport/index.d.ts +41 -0
- package/dist/route/transport/index.js +4 -0
- package/dist/route/transport/websocket-channel.d.ts +57 -0
- package/dist/route/transport/websocket-channel.js +1 -0
- package/dist/route/transport/websocket.d.ts +56 -0
- package/dist/route/transport/websocket.js +370 -0
- package/dist/route.d.ts +1 -0
- package/dist/route.js +1 -0
- package/dist/schema/errors.d.ts +170 -0
- package/dist/schema/errors.js +131 -0
- package/dist/schema/events.d.ts +8123 -0
- package/dist/schema/events.js +550 -0
- package/dist/schema/ids.d.ts +17 -0
- package/dist/schema/ids.js +10 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.js +5 -0
- package/dist/schema/messages.d.ts +646 -0
- package/dist/schema/messages.js +301 -0
- package/dist/schema/options.d.ts +159 -0
- package/dist/schema/options.js +189 -0
- package/dist/testing.d.ts +1693 -0
- package/dist/testing.js +129 -0
- package/dist/tool-history.d.ts +2 -0
- package/dist/tool-history.js +84 -0
- package/dist/tool-runtime.d.ts +15 -0
- package/dist/tool-runtime.js +62 -0
- package/dist/tool.d.ts +136 -0
- package/dist/tool.js +66 -0
- package/dist/utils/record.d.ts +2 -0
- package/dist/utils/record.js +2 -0
- package/dist/utils/sanitize.d.ts +1 -0
- package/dist/utils/sanitize.js +12 -0
- package/package.json +43 -10
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Protocol } from "../route/protocol.js";
|
|
3
|
+
import { AnthropicMessages } from "./anthropic-messages.js";
|
|
4
|
+
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
5
|
+
declare const Options: Schema.Struct<{
|
|
6
|
+
readonly effort: Schema.optional<Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>>;
|
|
7
|
+
readonly thinking: Schema.optional<Schema.Struct<{
|
|
8
|
+
readonly type: Schema.declare<"enabled" | "disabled" | (string & {}), "enabled" | "disabled" | (string & {})>;
|
|
9
|
+
readonly budgetTokens: Schema.optional<Schema.Int>;
|
|
10
|
+
readonly budget_tokens: Schema.optional<Schema.Int>;
|
|
11
|
+
}>>;
|
|
12
|
+
}>;
|
|
13
|
+
export type OptionsInput = typeof Options.Type & Pick<AnthropicMessages.OptionsInput, "outputConfig">;
|
|
14
|
+
export declare const protocol: Protocol<{
|
|
15
|
+
readonly max_tokens: number;
|
|
16
|
+
readonly model: string;
|
|
17
|
+
readonly messages: readonly ({
|
|
18
|
+
readonly role: "user";
|
|
19
|
+
readonly content: readonly ({
|
|
20
|
+
readonly type: "text";
|
|
21
|
+
readonly text: string;
|
|
22
|
+
readonly cache_control?: {
|
|
23
|
+
readonly type: "ephemeral";
|
|
24
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
} | {
|
|
27
|
+
readonly type: "image";
|
|
28
|
+
readonly source: {
|
|
29
|
+
readonly type: "base64";
|
|
30
|
+
readonly media_type: string;
|
|
31
|
+
readonly data: string;
|
|
32
|
+
} | {
|
|
33
|
+
readonly type: "url";
|
|
34
|
+
readonly url: string;
|
|
35
|
+
} | {
|
|
36
|
+
readonly type: "file";
|
|
37
|
+
readonly file_id: string;
|
|
38
|
+
};
|
|
39
|
+
readonly cache_control?: {
|
|
40
|
+
readonly type: "ephemeral";
|
|
41
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
readonly transformations?: {
|
|
44
|
+
readonly oversized_image?: "error" | "downsize" | undefined;
|
|
45
|
+
} | undefined;
|
|
46
|
+
} | {
|
|
47
|
+
readonly type: "document";
|
|
48
|
+
readonly source: {
|
|
49
|
+
readonly type: "base64";
|
|
50
|
+
readonly media_type: "application/pdf";
|
|
51
|
+
readonly data: string;
|
|
52
|
+
} | {
|
|
53
|
+
readonly type: "text";
|
|
54
|
+
readonly media_type: "text/plain";
|
|
55
|
+
readonly data: string;
|
|
56
|
+
} | {
|
|
57
|
+
readonly type: "url";
|
|
58
|
+
readonly url: string;
|
|
59
|
+
} | {
|
|
60
|
+
readonly type: "file";
|
|
61
|
+
readonly file_id: string;
|
|
62
|
+
};
|
|
63
|
+
readonly title?: string | undefined;
|
|
64
|
+
readonly context?: string | undefined;
|
|
65
|
+
readonly cache_control?: {
|
|
66
|
+
readonly type: "ephemeral";
|
|
67
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
68
|
+
} | undefined;
|
|
69
|
+
readonly citations?: {
|
|
70
|
+
readonly enabled: boolean;
|
|
71
|
+
} | undefined;
|
|
72
|
+
} | {
|
|
73
|
+
readonly type: "tool_result";
|
|
74
|
+
readonly content: string | readonly ({
|
|
75
|
+
readonly type: "text";
|
|
76
|
+
readonly text: string;
|
|
77
|
+
readonly cache_control?: {
|
|
78
|
+
readonly type: "ephemeral";
|
|
79
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
80
|
+
} | undefined;
|
|
81
|
+
} | {
|
|
82
|
+
readonly type: "image";
|
|
83
|
+
readonly source: {
|
|
84
|
+
readonly type: "base64";
|
|
85
|
+
readonly media_type: string;
|
|
86
|
+
readonly data: string;
|
|
87
|
+
} | {
|
|
88
|
+
readonly type: "url";
|
|
89
|
+
readonly url: string;
|
|
90
|
+
} | {
|
|
91
|
+
readonly type: "file";
|
|
92
|
+
readonly file_id: string;
|
|
93
|
+
};
|
|
94
|
+
readonly cache_control?: {
|
|
95
|
+
readonly type: "ephemeral";
|
|
96
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
97
|
+
} | undefined;
|
|
98
|
+
readonly transformations?: {
|
|
99
|
+
readonly oversized_image?: "error" | "downsize" | undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
} | {
|
|
102
|
+
readonly type: "document";
|
|
103
|
+
readonly source: {
|
|
104
|
+
readonly type: "base64";
|
|
105
|
+
readonly media_type: "application/pdf";
|
|
106
|
+
readonly data: string;
|
|
107
|
+
} | {
|
|
108
|
+
readonly type: "text";
|
|
109
|
+
readonly media_type: "text/plain";
|
|
110
|
+
readonly data: string;
|
|
111
|
+
} | {
|
|
112
|
+
readonly type: "url";
|
|
113
|
+
readonly url: string;
|
|
114
|
+
} | {
|
|
115
|
+
readonly type: "file";
|
|
116
|
+
readonly file_id: string;
|
|
117
|
+
};
|
|
118
|
+
readonly title?: string | undefined;
|
|
119
|
+
readonly context?: string | undefined;
|
|
120
|
+
readonly cache_control?: {
|
|
121
|
+
readonly type: "ephemeral";
|
|
122
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
123
|
+
} | undefined;
|
|
124
|
+
readonly citations?: {
|
|
125
|
+
readonly enabled: boolean;
|
|
126
|
+
} | undefined;
|
|
127
|
+
})[];
|
|
128
|
+
readonly tool_use_id: string;
|
|
129
|
+
readonly cache_control?: {
|
|
130
|
+
readonly type: "ephemeral";
|
|
131
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
132
|
+
} | undefined;
|
|
133
|
+
readonly is_error?: boolean | undefined;
|
|
134
|
+
})[];
|
|
135
|
+
} | {
|
|
136
|
+
readonly role: "assistant";
|
|
137
|
+
readonly content: readonly ({
|
|
138
|
+
readonly type: "text";
|
|
139
|
+
readonly text: string;
|
|
140
|
+
readonly cache_control?: {
|
|
141
|
+
readonly type: "ephemeral";
|
|
142
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
143
|
+
} | undefined;
|
|
144
|
+
} | {
|
|
145
|
+
readonly id: string;
|
|
146
|
+
readonly type: "tool_use";
|
|
147
|
+
readonly name: string;
|
|
148
|
+
readonly input: unknown;
|
|
149
|
+
readonly cache_control?: {
|
|
150
|
+
readonly type: "ephemeral";
|
|
151
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
152
|
+
} | undefined;
|
|
153
|
+
} | {
|
|
154
|
+
readonly id: string;
|
|
155
|
+
readonly type: "server_tool_use";
|
|
156
|
+
readonly name: string;
|
|
157
|
+
readonly input: unknown;
|
|
158
|
+
readonly cache_control?: {
|
|
159
|
+
readonly type: "ephemeral";
|
|
160
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
161
|
+
} | undefined;
|
|
162
|
+
} | {
|
|
163
|
+
readonly type: "web_search_tool_result" | "code_execution_tool_result" | "web_fetch_tool_result";
|
|
164
|
+
readonly content: unknown;
|
|
165
|
+
readonly tool_use_id: string;
|
|
166
|
+
readonly cache_control?: {
|
|
167
|
+
readonly type: "ephemeral";
|
|
168
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
169
|
+
} | undefined;
|
|
170
|
+
} | {
|
|
171
|
+
readonly type: "thinking";
|
|
172
|
+
readonly thinking: string;
|
|
173
|
+
readonly signature: string;
|
|
174
|
+
readonly cache_control?: {
|
|
175
|
+
readonly type: "ephemeral";
|
|
176
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
177
|
+
} | undefined;
|
|
178
|
+
} | {
|
|
179
|
+
readonly data: string;
|
|
180
|
+
readonly type: "redacted_thinking";
|
|
181
|
+
readonly cache_control?: {
|
|
182
|
+
readonly type: "ephemeral";
|
|
183
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
184
|
+
} | undefined;
|
|
185
|
+
} | {
|
|
186
|
+
readonly type: "compaction";
|
|
187
|
+
readonly content: string | null;
|
|
188
|
+
})[];
|
|
189
|
+
} | {
|
|
190
|
+
readonly role: "system";
|
|
191
|
+
readonly content: readonly {
|
|
192
|
+
readonly type: "text";
|
|
193
|
+
readonly text: string;
|
|
194
|
+
readonly cache_control?: {
|
|
195
|
+
readonly type: "ephemeral";
|
|
196
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
197
|
+
} | undefined;
|
|
198
|
+
}[];
|
|
199
|
+
})[];
|
|
200
|
+
readonly stream: true;
|
|
201
|
+
readonly metadata?: {
|
|
202
|
+
readonly user_id?: string | null | undefined;
|
|
203
|
+
} | undefined;
|
|
204
|
+
readonly tools?: readonly {
|
|
205
|
+
readonly description: string;
|
|
206
|
+
readonly name: string;
|
|
207
|
+
readonly input_schema: {
|
|
208
|
+
readonly [x: string]: unknown;
|
|
209
|
+
};
|
|
210
|
+
readonly cache_control?: {
|
|
211
|
+
readonly type: "ephemeral";
|
|
212
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
213
|
+
} | undefined;
|
|
214
|
+
}[] | undefined;
|
|
215
|
+
readonly system?: readonly {
|
|
216
|
+
readonly type: "text";
|
|
217
|
+
readonly text: string;
|
|
218
|
+
readonly cache_control?: {
|
|
219
|
+
readonly type: "ephemeral";
|
|
220
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
221
|
+
} | undefined;
|
|
222
|
+
}[] | undefined;
|
|
223
|
+
readonly temperature?: number | undefined;
|
|
224
|
+
readonly thinking?: {
|
|
225
|
+
readonly type: string;
|
|
226
|
+
readonly budget_tokens?: number | undefined;
|
|
227
|
+
} | undefined;
|
|
228
|
+
readonly service_tier?: "auto" | "standard_only" | undefined;
|
|
229
|
+
readonly container?: string | {
|
|
230
|
+
readonly id?: string | null | undefined;
|
|
231
|
+
readonly skills?: readonly {
|
|
232
|
+
readonly [x: string]: unknown;
|
|
233
|
+
}[] | null | undefined;
|
|
234
|
+
} | null | undefined;
|
|
235
|
+
readonly inference_geo?: string | null | undefined;
|
|
236
|
+
readonly cache_control?: {
|
|
237
|
+
readonly type: "ephemeral";
|
|
238
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
239
|
+
} | undefined;
|
|
240
|
+
readonly output_config?: {
|
|
241
|
+
readonly format?: {
|
|
242
|
+
readonly type: "json_schema";
|
|
243
|
+
readonly schema: {
|
|
244
|
+
readonly [x: string]: unknown;
|
|
245
|
+
};
|
|
246
|
+
} | null | undefined;
|
|
247
|
+
readonly effort?: string | undefined;
|
|
248
|
+
} | undefined;
|
|
249
|
+
readonly context_management?: {
|
|
250
|
+
readonly edits: readonly {
|
|
251
|
+
readonly type: "compact_20260112";
|
|
252
|
+
readonly instructions?: string | undefined;
|
|
253
|
+
readonly trigger?: {
|
|
254
|
+
readonly type: "input_tokens";
|
|
255
|
+
readonly value: number;
|
|
256
|
+
} | undefined;
|
|
257
|
+
readonly pause_after_compaction?: boolean | undefined;
|
|
258
|
+
}[];
|
|
259
|
+
} | undefined;
|
|
260
|
+
readonly tool_choice?: {
|
|
261
|
+
readonly type: "auto" | "none" | "any";
|
|
262
|
+
readonly disable_parallel_tool_use?: boolean | undefined;
|
|
263
|
+
} | {
|
|
264
|
+
readonly type: "tool";
|
|
265
|
+
readonly name: string;
|
|
266
|
+
readonly disable_parallel_tool_use?: boolean | undefined;
|
|
267
|
+
} | undefined;
|
|
268
|
+
readonly top_p?: number | undefined;
|
|
269
|
+
readonly top_k?: number | undefined;
|
|
270
|
+
readonly stop_sequences?: readonly string[] | undefined;
|
|
271
|
+
}, string, {
|
|
272
|
+
readonly type: string;
|
|
273
|
+
readonly message?: {
|
|
274
|
+
readonly usage?: {
|
|
275
|
+
readonly [x: string]: unknown;
|
|
276
|
+
readonly input_tokens?: number | null | undefined;
|
|
277
|
+
readonly server_tool_use?: {
|
|
278
|
+
readonly [x: string]: unknown;
|
|
279
|
+
readonly web_search_requests?: number | undefined;
|
|
280
|
+
} | null | undefined;
|
|
281
|
+
readonly output_tokens?: number | undefined;
|
|
282
|
+
readonly cache_creation_input_tokens?: number | null | undefined;
|
|
283
|
+
readonly cache_read_input_tokens?: number | null | undefined;
|
|
284
|
+
readonly output_tokens_details?: {
|
|
285
|
+
readonly [x: string]: unknown;
|
|
286
|
+
readonly thinking_tokens?: number | undefined;
|
|
287
|
+
} | null | undefined;
|
|
288
|
+
readonly iterations?: readonly {
|
|
289
|
+
readonly [x: string]: unknown;
|
|
290
|
+
readonly input_tokens?: number | null | undefined;
|
|
291
|
+
readonly server_tool_use?: {
|
|
292
|
+
readonly [x: string]: unknown;
|
|
293
|
+
readonly web_search_requests?: number | undefined;
|
|
294
|
+
} | null | undefined;
|
|
295
|
+
readonly output_tokens?: number | undefined;
|
|
296
|
+
readonly cache_creation_input_tokens?: number | null | undefined;
|
|
297
|
+
readonly cache_read_input_tokens?: number | null | undefined;
|
|
298
|
+
readonly output_tokens_details?: {
|
|
299
|
+
readonly [x: string]: unknown;
|
|
300
|
+
readonly thinking_tokens?: number | undefined;
|
|
301
|
+
} | null | undefined;
|
|
302
|
+
}[] | undefined;
|
|
303
|
+
} | undefined;
|
|
304
|
+
} | undefined;
|
|
305
|
+
readonly error?: {
|
|
306
|
+
readonly type?: string | undefined;
|
|
307
|
+
readonly message?: string | undefined;
|
|
308
|
+
} | undefined;
|
|
309
|
+
readonly delta?: unknown;
|
|
310
|
+
readonly index?: number | undefined;
|
|
311
|
+
readonly usage?: {
|
|
312
|
+
readonly [x: string]: unknown;
|
|
313
|
+
readonly input_tokens?: number | null | undefined;
|
|
314
|
+
readonly server_tool_use?: {
|
|
315
|
+
readonly [x: string]: unknown;
|
|
316
|
+
readonly web_search_requests?: number | undefined;
|
|
317
|
+
} | null | undefined;
|
|
318
|
+
readonly output_tokens?: number | undefined;
|
|
319
|
+
readonly cache_creation_input_tokens?: number | null | undefined;
|
|
320
|
+
readonly cache_read_input_tokens?: number | null | undefined;
|
|
321
|
+
readonly output_tokens_details?: {
|
|
322
|
+
readonly [x: string]: unknown;
|
|
323
|
+
readonly thinking_tokens?: number | undefined;
|
|
324
|
+
} | null | undefined;
|
|
325
|
+
readonly iterations?: readonly {
|
|
326
|
+
readonly [x: string]: unknown;
|
|
327
|
+
readonly input_tokens?: number | null | undefined;
|
|
328
|
+
readonly server_tool_use?: {
|
|
329
|
+
readonly [x: string]: unknown;
|
|
330
|
+
readonly web_search_requests?: number | undefined;
|
|
331
|
+
} | null | undefined;
|
|
332
|
+
readonly output_tokens?: number | undefined;
|
|
333
|
+
readonly cache_creation_input_tokens?: number | null | undefined;
|
|
334
|
+
readonly cache_read_input_tokens?: number | null | undefined;
|
|
335
|
+
readonly output_tokens_details?: {
|
|
336
|
+
readonly [x: string]: unknown;
|
|
337
|
+
readonly thinking_tokens?: number | undefined;
|
|
338
|
+
} | null | undefined;
|
|
339
|
+
}[] | undefined;
|
|
340
|
+
} | undefined;
|
|
341
|
+
readonly content_block?: unknown;
|
|
342
|
+
}, {
|
|
343
|
+
provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
344
|
+
compactions: {};
|
|
345
|
+
providerMetadataKey: string;
|
|
346
|
+
tools: Partial<Record<number, import("./utils/tool-stream.js").PendingTool>>;
|
|
347
|
+
reasoningSignatures: {};
|
|
348
|
+
lifecycle: import("./utils/lifecycle.js").State;
|
|
349
|
+
}>;
|
|
350
|
+
export * as AlibabaMessages from "./alibaba-messages.js";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import { Protocol } from "../route/protocol.js";
|
|
3
|
+
import { LLMRequest } from "../schema/index.js";
|
|
4
|
+
import { AnthropicMessages } from "./anthropic-messages.js";
|
|
5
|
+
import { ProviderShared } from "./shared.js";
|
|
6
|
+
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
7
|
+
const Options = Schema.Struct({
|
|
8
|
+
effort: Schema.optional(OpenResponsesOptions.ReasoningEffort),
|
|
9
|
+
thinking: Schema.optional(Schema.Struct({
|
|
10
|
+
type: Schema.declare(Schema.is(Schema.String)),
|
|
11
|
+
budgetTokens: Schema.optional(Schema.Int),
|
|
12
|
+
budget_tokens: Schema.optional(Schema.Int),
|
|
13
|
+
})),
|
|
14
|
+
});
|
|
15
|
+
export const protocol = Protocol.make({
|
|
16
|
+
id: "alibaba-messages",
|
|
17
|
+
body: {
|
|
18
|
+
schema: Schema.Struct({
|
|
19
|
+
...AnthropicMessages.AnthropicMessagesBody.fields,
|
|
20
|
+
thinking: Schema.optional(Schema.Struct({ type: Schema.String, budget_tokens: Schema.optional(Schema.Int) })),
|
|
21
|
+
}),
|
|
22
|
+
from: Effect.fn("AlibabaMessages.fromRequest")(function* (req) {
|
|
23
|
+
const opts = yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(Options))(req.providerOptions ?? {});
|
|
24
|
+
// Model Studio accepts enabled thinking without Anthropic's mandatory token budget.
|
|
25
|
+
return {
|
|
26
|
+
...(yield* AnthropicMessages.protocol.body.from(LLMRequest.update(req, {
|
|
27
|
+
providerOptions: { ...req.providerOptions, thinking: undefined },
|
|
28
|
+
}))),
|
|
29
|
+
thinking: opts.thinking === undefined
|
|
30
|
+
? undefined
|
|
31
|
+
: {
|
|
32
|
+
type: opts.thinking.type,
|
|
33
|
+
budget_tokens: opts.thinking.budgetTokens ?? opts.thinking.budget_tokens,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
stream: AnthropicMessages.protocol.stream,
|
|
39
|
+
});
|
|
40
|
+
export * as AlibabaMessages from "./alibaba-messages.js";
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Protocol } from "../route/protocol.js";
|
|
3
|
+
import { OpenResponses } from "./open-responses.js";
|
|
4
|
+
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
5
|
+
declare const Options: Schema.Struct<{
|
|
6
|
+
readonly reasoningEffort: Schema.optional<Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>>;
|
|
7
|
+
readonly enableThinking: Schema.optional<Schema.Boolean>;
|
|
8
|
+
readonly store: Schema.optional<Schema.Boolean>;
|
|
9
|
+
readonly previousResponseId: Schema.optional<Schema.String>;
|
|
10
|
+
readonly conversation: Schema.optional<Schema.String>;
|
|
11
|
+
}>;
|
|
12
|
+
export type OptionsInput = typeof Options.Type;
|
|
13
|
+
export declare const protocol: Protocol<{
|
|
14
|
+
readonly input: readonly ({
|
|
15
|
+
readonly [x: string]: unknown;
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly type: "web_search_call";
|
|
18
|
+
readonly status?: string | undefined;
|
|
19
|
+
readonly action?: {
|
|
20
|
+
readonly [x: string]: unknown;
|
|
21
|
+
} | null | undefined;
|
|
22
|
+
} | {
|
|
23
|
+
readonly [x: string]: unknown;
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly type: "file_search_call";
|
|
26
|
+
readonly status?: string | undefined;
|
|
27
|
+
readonly queries?: readonly string[] | undefined;
|
|
28
|
+
readonly results?: readonly {
|
|
29
|
+
readonly [x: string]: unknown;
|
|
30
|
+
}[] | null | undefined;
|
|
31
|
+
} | {
|
|
32
|
+
readonly [x: string]: unknown;
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly type: "code_interpreter_call";
|
|
35
|
+
readonly status?: string | undefined;
|
|
36
|
+
readonly code?: string | null | undefined;
|
|
37
|
+
readonly container_id?: string | null | undefined;
|
|
38
|
+
readonly outputs?: readonly {
|
|
39
|
+
readonly [x: string]: unknown;
|
|
40
|
+
}[] | null | undefined;
|
|
41
|
+
} | {
|
|
42
|
+
readonly [x: string]: unknown;
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly type: "mcp_call";
|
|
45
|
+
readonly status?: string | undefined;
|
|
46
|
+
readonly name?: string | undefined;
|
|
47
|
+
readonly output?: string | null | undefined;
|
|
48
|
+
readonly error?: unknown;
|
|
49
|
+
readonly arguments?: string | undefined;
|
|
50
|
+
readonly server_label?: string | undefined;
|
|
51
|
+
} | {
|
|
52
|
+
readonly type: "reasoning";
|
|
53
|
+
readonly summary: readonly {
|
|
54
|
+
readonly type: "summary_text";
|
|
55
|
+
readonly text: string;
|
|
56
|
+
}[];
|
|
57
|
+
readonly id?: string | undefined;
|
|
58
|
+
readonly encrypted_content?: string | null | undefined;
|
|
59
|
+
} | {
|
|
60
|
+
readonly type: "compaction";
|
|
61
|
+
readonly encrypted_content: string;
|
|
62
|
+
readonly id?: string | null | undefined;
|
|
63
|
+
} | {
|
|
64
|
+
readonly role: "system";
|
|
65
|
+
readonly content: string;
|
|
66
|
+
} | {
|
|
67
|
+
readonly role: "developer";
|
|
68
|
+
readonly content: string;
|
|
69
|
+
} | {
|
|
70
|
+
readonly content: readonly ({
|
|
71
|
+
readonly type: "input_image";
|
|
72
|
+
readonly image_url: string;
|
|
73
|
+
readonly detail?: string | undefined;
|
|
74
|
+
} | {
|
|
75
|
+
readonly type: "input_file";
|
|
76
|
+
readonly filename: string;
|
|
77
|
+
readonly detail?: string | undefined;
|
|
78
|
+
readonly file_data?: string | undefined;
|
|
79
|
+
readonly file_url?: string | undefined;
|
|
80
|
+
} | {
|
|
81
|
+
readonly type: "input_text";
|
|
82
|
+
readonly text: string;
|
|
83
|
+
})[];
|
|
84
|
+
readonly role: "user";
|
|
85
|
+
readonly id?: string | undefined;
|
|
86
|
+
readonly type?: "message" | undefined;
|
|
87
|
+
readonly status?: string | undefined;
|
|
88
|
+
} | {
|
|
89
|
+
readonly type: "message";
|
|
90
|
+
readonly content: readonly {
|
|
91
|
+
readonly type: "output_text";
|
|
92
|
+
readonly text: string;
|
|
93
|
+
}[];
|
|
94
|
+
readonly role: "assistant";
|
|
95
|
+
readonly id?: string | undefined;
|
|
96
|
+
readonly status?: string | undefined;
|
|
97
|
+
readonly phase?: "commentary" | "final_answer" | null | undefined;
|
|
98
|
+
} | {
|
|
99
|
+
readonly type: "function_call";
|
|
100
|
+
readonly name: string;
|
|
101
|
+
readonly arguments: string;
|
|
102
|
+
readonly call_id: string;
|
|
103
|
+
readonly id?: string | undefined;
|
|
104
|
+
readonly namespace?: string | undefined;
|
|
105
|
+
} | {
|
|
106
|
+
readonly type: "function_call_output";
|
|
107
|
+
readonly call_id: string;
|
|
108
|
+
readonly output: string | readonly ({
|
|
109
|
+
readonly type: "input_image";
|
|
110
|
+
readonly image_url: string;
|
|
111
|
+
readonly detail?: string | undefined;
|
|
112
|
+
} | {
|
|
113
|
+
readonly type: "input_file";
|
|
114
|
+
readonly filename: string;
|
|
115
|
+
readonly detail?: string | undefined;
|
|
116
|
+
readonly file_data?: string | undefined;
|
|
117
|
+
readonly file_url?: string | undefined;
|
|
118
|
+
} | {
|
|
119
|
+
readonly type: "input_text";
|
|
120
|
+
readonly text: string;
|
|
121
|
+
} | {
|
|
122
|
+
readonly type: "input_video";
|
|
123
|
+
readonly video_url: string;
|
|
124
|
+
})[];
|
|
125
|
+
} | {
|
|
126
|
+
readonly [x: string]: unknown;
|
|
127
|
+
readonly id: string;
|
|
128
|
+
readonly type: "web_extractor_call";
|
|
129
|
+
readonly urls?: readonly string[] | undefined;
|
|
130
|
+
readonly goal?: string | undefined;
|
|
131
|
+
})[];
|
|
132
|
+
readonly model: string;
|
|
133
|
+
readonly stream: true;
|
|
134
|
+
readonly metadata?: {
|
|
135
|
+
readonly [x: string]: string;
|
|
136
|
+
} | undefined;
|
|
137
|
+
readonly instructions?: string | undefined;
|
|
138
|
+
readonly reasoning?: {
|
|
139
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
140
|
+
readonly effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
141
|
+
} | undefined;
|
|
142
|
+
readonly tools?: readonly ({
|
|
143
|
+
readonly type: "function";
|
|
144
|
+
readonly description: string;
|
|
145
|
+
readonly name: string;
|
|
146
|
+
readonly parameters: {
|
|
147
|
+
readonly [x: string]: unknown;
|
|
148
|
+
};
|
|
149
|
+
readonly strict?: boolean | undefined;
|
|
150
|
+
} | {
|
|
151
|
+
readonly type: "web_search" | "code_interpreter" | "web_extractor";
|
|
152
|
+
})[] | undefined;
|
|
153
|
+
readonly text?: {
|
|
154
|
+
readonly verbosity?: OpenResponsesOptions.TextVerbosity | undefined;
|
|
155
|
+
} | undefined;
|
|
156
|
+
readonly temperature?: number | undefined;
|
|
157
|
+
readonly service_tier?: OpenResponsesOptions.ServiceTier | undefined;
|
|
158
|
+
readonly tool_choice?: "required" | "auto" | "none" | {
|
|
159
|
+
readonly type: "function";
|
|
160
|
+
readonly name: string;
|
|
161
|
+
} | {
|
|
162
|
+
readonly type: "allowed_tools";
|
|
163
|
+
readonly mode: "required" | "auto" | "none";
|
|
164
|
+
readonly tools: readonly {
|
|
165
|
+
readonly type: "function";
|
|
166
|
+
readonly name: string;
|
|
167
|
+
}[];
|
|
168
|
+
} | undefined;
|
|
169
|
+
readonly top_p?: number | undefined;
|
|
170
|
+
readonly frequency_penalty?: number | undefined;
|
|
171
|
+
readonly presence_penalty?: number | undefined;
|
|
172
|
+
readonly prompt_cache_key?: string | undefined;
|
|
173
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
174
|
+
readonly store?: boolean | undefined;
|
|
175
|
+
readonly include?: readonly OpenResponsesOptions.ResponseIncludable[] | undefined;
|
|
176
|
+
readonly truncation?: "auto" | "disabled" | undefined;
|
|
177
|
+
readonly stream_options?: {
|
|
178
|
+
readonly include_obfuscation?: boolean | undefined;
|
|
179
|
+
} | undefined;
|
|
180
|
+
readonly safety_identifier?: string | undefined;
|
|
181
|
+
readonly top_logprobs?: number | undefined;
|
|
182
|
+
readonly max_output_tokens?: number | undefined;
|
|
183
|
+
readonly max_tool_calls?: number | undefined;
|
|
184
|
+
readonly previous_response_id?: string | undefined;
|
|
185
|
+
readonly conversation?: string | undefined;
|
|
186
|
+
readonly enable_thinking?: boolean | undefined;
|
|
187
|
+
}, string, {
|
|
188
|
+
readonly [x: string]: unknown;
|
|
189
|
+
readonly type: string;
|
|
190
|
+
readonly status?: unknown;
|
|
191
|
+
readonly code?: string | null | undefined;
|
|
192
|
+
readonly message?: string | undefined;
|
|
193
|
+
readonly headers?: unknown;
|
|
194
|
+
readonly text?: string | undefined;
|
|
195
|
+
readonly error?: {
|
|
196
|
+
readonly type?: string | null | undefined;
|
|
197
|
+
readonly code?: string | null | undefined;
|
|
198
|
+
readonly message?: string | null | undefined;
|
|
199
|
+
readonly param?: string | null | undefined;
|
|
200
|
+
} | null | undefined;
|
|
201
|
+
readonly item?: {
|
|
202
|
+
readonly [x: string]: unknown;
|
|
203
|
+
readonly type: string;
|
|
204
|
+
readonly id?: string | undefined;
|
|
205
|
+
readonly name?: string | undefined;
|
|
206
|
+
readonly namespace?: string | undefined;
|
|
207
|
+
readonly arguments?: string | undefined;
|
|
208
|
+
readonly encrypted_content?: string | null | undefined;
|
|
209
|
+
readonly call_id?: string | undefined;
|
|
210
|
+
} | null | undefined;
|
|
211
|
+
readonly delta?: string | undefined;
|
|
212
|
+
readonly response?: {
|
|
213
|
+
readonly [x: string]: unknown;
|
|
214
|
+
readonly id?: string | undefined;
|
|
215
|
+
readonly output?: readonly {
|
|
216
|
+
readonly [x: string]: unknown;
|
|
217
|
+
readonly type: string;
|
|
218
|
+
readonly id?: string | undefined;
|
|
219
|
+
readonly name?: string | undefined;
|
|
220
|
+
readonly namespace?: string | undefined;
|
|
221
|
+
readonly arguments?: string | undefined;
|
|
222
|
+
readonly encrypted_content?: string | null | undefined;
|
|
223
|
+
readonly call_id?: string | undefined;
|
|
224
|
+
}[] | undefined;
|
|
225
|
+
readonly error?: {
|
|
226
|
+
readonly type?: string | null | undefined;
|
|
227
|
+
readonly code?: string | null | undefined;
|
|
228
|
+
readonly message?: string | null | undefined;
|
|
229
|
+
readonly param?: string | null | undefined;
|
|
230
|
+
} | null | undefined;
|
|
231
|
+
readonly usage?: {
|
|
232
|
+
readonly input_tokens?: number | undefined;
|
|
233
|
+
readonly output_tokens?: number | undefined;
|
|
234
|
+
readonly output_tokens_details?: {
|
|
235
|
+
readonly reasoning_tokens?: number | undefined;
|
|
236
|
+
} | null | undefined;
|
|
237
|
+
readonly total_tokens?: number | undefined;
|
|
238
|
+
readonly input_tokens_details?: {
|
|
239
|
+
readonly cached_tokens?: number | undefined;
|
|
240
|
+
readonly cache_write_tokens?: number | undefined;
|
|
241
|
+
} | null | undefined;
|
|
242
|
+
} | null | undefined;
|
|
243
|
+
readonly service_tier?: string | null | undefined;
|
|
244
|
+
readonly incomplete_details?: {
|
|
245
|
+
readonly reason?: string | undefined;
|
|
246
|
+
} | null | undefined;
|
|
247
|
+
} | undefined;
|
|
248
|
+
readonly arguments?: string | undefined;
|
|
249
|
+
readonly param?: string | null | undefined;
|
|
250
|
+
readonly status_code?: unknown;
|
|
251
|
+
readonly item_id?: string | undefined;
|
|
252
|
+
readonly output_index?: number | undefined;
|
|
253
|
+
readonly summary_index?: number | undefined;
|
|
254
|
+
}, OpenResponses.ParserState>;
|
|
255
|
+
export * as AlibabaResponses from "./alibaba-responses.js";
|