@arcships/aimux 0.5.0 → 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 +92 -0
- package/dist/error.d.ts +28 -137
- package/dist/error.js +71 -100
- package/dist/generated/ops.d.ts +75 -0
- package/dist/generated/ops.js +80 -0
- package/dist/generated/types.d.ts +5607 -0
- package/dist/{types/CallOptions.js → generated/types.js} +1 -0
- package/dist/index.d.ts +144 -211
- package/dist/index.js +314 -344
- package/dist/native.d.ts +29 -1
- package/dist/native.js +99 -29
- package/dist/types.d.ts +1 -144
- package/dist/types.js +0 -3
- package/index.d.ts +21 -545
- package/index.js +57 -112
- package/package.json +16 -13
- package/dist/types/AiMuxError.d.ts +0 -66
- package/dist/types/AiMuxError.js +0 -2
- package/dist/types/ApiCallError.d.ts +0 -75
- package/dist/types/ApiCallError.js +0 -2
- package/dist/types/AspectRatio.d.ts +0 -11
- package/dist/types/AspectRatio.js +0 -3
- package/dist/types/AudioChunk.d.ts +0 -8
- package/dist/types/AudioChunk.js +0 -3
- package/dist/types/AudioData.d.ts +0 -11
- package/dist/types/AudioData.js +0 -3
- package/dist/types/AudioInput.d.ts +0 -8
- package/dist/types/AudioInput.js +0 -3
- package/dist/types/BreakKind.d.ts +0 -1
- package/dist/types/BreakKind.js +0 -3
- package/dist/types/CallOptions.d.ts +0 -117
- package/dist/types/CatalogueSource.d.ts +0 -4
- package/dist/types/CatalogueSource.js +0 -3
- package/dist/types/ChatCompletion.d.ts +0 -16
- package/dist/types/ChatCompletion.js +0 -2
- package/dist/types/ChatCompletionChoice.d.ts +0 -8
- package/dist/types/ChatCompletionChoice.js +0 -2
- package/dist/types/ChatCompletionChunk.d.ts +0 -15
- package/dist/types/ChatCompletionChunk.js +0 -2
- package/dist/types/ChatCompletionChunkChoice.d.ts +0 -8
- package/dist/types/ChatCompletionChunkChoice.js +0 -2
- package/dist/types/ChatCompletionChunkFunction.d.ts +0 -4
- package/dist/types/ChatCompletionChunkFunction.js +0 -3
- package/dist/types/ChatCompletionChunkToolCall.d.ts +0 -7
- package/dist/types/ChatCompletionChunkToolCall.js +0 -2
- package/dist/types/ChatCompletionDelta.d.ts +0 -7
- package/dist/types/ChatCompletionDelta.js +0 -2
- package/dist/types/ChatCompletionFunction.d.ts +0 -4
- package/dist/types/ChatCompletionFunction.js +0 -3
- package/dist/types/ChatCompletionMessage.d.ts +0 -9
- package/dist/types/ChatCompletionMessage.js +0 -2
- package/dist/types/ChatCompletionToolCall.d.ts +0 -6
- package/dist/types/ChatCompletionToolCall.js +0 -2
- package/dist/types/ChatCompletionUsage.d.ts +0 -9
- package/dist/types/ChatCompletionUsage.js +0 -2
- package/dist/types/CompletionTokensDetails.d.ts +0 -3
- package/dist/types/CompletionTokensDetails.js +0 -3
- package/dist/types/ContentPart.d.ts +0 -112
- package/dist/types/ContentPart.js +0 -2
- package/dist/types/EmbeddingCallOptions.d.ts +0 -33
- package/dist/types/EmbeddingCallOptions.js +0 -2
- package/dist/types/EmbeddingResponse.d.ts +0 -16
- package/dist/types/EmbeddingResponse.js +0 -2
- package/dist/types/EmbeddingResult.d.ts +0 -33
- package/dist/types/EmbeddingResult.js +0 -2
- package/dist/types/EmbeddingUsage.d.ts +0 -9
- package/dist/types/EmbeddingUsage.js +0 -3
- package/dist/types/FileBytes.d.ts +0 -12
- package/dist/types/FileBytes.js +0 -3
- package/dist/types/FileData.d.ts +0 -25
- package/dist/types/FileData.js +0 -2
- package/dist/types/FilePart.d.ts +0 -8
- package/dist/types/FilePart.js +0 -2
- package/dist/types/Fingerprint.d.ts +0 -21
- package/dist/types/Fingerprint.js +0 -3
- package/dist/types/FinishReason.d.ts +0 -14
- package/dist/types/FinishReason.js +0 -2
- package/dist/types/FinishReasonUnified.d.ts +0 -4
- package/dist/types/FinishReasonUnified.js +0 -3
- package/dist/types/FunctionTool.d.ts +0 -35
- package/dist/types/FunctionTool.js +0 -2
- package/dist/types/GenerateContent.d.ts +0 -88
- package/dist/types/GenerateContent.js +0 -2
- package/dist/types/GenerateObjectResult.d.ts +0 -48
- package/dist/types/GenerateObjectResult.js +0 -2
- package/dist/types/GenerateResult.d.ts +0 -45
- package/dist/types/GenerateResult.js +0 -2
- package/dist/types/GenerateTextOptions.d.ts +0 -62
- package/dist/types/GenerateTextOptions.js +0 -2
- package/dist/types/GenerateTextResult.d.ts +0 -81
- package/dist/types/GenerateTextResult.js +0 -2
- package/dist/types/HttpExchange.d.ts +0 -34
- package/dist/types/HttpExchange.js +0 -2
- package/dist/types/HttpRecord.d.ts +0 -12
- package/dist/types/HttpRecord.js +0 -3
- package/dist/types/ImageCallOptions.d.ts +0 -63
- package/dist/types/ImageCallOptions.js +0 -2
- package/dist/types/ImageFile.d.ts +0 -25
- package/dist/types/ImageFile.js +0 -2
- package/dist/types/ImageFileData.d.ts +0 -8
- package/dist/types/ImageFileData.js +0 -3
- package/dist/types/ImageOutputs.d.ts +0 -14
- package/dist/types/ImageOutputs.js +0 -3
- package/dist/types/ImageResponse.d.ts +0 -19
- package/dist/types/ImageResponse.js +0 -3
- package/dist/types/ImageResult.d.ts +0 -34
- package/dist/types/ImageResult.js +0 -2
- package/dist/types/ImageUsage.d.ts +0 -19
- package/dist/types/ImageUsage.js +0 -3
- package/dist/types/InputAudioFormat.d.ts +0 -13
- package/dist/types/InputAudioFormat.js +0 -3
- package/dist/types/InputRecord.d.ts +0 -16
- package/dist/types/InputRecord.js +0 -2
- package/dist/types/LanguageModelPromptMessage.d.ts +0 -20
- package/dist/types/LanguageModelPromptMessage.js +0 -2
- package/dist/types/MessageContent.d.ts +0 -5
- package/dist/types/MessageContent.js +0 -2
- package/dist/types/Modality.d.ts +0 -4
- package/dist/types/Modality.js +0 -3
- package/dist/types/ModelCapabilities.d.ts +0 -21
- package/dist/types/ModelCapabilities.js +0 -3
- package/dist/types/ModelCost.d.ts +0 -10
- package/dist/types/ModelCost.js +0 -3
- package/dist/types/ModelId.d.ts +0 -7
- package/dist/types/ModelId.js +0 -3
- package/dist/types/ModelLimits.d.ts +0 -17
- package/dist/types/ModelLimits.js +0 -3
- package/dist/types/ModelMessage.d.ts +0 -9
- package/dist/types/ModelMessage.js +0 -2
- package/dist/types/ModelModalities.d.ts +0 -8
- package/dist/types/ModelModalities.js +0 -2
- package/dist/types/ModelPrompt.d.ts +0 -7
- package/dist/types/ModelPrompt.js +0 -2
- package/dist/types/ModelSpec.d.ts +0 -33
- package/dist/types/ModelSpec.js +0 -2
- package/dist/types/ModelType.d.ts +0 -4
- package/dist/types/ModelType.js +0 -3
- package/dist/types/OutcomeRecord.d.ts +0 -19
- package/dist/types/OutcomeRecord.js +0 -2
- package/dist/types/OutcomeStatus.d.ts +0 -4
- package/dist/types/OutcomeStatus.js +0 -3
- package/dist/types/PrefixBreak.d.ts +0 -11
- package/dist/types/PrefixBreak.js +0 -2
- package/dist/types/PromptTokensDetails.d.ts +0 -4
- package/dist/types/PromptTokensDetails.js +0 -3
- package/dist/types/ProviderAuditSpec.d.ts +0 -33
- package/dist/types/ProviderAuditSpec.js +0 -2
- package/dist/types/ProviderFamily.d.ts +0 -5
- package/dist/types/ProviderFamily.js +0 -3
- package/dist/types/ProviderName.d.ts +0 -258
- package/dist/types/ProviderName.js +0 -262
- package/dist/types/ProviderRecord.d.ts +0 -30
- package/dist/types/ProviderRecord.js +0 -2
- package/dist/types/ProviderTool.d.ts +0 -24
- package/dist/types/ProviderTool.js +0 -2
- package/dist/types/RawToolCall.d.ts +0 -16
- package/dist/types/RawToolCall.js +0 -2
- package/dist/types/ReasoningEffort.d.ts +0 -7
- package/dist/types/ReasoningEffort.js +0 -3
- package/dist/types/ReasoningMode.d.ts +0 -4
- package/dist/types/ReasoningMode.js +0 -3
- package/dist/types/ReasoningPart.d.ts +0 -9
- package/dist/types/ReasoningPart.js +0 -3
- package/dist/types/ReasoningSpec.d.ts +0 -39
- package/dist/types/ReasoningSpec.js +0 -2
- package/dist/types/ReasoningVisibility.d.ts +0 -4
- package/dist/types/ReasoningVisibility.js +0 -3
- package/dist/types/Recording.d.ts +0 -56
- package/dist/types/Recording.js +0 -2
- package/dist/types/RequestCacheHints.d.ts +0 -9
- package/dist/types/RequestCacheHints.js +0 -3
- package/dist/types/RequestInfo.d.ts +0 -12
- package/dist/types/RequestInfo.js +0 -2
- package/dist/types/RerankingCallOptions.d.ts +0 -42
- package/dist/types/RerankingCallOptions.js +0 -2
- package/dist/types/RerankingDocuments.d.ts +0 -15
- package/dist/types/RerankingDocuments.js +0 -2
- package/dist/types/RerankingRank.d.ts +0 -13
- package/dist/types/RerankingRank.js +0 -3
- package/dist/types/RerankingResponse.d.ts +0 -28
- package/dist/types/RerankingResponse.js +0 -2
- package/dist/types/RerankingResult.d.ts +0 -31
- package/dist/types/RerankingResult.js +0 -2
- package/dist/types/ResponseFormat.d.ts +0 -11
- package/dist/types/ResponseFormat.js +0 -2
- package/dist/types/ResponseInfo.d.ts +0 -30
- package/dist/types/ResponseInfo.js +0 -2
- package/dist/types/ResponseMetadata.d.ts +0 -8
- package/dist/types/ResponseMetadata.js +0 -3
- package/dist/types/ResponseRecord.d.ts +0 -13
- package/dist/types/ResponseRecord.js +0 -3
- package/dist/types/RetryError.d.ts +0 -9
- package/dist/types/RetryError.js +0 -2
- package/dist/types/RetryErrorReason.d.ts +0 -4
- package/dist/types/RetryErrorReason.js +0 -3
- package/dist/types/Role.d.ts +0 -4
- package/dist/types/Role.js +0 -3
- package/dist/types/RuntimeModel.d.ts +0 -22
- package/dist/types/RuntimeModel.js +0 -3
- package/dist/types/SearchCallOptions.d.ts +0 -55
- package/dist/types/SearchCallOptions.js +0 -2
- package/dist/types/SearchResponse.d.ts +0 -16
- package/dist/types/SearchResponse.js +0 -2
- package/dist/types/SearchResult.d.ts +0 -32
- package/dist/types/SearchResult.js +0 -2
- package/dist/types/SearchResultItem.d.ts +0 -33
- package/dist/types/SearchResultItem.js +0 -2
- package/dist/types/SessionCall.d.ts +0 -20
- package/dist/types/SessionCall.js +0 -3
- package/dist/types/SessionChainView.d.ts +0 -10
- package/dist/types/SessionChainView.js +0 -2
- package/dist/types/SessionSource.d.ts +0 -4
- package/dist/types/SessionSource.js +0 -3
- package/dist/types/SessionStepStat.d.ts +0 -27
- package/dist/types/SessionStepStat.js +0 -2
- package/dist/types/SessionView.d.ts +0 -16
- package/dist/types/SessionView.js +0 -2
- package/dist/types/Size.d.ts +0 -11
- package/dist/types/Size.js +0 -3
- package/dist/types/SourcePart.d.ts +0 -9
- package/dist/types/SourcePart.js +0 -3
- package/dist/types/SpeechCallOptions.d.ts +0 -56
- package/dist/types/SpeechCallOptions.js +0 -2
- package/dist/types/SpeechRequest.d.ts +0 -10
- package/dist/types/SpeechRequest.js +0 -2
- package/dist/types/SpeechResponse.d.ts +0 -24
- package/dist/types/SpeechResponse.js +0 -2
- package/dist/types/SpeechResult.d.ts +0 -34
- package/dist/types/SpeechResult.js +0 -2
- package/dist/types/StreamPart.d.ts +0 -173
- package/dist/types/StreamPart.js +0 -2
- package/dist/types/StreamTextResultAggregated.d.ts +0 -74
- package/dist/types/StreamTextResultAggregated.js +0 -2
- package/dist/types/TimeoutConfiguration.d.ts +0 -32
- package/dist/types/TimeoutConfiguration.js +0 -3
- package/dist/types/TimingRecord.d.ts +0 -7
- package/dist/types/TimingRecord.js +0 -3
- package/dist/types/TokenUsage.d.ts +0 -29
- package/dist/types/TokenUsage.js +0 -3
- package/dist/types/Tool.d.ts +0 -12
- package/dist/types/Tool.js +0 -2
- package/dist/types/ToolCall.d.ts +0 -48
- package/dist/types/ToolCall.js +0 -2
- package/dist/types/ToolCallRepairReply.d.ts +0 -19
- package/dist/types/ToolCallRepairReply.js +0 -2
- package/dist/types/ToolChoice.d.ts +0 -12
- package/dist/types/ToolChoice.js +0 -3
- package/dist/types/ToolResult.d.ts +0 -22
- package/dist/types/ToolResult.js +0 -2
- package/dist/types/TraceFilter.d.ts +0 -9
- package/dist/types/TraceFilter.js +0 -3
- package/dist/types/TraceRecord.d.ts +0 -54
- package/dist/types/TraceRecord.js +0 -2
- package/dist/types/TraceStats.d.ts +0 -20
- package/dist/types/TraceStats.js +0 -3
- package/dist/types/TranscriptionCallOptions.d.ts +0 -38
- package/dist/types/TranscriptionCallOptions.js +0 -2
- package/dist/types/TranscriptionRequest.d.ts +0 -9
- package/dist/types/TranscriptionRequest.js +0 -3
- package/dist/types/TranscriptionResponse.d.ts +0 -24
- package/dist/types/TranscriptionResponse.js +0 -2
- package/dist/types/TranscriptionResult.d.ts +0 -46
- package/dist/types/TranscriptionResult.js +0 -2
- package/dist/types/TranscriptionSegment.d.ts +0 -17
- package/dist/types/TranscriptionSegment.js +0 -3
- package/dist/types/TranscriptionStreamPart.d.ts +0 -70
- package/dist/types/TranscriptionStreamPart.js +0 -2
- package/dist/types/UploadFileCallOptions.d.ts +0 -27
- package/dist/types/UploadFileCallOptions.js +0 -2
- package/dist/types/UploadFileData.d.ts +0 -17
- package/dist/types/UploadFileData.js +0 -2
- package/dist/types/UploadFileResult.d.ts +0 -35
- package/dist/types/UploadFileResult.js +0 -2
- package/dist/types/Usage.d.ts +0 -13
- package/dist/types/Usage.js +0 -2
- package/dist/types/UsageSnapshot.d.ts +0 -18
- package/dist/types/UsageSnapshot.js +0 -2
- package/dist/types/Verdict.d.ts +0 -23
- package/dist/types/Verdict.js +0 -2
- package/dist/types/VerdictConfidence.d.ts +0 -4
- package/dist/types/VerdictConfidence.js +0 -3
- package/dist/types/VerdictKind.d.ts +0 -4
- package/dist/types/VerdictKind.js +0 -3
- package/dist/types/VideoCallOptions.d.ts +0 -84
- package/dist/types/VideoCallOptions.js +0 -2
- package/dist/types/VideoData.d.ts +0 -22
- package/dist/types/VideoData.js +0 -3
- package/dist/types/VideoFile.d.ts +0 -29
- package/dist/types/VideoFile.js +0 -2
- package/dist/types/VideoFileData.d.ts +0 -8
- package/dist/types/VideoFileData.js +0 -3
- package/dist/types/VideoFrameImage.d.ts +0 -17
- package/dist/types/VideoFrameImage.js +0 -2
- package/dist/types/VideoFrameType.d.ts +0 -6
- package/dist/types/VideoFrameType.js +0 -3
- package/dist/types/VideoPollOptions.d.ts +0 -13
- package/dist/types/VideoPollOptions.js +0 -3
- package/dist/types/VideoResponse.d.ts +0 -19
- package/dist/types/VideoResponse.js +0 -3
- package/dist/types/VideoResult.d.ts +0 -29
- package/dist/types/VideoResult.js +0 -2
- package/dist/types/Warning.d.ts +0 -23
- package/dist/types/Warning.js +0 -3
- package/dist/types/serde_json/JsonValue.d.ts +0 -3
- package/dist/types/serde_json/JsonValue.js +0 -3
package/dist/types/BreakKind.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import type { LanguageModelPromptMessage } from "./LanguageModelPromptMessage";
|
|
2
|
-
import type { ReasoningEffort } from "./ReasoningEffort";
|
|
3
|
-
import type { ResponseFormat } from "./ResponseFormat";
|
|
4
|
-
import type { TimeoutConfiguration } from "./TimeoutConfiguration";
|
|
5
|
-
import type { Tool } from "./Tool";
|
|
6
|
-
import type { ToolChoice } from "./ToolChoice";
|
|
7
|
-
import type { JsonValue } from "./serde_json/JsonValue";
|
|
8
|
-
/**
|
|
9
|
-
* Options passed to `LanguageModel::do_generate` / `do_stream`.
|
|
10
|
-
*
|
|
11
|
-
* This is the **provider-facing** options struct. Users interact with
|
|
12
|
-
* `GenerateTextOptions` (user-facing) which is converted to `CallOptions`
|
|
13
|
-
* by the `generate_text` / `stream_text` functions.
|
|
14
|
-
*/
|
|
15
|
-
export type CallOptions = {
|
|
16
|
-
/**
|
|
17
|
-
* The standardized prompt (message array). Required.
|
|
18
|
-
*/
|
|
19
|
-
prompt: Array<LanguageModelPromptMessage>;
|
|
20
|
-
/**
|
|
21
|
-
* Maximum tokens to generate.
|
|
22
|
-
*/
|
|
23
|
-
max_output_tokens: number | null;
|
|
24
|
-
/**
|
|
25
|
-
* Sampling temperature.
|
|
26
|
-
*/
|
|
27
|
-
temperature: number | null;
|
|
28
|
-
/**
|
|
29
|
-
* Stop sequences.
|
|
30
|
-
*/
|
|
31
|
-
stop_sequences: Array<string> | null;
|
|
32
|
-
/**
|
|
33
|
-
* Nucleus sampling `top_p`.
|
|
34
|
-
*/
|
|
35
|
-
top_p: number | null;
|
|
36
|
-
/**
|
|
37
|
-
* Top-k sampling.
|
|
38
|
-
*/
|
|
39
|
-
top_k: number | null;
|
|
40
|
-
/**
|
|
41
|
-
* Presence penalty.
|
|
42
|
-
*/
|
|
43
|
-
presence_penalty: number | null;
|
|
44
|
-
/**
|
|
45
|
-
* Frequency penalty.
|
|
46
|
-
*/
|
|
47
|
-
frequency_penalty: number | null;
|
|
48
|
-
/**
|
|
49
|
-
* Response format (text or JSON).
|
|
50
|
-
*/
|
|
51
|
-
response_format: ResponseFormat | null;
|
|
52
|
-
/**
|
|
53
|
-
* Seed for reproducibility.
|
|
54
|
-
*/
|
|
55
|
-
seed: number | null;
|
|
56
|
-
/**
|
|
57
|
-
* Tools available to the model (function tools and/or provider-defined tools).
|
|
58
|
-
*/
|
|
59
|
-
tools: Array<Tool> | null;
|
|
60
|
-
/**
|
|
61
|
-
* How the model should choose tools.
|
|
62
|
-
*/
|
|
63
|
-
tool_choice: ToolChoice;
|
|
64
|
-
/**
|
|
65
|
-
* Extra HTTP headers.
|
|
66
|
-
*/
|
|
67
|
-
headers: {
|
|
68
|
-
[key in string]: string;
|
|
69
|
-
} | null;
|
|
70
|
-
/**
|
|
71
|
-
* Provider-specific options (keyed by provider name).
|
|
72
|
-
*/
|
|
73
|
-
provider_options: {
|
|
74
|
-
[key in string]: JsonValue;
|
|
75
|
-
} | null;
|
|
76
|
-
/**
|
|
77
|
-
* Top-level reasoning effort. Maps to OpenAI `reasoning_effort` and
|
|
78
|
-
* Anthropic `thinking` config.
|
|
79
|
-
*/
|
|
80
|
-
reasoning: ReasoningEffort | null;
|
|
81
|
-
/**
|
|
82
|
-
* Per-call request body overrides. Deep-merged into the provider-built
|
|
83
|
-
* request body (after any built-in vendor override) before sending.
|
|
84
|
-
* `null` values delete the corresponding key. See RFC-0017.
|
|
85
|
-
*/
|
|
86
|
-
body_overrides: JsonValue | null;
|
|
87
|
-
/**
|
|
88
|
-
* Per-call retry count override. `None` uses the provider's configured
|
|
89
|
-
* Core operation retry. `Some(0)` disables retries.
|
|
90
|
-
*/
|
|
91
|
-
max_retries: number | null;
|
|
92
|
-
/**
|
|
93
|
-
* Per-call timeout configuration (total / first-chunk / chunk idle).
|
|
94
|
-
* `None` = no timeouts (provider defaults still apply at the HTTP layer).
|
|
95
|
-
*/
|
|
96
|
-
timeout: TimeoutConfiguration | null;
|
|
97
|
-
/**
|
|
98
|
-
* Session identifier, for grouping consecutive calls into a session
|
|
99
|
-
* (observability, see RFC-0024). Explicit values take precedence; when
|
|
100
|
-
* `None` and the optional session inferer is enabled, one may be inferred.
|
|
101
|
-
* Orthogonal to RFC-0019 session-affinity headers: this field is for
|
|
102
|
-
* local grouping, while session headers in `headers` are for upstream
|
|
103
|
-
* routing — both may share an id value but travel different paths.
|
|
104
|
-
*/
|
|
105
|
-
session_id: string | null;
|
|
106
|
-
/**
|
|
107
|
-
* Emit raw provider stream chunks as `StreamPart::Raw` (debugging aid).
|
|
108
|
-
* When `Some(true)`, streaming providers yield one `Raw` part per JSON
|
|
109
|
-
* SSE event, carrying the **parsed JSON payload** of the event, emitted
|
|
110
|
-
* before the parsed parts. Excludes the `[DONE]` sentinel; unparsable
|
|
111
|
-
* chunks emit only `Error`. `null`/`Some(false)` = off.
|
|
112
|
-
* Currently honored by the OpenAI-compatible family (openai / azure /
|
|
113
|
-
* openai-compatible registry providers); other provider families ignore
|
|
114
|
-
* it for now (RFC-0016 M2).
|
|
115
|
-
*/
|
|
116
|
-
include_raw_chunks: boolean | null;
|
|
117
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ChatCompletionChoice } from "./ChatCompletionChoice";
|
|
2
|
-
import type { ChatCompletionUsage } from "./ChatCompletionUsage";
|
|
3
|
-
/**
|
|
4
|
-
* A complete Chat Completion response (non-streaming).
|
|
5
|
-
*
|
|
6
|
-
* Mirrors the OpenAI `chat.completion` object.
|
|
7
|
-
*/
|
|
8
|
-
export type ChatCompletion = {
|
|
9
|
-
id: string;
|
|
10
|
-
object: string;
|
|
11
|
-
created: bigint;
|
|
12
|
-
model: string;
|
|
13
|
-
choices: Array<ChatCompletionChoice>;
|
|
14
|
-
usage: ChatCompletionUsage;
|
|
15
|
-
system_fingerprint: string | null;
|
|
16
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ChatCompletionMessage } from "./ChatCompletionMessage";
|
|
2
|
-
import type { JsonValue } from "./serde_json/JsonValue";
|
|
3
|
-
export type ChatCompletionChoice = {
|
|
4
|
-
index: number;
|
|
5
|
-
message: ChatCompletionMessage;
|
|
6
|
-
finish_reason: string | null;
|
|
7
|
-
logprobs: JsonValue | null;
|
|
8
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ChatCompletionChunkChoice } from "./ChatCompletionChunkChoice";
|
|
2
|
-
import type { ChatCompletionUsage } from "./ChatCompletionUsage";
|
|
3
|
-
/**
|
|
4
|
-
* A single Chat Completion chunk (streaming).
|
|
5
|
-
*
|
|
6
|
-
* Mirrors the OpenAI `chat.completion.chunk` object.
|
|
7
|
-
*/
|
|
8
|
-
export type ChatCompletionChunk = {
|
|
9
|
-
id: string;
|
|
10
|
-
object: string;
|
|
11
|
-
created: bigint;
|
|
12
|
-
model: string;
|
|
13
|
-
choices: Array<ChatCompletionChunkChoice>;
|
|
14
|
-
usage: ChatCompletionUsage | null;
|
|
15
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ChatCompletionDelta } from "./ChatCompletionDelta";
|
|
2
|
-
import type { JsonValue } from "./serde_json/JsonValue";
|
|
3
|
-
export type ChatCompletionChunkChoice = {
|
|
4
|
-
index: number;
|
|
5
|
-
delta: ChatCompletionDelta;
|
|
6
|
-
finish_reason: string | null;
|
|
7
|
-
logprobs: JsonValue | null;
|
|
8
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ChatCompletionToolCall } from "./ChatCompletionToolCall";
|
|
2
|
-
import type { JsonValue } from "./serde_json/JsonValue";
|
|
3
|
-
export type ChatCompletionMessage = {
|
|
4
|
-
role: string;
|
|
5
|
-
content: string | null;
|
|
6
|
-
reasoning_content: string | null;
|
|
7
|
-
tool_calls: Array<ChatCompletionToolCall> | null;
|
|
8
|
-
annotations: Array<JsonValue> | null;
|
|
9
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CompletionTokensDetails } from "./CompletionTokensDetails";
|
|
2
|
-
import type { PromptTokensDetails } from "./PromptTokensDetails";
|
|
3
|
-
export type ChatCompletionUsage = {
|
|
4
|
-
prompt_tokens: number;
|
|
5
|
-
completion_tokens: number;
|
|
6
|
-
total_tokens: number;
|
|
7
|
-
prompt_tokens_details: PromptTokensDetails | null;
|
|
8
|
-
completion_tokens_details: CompletionTokensDetails | null;
|
|
9
|
-
};
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import type { JsonValue } from "./serde_json/JsonValue";
|
|
2
|
-
/**
|
|
3
|
-
* A part of a multi-part message.
|
|
4
|
-
*
|
|
5
|
-
* Shared between `ModelMessage` (user-facing) and `LanguageModelPrompt` (provider-facing).
|
|
6
|
-
*/
|
|
7
|
-
export type ContentPart = {
|
|
8
|
-
"type": "text";
|
|
9
|
-
text: string;
|
|
10
|
-
/**
|
|
11
|
-
* Provider-specific options for this part (e.g. `openai.promptCacheBreakpoint`).
|
|
12
|
-
*/
|
|
13
|
-
provider_options?: JsonValue | null;
|
|
14
|
-
} | {
|
|
15
|
-
"type": "image";
|
|
16
|
-
image: Array<number>;
|
|
17
|
-
media_type: string;
|
|
18
|
-
provider_options?: JsonValue | null;
|
|
19
|
-
} | {
|
|
20
|
-
"type": "file";
|
|
21
|
-
data: Array<number>;
|
|
22
|
-
media_type: string;
|
|
23
|
-
filename?: string | null;
|
|
24
|
-
provider_options?: JsonValue | null;
|
|
25
|
-
} | {
|
|
26
|
-
"type": "file_base64";
|
|
27
|
-
data: string;
|
|
28
|
-
media_type: string;
|
|
29
|
-
filename?: string | null;
|
|
30
|
-
provider_options?: JsonValue | null;
|
|
31
|
-
} | {
|
|
32
|
-
"type": "file_url";
|
|
33
|
-
url: string;
|
|
34
|
-
media_type: string;
|
|
35
|
-
provider_options?: JsonValue | null;
|
|
36
|
-
} | {
|
|
37
|
-
"type": "file_reference";
|
|
38
|
-
media_type: string;
|
|
39
|
-
reference: JsonValue;
|
|
40
|
-
filename?: string | null;
|
|
41
|
-
provider_options?: JsonValue | null;
|
|
42
|
-
} | {
|
|
43
|
-
"type": "reasoning";
|
|
44
|
-
text: string;
|
|
45
|
-
signature: string | null;
|
|
46
|
-
/**
|
|
47
|
-
* Provider-specific options for this part (e.g.
|
|
48
|
-
* `anthropic.signature`, `anthropic.redactedData`,
|
|
49
|
-
* `anthropic.cacheControl`).
|
|
50
|
-
*/
|
|
51
|
-
provider_options?: JsonValue | null;
|
|
52
|
-
} | {
|
|
53
|
-
"type": "tool_call";
|
|
54
|
-
tool_call_id: string;
|
|
55
|
-
tool_name: string;
|
|
56
|
-
/**
|
|
57
|
-
* Arguments as a JSON value (usually an object).
|
|
58
|
-
*/
|
|
59
|
-
input: JsonValue;
|
|
60
|
-
/**
|
|
61
|
-
* Whether the tool call is executed by the provider rather than by
|
|
62
|
-
* the client. This is part of the prompt contract because providers
|
|
63
|
-
* need it to replay server tool calls on a later turn.
|
|
64
|
-
*/
|
|
65
|
-
provider_executed?: boolean | null;
|
|
66
|
-
/**
|
|
67
|
-
* Provider-assigned thought signature (e.g. Google Gemini
|
|
68
|
-
* `thoughtSignature`). Must be echoed back verbatim on the follow-up
|
|
69
|
-
* turn when the tool result is sent.
|
|
70
|
-
*/
|
|
71
|
-
thought_signature?: string | null;
|
|
72
|
-
/**
|
|
73
|
-
* Provider-specific options for this part (e.g.
|
|
74
|
-
* `anthropic.cacheControl`).
|
|
75
|
-
*/
|
|
76
|
-
provider_options?: JsonValue | null;
|
|
77
|
-
} | {
|
|
78
|
-
"type": "tool_result";
|
|
79
|
-
tool_call_id: string;
|
|
80
|
-
/**
|
|
81
|
-
* The tool's output (usually a JSON value or plain text).
|
|
82
|
-
*
|
|
83
|
-
* Accepts the legacy `output` field name (used by the Vercel AI SDK
|
|
84
|
-
* and the 0.1.0 TypeScript bindings) as an alias during deserialization,
|
|
85
|
-
* so multi-part tool messages constructed either way round-trip
|
|
86
|
-
* correctly. Serialization always emits `result`.
|
|
87
|
-
*/
|
|
88
|
-
result: JsonValue;
|
|
89
|
-
/**
|
|
90
|
-
* The name of the tool that produced this result (optional on the
|
|
91
|
-
* user-input side; providers that need it can look it up from the
|
|
92
|
-
* preceding tool call).
|
|
93
|
-
*/
|
|
94
|
-
tool_name?: string | null;
|
|
95
|
-
/**
|
|
96
|
-
* Whether the result is an error or error message.
|
|
97
|
-
*/
|
|
98
|
-
is_error?: boolean | null;
|
|
99
|
-
/**
|
|
100
|
-
* Whether the result is preliminary (replaces prior, e.g. image previews).
|
|
101
|
-
*/
|
|
102
|
-
preliminary?: boolean | null;
|
|
103
|
-
/**
|
|
104
|
-
* Whether the tool is dynamic (defined at runtime, e.g. MCP tools).
|
|
105
|
-
*/
|
|
106
|
-
dynamic?: boolean | null;
|
|
107
|
-
/**
|
|
108
|
-
* Provider-specific options for this part (e.g.
|
|
109
|
-
* `anthropic.cacheControl`).
|
|
110
|
-
*/
|
|
111
|
-
provider_options?: JsonValue | null;
|
|
112
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { TimeoutConfiguration } from "./TimeoutConfiguration";
|
|
2
|
-
import type { JsonValue } from "./serde_json/JsonValue";
|
|
3
|
-
/**
|
|
4
|
-
* Options passed to [`EmbeddingModel::do_embed`].
|
|
5
|
-
*
|
|
6
|
-
* Aligned with V4 `EmbeddingModelV4CallOptions`.
|
|
7
|
-
*/
|
|
8
|
-
export type EmbeddingCallOptions = {
|
|
9
|
-
/**
|
|
10
|
-
* List of text values to generate embeddings for.
|
|
11
|
-
*/
|
|
12
|
-
values: Array<string>;
|
|
13
|
-
/**
|
|
14
|
-
* Per-call retry override. `None` uses the model default.
|
|
15
|
-
*/
|
|
16
|
-
max_retries: number | null;
|
|
17
|
-
/**
|
|
18
|
-
* Per-call operation timeout.
|
|
19
|
-
*/
|
|
20
|
-
timeout: TimeoutConfiguration | null;
|
|
21
|
-
/**
|
|
22
|
-
* Additional provider-specific options, keyed by provider name.
|
|
23
|
-
*/
|
|
24
|
-
provider_options: {
|
|
25
|
-
[key in string]: JsonValue;
|
|
26
|
-
} | null;
|
|
27
|
-
/**
|
|
28
|
-
* Additional HTTP headers to send with the request.
|
|
29
|
-
*/
|
|
30
|
-
headers: {
|
|
31
|
-
[key in string]: string;
|
|
32
|
-
} | null;
|
|
33
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { JsonValue } from "./serde_json/JsonValue";
|
|
2
|
-
/**
|
|
3
|
-
* Debugging response info specific to embedding calls.
|
|
4
|
-
*/
|
|
5
|
-
export type EmbeddingResponse = {
|
|
6
|
-
/**
|
|
7
|
-
* Response headers.
|
|
8
|
-
*/
|
|
9
|
-
headers: {
|
|
10
|
-
[key in string]: string;
|
|
11
|
-
} | null;
|
|
12
|
-
/**
|
|
13
|
-
* The response body (opaque JSON).
|
|
14
|
-
*/
|
|
15
|
-
body: JsonValue | null;
|
|
16
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { EmbeddingResponse } from "./EmbeddingResponse";
|
|
2
|
-
import type { EmbeddingUsage } from "./EmbeddingUsage";
|
|
3
|
-
import type { Warning } from "./Warning";
|
|
4
|
-
import type { JsonValue } from "./serde_json/JsonValue";
|
|
5
|
-
/**
|
|
6
|
-
* The result of [`EmbeddingModel::do_embed`].
|
|
7
|
-
*
|
|
8
|
-
* Aligned with V4 `EmbeddingModelV4Result`.
|
|
9
|
-
*/
|
|
10
|
-
export type EmbeddingResult = {
|
|
11
|
-
/**
|
|
12
|
-
* Generated embeddings, in the same order as the input `values`.
|
|
13
|
-
*/
|
|
14
|
-
embeddings: Array<Array<number>>;
|
|
15
|
-
/**
|
|
16
|
-
* Token usage (input tokens only).
|
|
17
|
-
*/
|
|
18
|
-
usage: EmbeddingUsage | null;
|
|
19
|
-
/**
|
|
20
|
-
* Additional provider-specific metadata.
|
|
21
|
-
*/
|
|
22
|
-
provider_metadata: {
|
|
23
|
-
[key in string]: JsonValue;
|
|
24
|
-
} | null;
|
|
25
|
-
/**
|
|
26
|
-
* Optional response information for debugging.
|
|
27
|
-
*/
|
|
28
|
-
response: EmbeddingResponse | null;
|
|
29
|
-
/**
|
|
30
|
-
* Warnings for the call, e.g. unsupported settings.
|
|
31
|
-
*/
|
|
32
|
-
warnings: Array<Warning>;
|
|
33
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Either raw bytes or a base64-encoded string.
|
|
3
|
-
*
|
|
4
|
-
* Providers should pass file data through without unnecessary conversion: if
|
|
5
|
-
* the upstream API returns base64, return [`FileBytes::Base64`]; if it
|
|
6
|
-
* returns binary, return [`FileBytes::Binary`].
|
|
7
|
-
*/
|
|
8
|
-
export type FileBytes = {
|
|
9
|
-
"Binary": Array<number>;
|
|
10
|
-
} | {
|
|
11
|
-
"Base64": string;
|
|
12
|
-
};
|
package/dist/types/FileBytes.js
DELETED
package/dist/types/FileData.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { FileBytes } from "./FileBytes";
|
|
2
|
-
/**
|
|
3
|
-
* File data as a tagged discriminated union.
|
|
4
|
-
*
|
|
5
|
-
* Aligned with V4 `SharedV4FileData`.
|
|
6
|
-
*/
|
|
7
|
-
export type FileData = {
|
|
8
|
-
"Data": {
|
|
9
|
-
data: FileBytes;
|
|
10
|
-
};
|
|
11
|
-
} | {
|
|
12
|
-
"Url": {
|
|
13
|
-
url: string;
|
|
14
|
-
};
|
|
15
|
-
} | {
|
|
16
|
-
"Reference": {
|
|
17
|
-
reference: {
|
|
18
|
-
[key in string]: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
} | {
|
|
22
|
-
"Text": {
|
|
23
|
-
text: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
package/dist/types/FileData.js
DELETED
package/dist/types/FilePart.d.ts
DELETED
package/dist/types/FilePart.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Serialized-wire fingerprint stored in a `TraceRecord` (hex strings —
|
|
3
|
-
* `u128` is not JSON-serializable).
|
|
4
|
-
*/
|
|
5
|
-
export type Fingerprint = {
|
|
6
|
-
/**
|
|
7
|
-
* 128-bit hash of the whole denoised body (hex).
|
|
8
|
-
*/
|
|
9
|
-
body_hash: string;
|
|
10
|
-
len_bytes: bigint;
|
|
11
|
-
block_size: bigint;
|
|
12
|
-
/**
|
|
13
|
-
* Block-hash chain (hex), one entry per block.
|
|
14
|
-
*/
|
|
15
|
-
block_hashes: Array<string>;
|
|
16
|
-
/**
|
|
17
|
-
* Token estimate — byte proxy `len_bytes / 4` when no tokenizer is
|
|
18
|
-
* attached (RFC-0015 §4.1: W capped at one block in this mode).
|
|
19
|
-
*/
|
|
20
|
-
token_estimate: bigint;
|
|
21
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { FinishReasonUnified } from "./FinishReasonUnified";
|
|
2
|
-
/**
|
|
3
|
-
* Unified finish reason (why the model stopped generating).
|
|
4
|
-
*/
|
|
5
|
-
export type FinishReason = {
|
|
6
|
-
/**
|
|
7
|
-
* The unified reason.
|
|
8
|
-
*/
|
|
9
|
-
unified: FinishReasonUnified;
|
|
10
|
-
/**
|
|
11
|
-
* The raw provider-specific reason string.
|
|
12
|
-
*/
|
|
13
|
-
raw: string | null;
|
|
14
|
-
};
|