@opencode-ai/ai 0.0.0-next-17239 → 0.0.0-next-17250
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/dist/cache-policy.d.ts +1 -1
- package/dist/cache-policy.js +2 -2
- package/dist/image-client.d.ts +3 -3
- package/dist/image-client.js +1 -1
- package/dist/image.d.ts +2 -2
- package/dist/image.js +2 -2
- package/dist/index.d.ts +18 -18
- package/dist/index.js +12 -12
- package/dist/llm.d.ts +8 -8
- package/dist/llm.js +3 -3
- package/dist/protocols/anthropic-messages.d.ts +7 -7
- package/dist/protocols/anthropic-messages.js +13 -13
- package/dist/protocols/bedrock-converse.d.ts +10 -10
- package/dist/protocols/bedrock-converse.js +14 -14
- package/dist/protocols/bedrock-event-stream.d.ts +2 -2
- package/dist/protocols/bedrock-event-stream.js +3 -3
- package/dist/protocols/gemini.d.ts +6 -6
- package/dist/protocols/gemini.js +11 -11
- package/dist/protocols/google-images.d.ts +3 -3
- package/dist/protocols/google-images.js +5 -5
- package/dist/protocols/index.d.ts +9 -9
- package/dist/protocols/index.js +9 -9
- package/dist/protocols/open-responses.d.ts +7 -7
- package/dist/protocols/open-responses.js +10 -10
- package/dist/protocols/openai-chat.d.ts +7 -7
- package/dist/protocols/openai-chat.js +13 -13
- package/dist/protocols/openai-compatible-chat.d.ts +3 -3
- package/dist/protocols/openai-compatible-chat.js +5 -5
- package/dist/protocols/openai-compatible-responses.d.ts +3 -3
- package/dist/protocols/openai-compatible-responses.js +4 -4
- package/dist/protocols/openai-images.d.ts +3 -3
- package/dist/protocols/openai-images.js +6 -6
- package/dist/protocols/openai-responses.d.ts +7 -7
- package/dist/protocols/openai-responses.js +12 -12
- package/dist/protocols/shared.d.ts +7 -7
- package/dist/protocols/shared.js +3 -3
- package/dist/protocols/utils/bedrock-auth.d.ts +2 -2
- package/dist/protocols/utils/bedrock-auth.js +3 -3
- package/dist/protocols/utils/bedrock-cache.d.ts +4 -4
- package/dist/protocols/utils/bedrock-cache.js +2 -2
- package/dist/protocols/utils/bedrock-media.d.ts +2 -2
- package/dist/protocols/utils/bedrock-media.js +2 -2
- package/dist/protocols/utils/gemini-tool-schema.d.ts +1 -1
- package/dist/protocols/utils/gemini-tool-schema.js +2 -2
- package/dist/protocols/utils/image-input.d.ts +2 -2
- package/dist/protocols/utils/image-input.js +1 -1
- package/dist/protocols/utils/lifecycle.d.ts +2 -2
- package/dist/protocols/utils/lifecycle.js +2 -2
- package/dist/protocols/utils/open-responses-options.d.ts +2 -2
- package/dist/protocols/utils/open-responses-options.js +2 -2
- package/dist/protocols/utils/openai-options.d.ts +3 -3
- package/dist/protocols/utils/openai-options.js +3 -3
- package/dist/protocols/utils/tool-schema.d.ts +1 -1
- package/dist/protocols/utils/tool-schema.js +2 -2
- package/dist/protocols/utils/tool-stream.d.ts +9 -9
- package/dist/protocols/utils/tool-stream.js +3 -3
- package/dist/protocols/xai-images.d.ts +3 -3
- package/dist/protocols/xai-images.js +5 -5
- package/dist/protocols/zai-images.d.ts +3 -3
- package/dist/protocols/zai-images.js +5 -5
- package/dist/protocols.d.ts +1 -1
- package/dist/protocols.js +1 -1
- package/dist/provider-error.d.ts +1 -1
- package/dist/provider-error.js +1 -1
- package/dist/provider-package.d.ts +2 -2
- package/dist/provider-package.js +1 -1
- package/dist/provider.d.ts +2 -2
- package/dist/provider.js +1 -1
- package/dist/providers/amazon-bedrock/mantle/chat.d.ts +2 -2
- package/dist/providers/amazon-bedrock/mantle/chat.js +1 -1
- package/dist/providers/amazon-bedrock/mantle/responses.d.ts +2 -2
- package/dist/providers/amazon-bedrock/mantle/responses.js +1 -1
- package/dist/providers/amazon-bedrock/mantle.d.ts +2 -2
- package/dist/providers/amazon-bedrock/mantle.js +1 -1
- package/dist/providers/amazon-bedrock-mantle.d.ts +17 -17
- package/dist/providers/amazon-bedrock-mantle.js +6 -6
- package/dist/providers/amazon-bedrock.d.ts +9 -9
- package/dist/providers/amazon-bedrock.js +3 -3
- package/dist/providers/anthropic-compatible.d.ts +10 -10
- package/dist/providers/anthropic-compatible.js +4 -4
- package/dist/providers/anthropic.d.ts +10 -10
- package/dist/providers/anthropic.js +4 -4
- package/dist/providers/azure/chat.d.ts +2 -2
- package/dist/providers/azure/chat.js +1 -1
- package/dist/providers/azure/responses.d.ts +2 -2
- package/dist/providers/azure/responses.js +1 -1
- package/dist/providers/azure.d.ts +14 -14
- package/dist/providers/azure.js +7 -7
- package/dist/providers/cloudflare.d.ts +12 -12
- package/dist/providers/cloudflare.js +4 -4
- package/dist/providers/google-vertex/chat.d.ts +2 -2
- package/dist/providers/google-vertex/chat.js +1 -1
- package/dist/providers/google-vertex/gemini.d.ts +2 -2
- package/dist/providers/google-vertex/gemini.js +1 -1
- package/dist/providers/google-vertex/messages.d.ts +2 -2
- package/dist/providers/google-vertex/messages.js +1 -1
- package/dist/providers/google-vertex/responses.d.ts +2 -2
- package/dist/providers/google-vertex/responses.js +1 -1
- package/dist/providers/google-vertex-chat.d.ts +9 -9
- package/dist/providers/google-vertex-chat.js +3 -3
- package/dist/providers/google-vertex-messages.d.ts +8 -8
- package/dist/providers/google-vertex-messages.js +8 -8
- package/dist/providers/google-vertex-responses.d.ts +9 -9
- package/dist/providers/google-vertex-responses.js +3 -3
- package/dist/providers/google-vertex-shared.d.ts +2 -2
- package/dist/providers/google-vertex-shared.js +2 -2
- package/dist/providers/google-vertex.d.ts +8 -8
- package/dist/providers/google-vertex.js +7 -7
- package/dist/providers/google.d.ts +15 -15
- package/dist/providers/google.js +4 -4
- package/dist/providers/index.d.ts +18 -18
- package/dist/providers/index.js +18 -18
- package/dist/providers/open-responses-options.d.ts +3 -3
- package/dist/providers/open-responses-options.js +1 -1
- package/dist/providers/openai/chat.d.ts +2 -2
- package/dist/providers/openai/chat.js +1 -1
- package/dist/providers/openai/responses.d.ts +2 -2
- package/dist/providers/openai/responses.js +1 -1
- package/dist/providers/openai-compatible/responses.d.ts +1 -1
- package/dist/providers/openai-compatible/responses.js +1 -1
- package/dist/providers/openai-compatible-responses.d.ts +10 -10
- package/dist/providers/openai-compatible-responses.js +3 -3
- package/dist/providers/openai-compatible.d.ts +16 -16
- package/dist/providers/openai-compatible.js +4 -4
- package/dist/providers/openai-options.d.ts +4 -4
- package/dist/providers/openai-options.js +2 -2
- package/dist/providers/openai.d.ts +30 -30
- package/dist/providers/openai.js +6 -6
- package/dist/providers/openrouter.d.ts +11 -11
- package/dist/providers/openrouter.js +10 -10
- package/dist/providers/xai.d.ts +23 -23
- package/dist/providers/xai.js +9 -9
- package/dist/providers/zai.d.ts +7 -7
- package/dist/providers/zai.js +3 -3
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +1 -1
- package/dist/route/auth-options.d.ts +2 -2
- package/dist/route/auth-options.js +2 -2
- package/dist/route/auth.d.ts +2 -2
- package/dist/route/auth.js +2 -2
- package/dist/route/client.d.ts +11 -11
- package/dist/route/client.js +9 -9
- package/dist/route/endpoint.d.ts +2 -2
- package/dist/route/endpoint.js +2 -2
- package/dist/route/executor.d.ts +3 -3
- package/dist/route/executor.js +3 -3
- package/dist/route/framing.d.ts +2 -2
- package/dist/route/framing.js +2 -2
- package/dist/route/index.d.ts +16 -16
- package/dist/route/index.js +9 -9
- package/dist/route/protocol.d.ts +2 -2
- package/dist/route/protocol.js +1 -1
- package/dist/route/transport/http.d.ts +3 -3
- package/dist/route/transport/http.js +5 -5
- package/dist/route/transport/index.d.ts +8 -8
- package/dist/route/transport/index.js +4 -4
- package/dist/route/transport/websocket.d.ts +2 -2
- package/dist/route/transport/websocket.js +2 -2
- package/dist/route.d.ts +1 -1
- package/dist/route.js +1 -1
- package/dist/schema/errors.js +1 -1
- package/dist/schema/events.d.ts +2 -2
- package/dist/schema/events.js +3 -3
- package/dist/schema/index.d.ts +5 -5
- package/dist/schema/index.js +5 -5
- package/dist/schema/messages.d.ts +3 -3
- package/dist/schema/messages.js +3 -3
- package/dist/schema/options.d.ts +2 -2
- package/dist/schema/options.js +2 -2
- package/dist/testing.d.ts +20 -20
- package/dist/testing.js +3 -3
- package/dist/tool-runtime.d.ts +2 -2
- package/dist/tool-runtime.js +2 -2
- package/dist/tool.d.ts +3 -3
- package/dist/tool.js +2 -2
- package/package.json +3 -3
package/dist/cache-policy.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LLMRequest } from "./schema/messages";
|
|
1
|
+
import { LLMRequest } from "./schema/messages.js";
|
|
2
2
|
export declare const applyCachePolicy: (request: LLMRequest) => LLMRequest;
|
package/dist/cache-policy.js
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
//
|
|
11
11
|
// Manual `cache: CacheHint` placements on individual parts are preserved and
|
|
12
12
|
// count against the four-breakpoint budget; auto only fills remaining slots.
|
|
13
|
-
import { CacheHint } from "./schema/options";
|
|
14
|
-
import { LLMRequest, Message, ToolDefinition } from "./schema/messages";
|
|
13
|
+
import { CacheHint } from "./schema/options.js";
|
|
14
|
+
import { LLMRequest, Message, ToolDefinition } from "./schema/messages.js";
|
|
15
15
|
const AUTO = {
|
|
16
16
|
tools: true,
|
|
17
17
|
system: true,
|
package/dist/image-client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context, Effect, Layer } from "effect";
|
|
2
|
-
import { RequestExecutor } from "./route/executor";
|
|
3
|
-
import type { ImageOptions, ImageRequestFor, ImageResponse } from "./image";
|
|
4
|
-
import type { AIError } from "./schema";
|
|
2
|
+
import { RequestExecutor } from "./route/executor.js";
|
|
3
|
+
import type { ImageOptions, ImageRequestFor, ImageResponse } from "./image.js";
|
|
4
|
+
import type { AIError } from "./schema/index.js";
|
|
5
5
|
export type Execute = RequestExecutor.Interface["execute"];
|
|
6
6
|
export interface Interface {
|
|
7
7
|
readonly generate: <Options extends ImageOptions>(request: ImageRequestFor<Options>) => Effect.Effect<ImageResponse, AIError>;
|
package/dist/image-client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, Effect, Layer } from "effect";
|
|
2
|
-
import { RequestExecutor } from "./route/executor";
|
|
2
|
+
import { RequestExecutor } from "./route/executor.js";
|
|
3
3
|
export class Service extends Context.Service()("@opencode/ImageClient") {
|
|
4
4
|
}
|
|
5
5
|
export const generate = (request) => Effect.gen(function* () {
|
package/dist/image.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { HttpOptions, AIError, ModelID, ProviderID, Usage } from "./schema";
|
|
3
|
-
import { Service, type Execute as ImageExecute } from "./image-client";
|
|
2
|
+
import { HttpOptions, AIError, ModelID, ProviderID, Usage } from "./schema/index.js";
|
|
3
|
+
import { Service, type Execute as ImageExecute } from "./image-client.js";
|
|
4
4
|
export interface ImageRoute<Options extends ImageOptions = ImageOptions> {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly generate: (request: ImageRequestFor<Options>, execute: ImageExecute) => Effect.Effect<ImageResponse, AIError>;
|
package/dist/image.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { HttpOptions, InvalidRequestReason, AIError, ModelID, ProviderID, ProviderMetadata, Usage } from "./schema";
|
|
3
|
-
import { ImageClient, Service } from "./image-client";
|
|
2
|
+
import { HttpOptions, InvalidRequestReason, AIError, ModelID, ProviderID, ProviderMetadata, Usage, } from "./schema/index.js";
|
|
3
|
+
import { ImageClient, Service } from "./image-client.js";
|
|
4
4
|
export class ImageModel {
|
|
5
5
|
id;
|
|
6
6
|
provider;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export { LLMClient } from "./route/client";
|
|
2
|
-
export { ImageClient } from "./image-client";
|
|
3
|
-
export { Auth } from "./route/auth";
|
|
4
|
-
export { Provider } from "./provider";
|
|
5
|
-
export { ProviderPackage } from "./provider-package";
|
|
6
|
-
export { isContextOverflow, isContextOverflowFailure } from "./provider-error";
|
|
7
|
-
export type { RouteLanguageModelInput, RouteRoutedLanguageModelInput, Interface as LLMClientShape, Service as LLMClientService, } from "./route/client";
|
|
8
|
-
export * from "./schema";
|
|
9
|
-
export { GeneratedImage, ImageInput, ImageInputSchema, ImageModel, ImageRequest, ImageResponse } from "./image";
|
|
10
|
-
export type { ImageModelOptions, ImageOptions, ImageRequestFor, ImageRequestInput, ImageRoute } from "./image";
|
|
11
|
-
export { Image } from "./image";
|
|
12
|
-
export { Tool, ToolFailure, toDefinitions } from "./tool";
|
|
13
|
-
export { ToolRuntime } from "./tool-runtime";
|
|
14
|
-
export type { DispatchResult as ToolDispatchResult, ToolSettlement } from "./tool-runtime";
|
|
15
|
-
export type { AnyExecutableTool, AnyTool, ExecutableTool, ExecutableTools, Definition as ToolShape, ToolExecute, ToolExecuteContext, ToolModelOutputInput, Tools, ToolSchema, ToolToModelOutput, } from "./tool";
|
|
16
|
-
export * as LLM from "./llm";
|
|
17
|
-
export type { Definition as ProviderDefinition, LanguageModelFactory as ProviderLanguageModelFactory, LanguageModelOptions as ProviderLanguageModelOptions, } from "./provider";
|
|
18
|
-
export type { Definition as ProviderPackageDefinition, Settings as ProviderPackageSettings } from "./provider-package";
|
|
1
|
+
export { LLMClient } from "./route/client.js";
|
|
2
|
+
export { ImageClient } from "./image-client.js";
|
|
3
|
+
export { Auth } from "./route/auth.js";
|
|
4
|
+
export { Provider } from "./provider.js";
|
|
5
|
+
export { ProviderPackage } from "./provider-package.js";
|
|
6
|
+
export { isContextOverflow, isContextOverflowFailure } from "./provider-error.js";
|
|
7
|
+
export type { RouteLanguageModelInput, RouteRoutedLanguageModelInput, Interface as LLMClientShape, Service as LLMClientService, } from "./route/client.js";
|
|
8
|
+
export * from "./schema/index.js";
|
|
9
|
+
export { GeneratedImage, ImageInput, ImageInputSchema, ImageModel, ImageRequest, ImageResponse } from "./image.js";
|
|
10
|
+
export type { ImageModelOptions, ImageOptions, ImageRequestFor, ImageRequestInput, ImageRoute } from "./image.js";
|
|
11
|
+
export { Image } from "./image.js";
|
|
12
|
+
export { Tool, ToolFailure, toDefinitions } from "./tool.js";
|
|
13
|
+
export { ToolRuntime } from "./tool-runtime.js";
|
|
14
|
+
export type { DispatchResult as ToolDispatchResult, ToolSettlement } from "./tool-runtime.js";
|
|
15
|
+
export type { AnyExecutableTool, AnyTool, ExecutableTool, ExecutableTools, Definition as ToolShape, ToolExecute, ToolExecuteContext, ToolModelOutputInput, Tools, ToolSchema, ToolToModelOutput, } from "./tool.js";
|
|
16
|
+
export * as LLM from "./llm.js";
|
|
17
|
+
export type { Definition as ProviderDefinition, LanguageModelFactory as ProviderLanguageModelFactory, LanguageModelOptions as ProviderLanguageModelOptions, } from "./provider.js";
|
|
18
|
+
export type { Definition as ProviderPackageDefinition, Settings as ProviderPackageSettings, } from "./provider-package.js";
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { LLMClient } from "./route/client";
|
|
2
|
-
export { ImageClient } from "./image-client";
|
|
3
|
-
export { Auth } from "./route/auth";
|
|
4
|
-
export { Provider } from "./provider";
|
|
5
|
-
export { ProviderPackage } from "./provider-package";
|
|
6
|
-
export { isContextOverflow, isContextOverflowFailure } from "./provider-error";
|
|
7
|
-
export * from "./schema";
|
|
8
|
-
export { GeneratedImage, ImageInput, ImageInputSchema, ImageModel, ImageRequest, ImageResponse } from "./image";
|
|
9
|
-
export { Image } from "./image";
|
|
10
|
-
export { Tool, ToolFailure, toDefinitions } from "./tool";
|
|
11
|
-
export { ToolRuntime } from "./tool-runtime";
|
|
12
|
-
export * as LLM from "./llm";
|
|
1
|
+
export { LLMClient } from "./route/client.js";
|
|
2
|
+
export { ImageClient } from "./image-client.js";
|
|
3
|
+
export { Auth } from "./route/auth.js";
|
|
4
|
+
export { Provider } from "./provider.js";
|
|
5
|
+
export { ProviderPackage } from "./provider-package.js";
|
|
6
|
+
export { isContextOverflow, isContextOverflowFailure } from "./provider-error.js";
|
|
7
|
+
export * from "./schema/index.js";
|
|
8
|
+
export { GeneratedImage, ImageInput, ImageInputSchema, ImageModel, ImageRequest, ImageResponse } from "./image.js";
|
|
9
|
+
export { Image } from "./image.js";
|
|
10
|
+
export { Tool, ToolFailure, toDefinitions } from "./tool.js";
|
|
11
|
+
export { ToolRuntime } from "./tool-runtime.js";
|
|
12
|
+
export * as LLM from "./llm.js";
|
package/dist/llm.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, JsonSchema, Schema } from "effect";
|
|
2
|
-
import { Service } from "./route/client";
|
|
3
|
-
import { GenerationOptions, HttpOptions, AIError, LLMRequest, LLMResponse, Message, LanguageModel, SystemPart, ToolChoice, ToolDefinition, type ContentPart, type LanguageModelProviderOptions } from "./schema";
|
|
4
|
-
import { type ToolSchema } from "./tool";
|
|
2
|
+
import { Service } from "./route/client.js";
|
|
3
|
+
import { GenerationOptions, HttpOptions, AIError, LLMRequest, LLMResponse, Message, LanguageModel, SystemPart, ToolChoice, ToolDefinition, type ContentPart, type LanguageModelProviderOptions } from "./schema/index.js";
|
|
4
|
+
import { type ToolSchema } from "./tool.js";
|
|
5
5
|
/** Input accepted by `LLM.request`, normalized into the canonical `LLMRequest` class. */
|
|
6
6
|
export type RequestInput<SelectedLanguageModel extends LanguageModel = LanguageModel> = Omit<ConstructorParameters<typeof LLMRequest>[0], "model" | "system" | "messages" | "tools" | "toolChoice" | "generation" | "http" | "providerOptions"> & {
|
|
7
7
|
readonly model: SelectedLanguageModel;
|
|
@@ -14,8 +14,8 @@ export type RequestInput<SelectedLanguageModel extends LanguageModel = LanguageM
|
|
|
14
14
|
readonly providerOptions?: NoInfer<LanguageModelProviderOptions<SelectedLanguageModel>>;
|
|
15
15
|
readonly http?: HttpOptions.Input;
|
|
16
16
|
};
|
|
17
|
-
export declare const generate: typeof import("./route/client").generate;
|
|
18
|
-
export declare const stream: typeof import("./route/client").stream;
|
|
17
|
+
export declare const generate: typeof import("./route/client.js").generate;
|
|
18
|
+
export declare const stream: typeof import("./route/client.js").stream;
|
|
19
19
|
export declare const request: <const SelectedLanguageModel extends LanguageModel>(input: RequestInput<SelectedLanguageModel>) => LLMRequest;
|
|
20
20
|
type GenerateObjectBase<SelectedLanguageModel extends LanguageModel = LanguageModel> = Omit<RequestInput<SelectedLanguageModel>, "tools" | "toolChoice">;
|
|
21
21
|
export declare class GenerateObjectResponse<T> {
|
|
@@ -181,7 +181,7 @@ export declare class GenerateObjectResponse<T> {
|
|
|
181
181
|
readonly [x: string]: unknown;
|
|
182
182
|
};
|
|
183
183
|
} | undefined;
|
|
184
|
-
readonly usage?: import("./schema").Usage | undefined;
|
|
184
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
185
185
|
} | {
|
|
186
186
|
readonly type: "finish";
|
|
187
187
|
readonly reason: {
|
|
@@ -193,7 +193,7 @@ export declare class GenerateObjectResponse<T> {
|
|
|
193
193
|
readonly [x: string]: unknown;
|
|
194
194
|
};
|
|
195
195
|
} | undefined;
|
|
196
|
-
readonly usage?: import("./schema").Usage | undefined;
|
|
196
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
197
197
|
} | {
|
|
198
198
|
readonly type: "provider-error";
|
|
199
199
|
readonly message: string;
|
|
@@ -204,7 +204,7 @@ export declare class GenerateObjectResponse<T> {
|
|
|
204
204
|
} | undefined;
|
|
205
205
|
readonly classification?: "context-overflow" | "payload-too-large" | undefined;
|
|
206
206
|
})[];
|
|
207
|
-
get usage(): import("./schema").Usage | undefined;
|
|
207
|
+
get usage(): import("./schema/events.js").Usage | undefined;
|
|
208
208
|
}
|
|
209
209
|
export interface GenerateObjectOptions<S extends ToolSchema<any>, SelectedLanguageModel extends LanguageModel = LanguageModel> extends GenerateObjectBase<SelectedLanguageModel> {
|
|
210
210
|
readonly schema: S;
|
package/dist/llm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, JsonSchema, Schema } from "effect";
|
|
2
|
-
import { LLMClient, Service } from "./route/client";
|
|
3
|
-
import { GenerationOptions, HttpOptions, InvalidProviderOutputReason, AIError, LLMEvent, LLMRequest, LLMResponse, Message, LanguageModel, SystemPart, ToolChoice, ToolDefinition, } from "./schema";
|
|
4
|
-
import { make as makeTool, toDefinitions } from "./tool";
|
|
2
|
+
import { LLMClient, Service } from "./route/client.js";
|
|
3
|
+
import { GenerationOptions, HttpOptions, InvalidProviderOutputReason, AIError, LLMEvent, LLMRequest, LLMResponse, Message, LanguageModel, SystemPart, ToolChoice, ToolDefinition, } from "./schema/index.js";
|
|
4
|
+
import { make as makeTool, toDefinitions } from "./tool.js";
|
|
5
5
|
export const generate = LLMClient.generate;
|
|
6
6
|
export const stream = LLMClient.stream;
|
|
7
7
|
export const request = (input) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { Route } from "../route/client";
|
|
3
|
-
import { Protocol } from "../route/protocol";
|
|
4
|
-
import { type ProviderOptions } from "../schema";
|
|
5
|
-
import { Lifecycle } from "./utils/lifecycle";
|
|
6
|
-
import { ToolStream } from "./utils/tool-stream";
|
|
2
|
+
import { Route } from "../route/client.js";
|
|
3
|
+
import { Protocol } from "../route/protocol.js";
|
|
4
|
+
import { type ProviderOptions } from "../schema/index.js";
|
|
5
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
6
|
+
import { ToolStream } from "./utils/tool-stream.js";
|
|
7
7
|
export declare const DEFAULT_BASE_URL = "https://api.anthropic.com/v1";
|
|
8
8
|
export declare const PATH = "/messages";
|
|
9
9
|
export type ThinkingInput = {
|
|
@@ -629,5 +629,5 @@ export declare const route: Route<{
|
|
|
629
629
|
readonly output_config?: {
|
|
630
630
|
readonly effort?: string | undefined;
|
|
631
631
|
} | undefined;
|
|
632
|
-
}, import("../route/transport/http").HttpPrepared<string>>;
|
|
633
|
-
export * as AnthropicMessages from "./anthropic-messages";
|
|
632
|
+
}, import("../route/transport/http.js").HttpPrepared<string>>;
|
|
633
|
+
export * as AnthropicMessages from "./anthropic-messages.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { Tool } from "@opencode-ai/schema/tool";
|
|
3
|
-
import { Route } from "../route/client";
|
|
4
|
-
import { Auth } from "../route/auth";
|
|
5
|
-
import { Endpoint } from "../route/endpoint";
|
|
6
|
-
import { Framing } from "../route/framing";
|
|
7
|
-
import { Protocol } from "../route/protocol";
|
|
8
|
-
import { AIError, LLMEvent, mergeJsonRecords, Usage, } from "../schema";
|
|
9
|
-
import { JsonObject, optionalArray, optionalNull, ProviderShared } from "./shared";
|
|
10
|
-
import { classifyProviderFailure } from "../provider-error";
|
|
11
|
-
import * as Cache from "./utils/cache";
|
|
12
|
-
import { Lifecycle } from "./utils/lifecycle";
|
|
13
|
-
import { ToolSchemaProjection } from "./utils/tool-schema";
|
|
14
|
-
import { ToolStream } from "./utils/tool-stream";
|
|
3
|
+
import { Route } from "../route/client.js";
|
|
4
|
+
import { Auth } from "../route/auth.js";
|
|
5
|
+
import { Endpoint } from "../route/endpoint.js";
|
|
6
|
+
import { Framing } from "../route/framing.js";
|
|
7
|
+
import { Protocol } from "../route/protocol.js";
|
|
8
|
+
import { AIError, LLMEvent, mergeJsonRecords, Usage, } from "../schema/index.js";
|
|
9
|
+
import { JsonObject, optionalArray, optionalNull, ProviderShared } from "./shared.js";
|
|
10
|
+
import { classifyProviderFailure } from "../provider-error.js";
|
|
11
|
+
import * as Cache from "./utils/cache.js";
|
|
12
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
13
|
+
import { ToolSchemaProjection } from "./utils/tool-schema.js";
|
|
14
|
+
import { ToolStream } from "./utils/tool-stream.js";
|
|
15
15
|
const ADAPTER = "anthropic-messages";
|
|
16
16
|
const MEDIA_MIMES = new Set([...ProviderShared.IMAGE_MIMES, ...ProviderShared.PDF_MIMES]);
|
|
17
17
|
export const DEFAULT_BASE_URL = "https://api.anthropic.com/v1";
|
|
@@ -853,4 +853,4 @@ export const route = Route.make({
|
|
|
853
853
|
framing: Framing.sse,
|
|
854
854
|
headers: () => ({ "anthropic-version": "2023-06-01" }),
|
|
855
855
|
});
|
|
856
|
-
export * as AnthropicMessages from "./anthropic-messages";
|
|
856
|
+
export * as AnthropicMessages from "./anthropic-messages.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { Route } from "../route/client";
|
|
3
|
-
import { Protocol } from "../route/protocol";
|
|
4
|
-
import { Usage, type FinishReasonDetails } from "../schema";
|
|
5
|
-
import { BedrockAuth } from "./utils/bedrock-auth";
|
|
6
|
-
import { Lifecycle } from "./utils/lifecycle";
|
|
7
|
-
import { ToolStream } from "./utils/tool-stream";
|
|
8
|
-
export type { Credentials as BedrockCredentials } from "./utils/bedrock-auth";
|
|
2
|
+
import { Route } from "../route/client.js";
|
|
3
|
+
import { Protocol } from "../route/protocol.js";
|
|
4
|
+
import { Usage, type FinishReasonDetails } from "../schema/index.js";
|
|
5
|
+
import { BedrockAuth } from "./utils/bedrock-auth.js";
|
|
6
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
7
|
+
import { ToolStream } from "./utils/tool-stream.js";
|
|
8
|
+
export type { Credentials as BedrockCredentials } from "./utils/bedrock-auth.js";
|
|
9
9
|
declare const BedrockConverseBody: Schema.Struct<{
|
|
10
10
|
modelId: Schema.String;
|
|
11
11
|
messages: Schema.$Array<Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
|
|
@@ -525,9 +525,9 @@ export declare const route: Route<{
|
|
|
525
525
|
readonly additionalModelRequestFields?: {
|
|
526
526
|
readonly [x: string]: unknown;
|
|
527
527
|
} | undefined;
|
|
528
|
-
}, import("../route/transport/http").HttpPrepared<object>>;
|
|
528
|
+
}, import("../route/transport/http.js").HttpPrepared<object>>;
|
|
529
529
|
export declare const sigV4Auth: (credentials: BedrockAuth.Credentials | undefined, options?: {
|
|
530
530
|
readonly service?: string;
|
|
531
531
|
readonly name?: string;
|
|
532
|
-
}) => import("../route").AuthShape;
|
|
533
|
-
export * as BedrockConverse from "./bedrock-converse";
|
|
532
|
+
}) => import("../route.js").AuthShape;
|
|
533
|
+
export * as BedrockConverse from "./bedrock-converse.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { Route } from "../route/client";
|
|
3
|
-
import { Endpoint } from "../route/endpoint";
|
|
4
|
-
import { Protocol } from "../route/protocol";
|
|
5
|
-
import { AIError, LLMEvent, Usage, } from "../schema";
|
|
6
|
-
import { BedrockEventStream } from "./bedrock-event-stream";
|
|
7
|
-
import { classifyProviderFailure } from "../provider-error";
|
|
8
|
-
import { JsonObject, optionalArray, ProviderShared } from "./shared";
|
|
9
|
-
import { BedrockAuth } from "./utils/bedrock-auth";
|
|
10
|
-
import { BedrockCache } from "./utils/bedrock-cache";
|
|
11
|
-
import { BedrockMedia } from "./utils/bedrock-media";
|
|
12
|
-
import { Lifecycle } from "./utils/lifecycle";
|
|
13
|
-
import { ToolSchemaProjection } from "./utils/tool-schema";
|
|
14
|
-
import { ToolStream } from "./utils/tool-stream";
|
|
2
|
+
import { Route } from "../route/client.js";
|
|
3
|
+
import { Endpoint } from "../route/endpoint.js";
|
|
4
|
+
import { Protocol } from "../route/protocol.js";
|
|
5
|
+
import { AIError, LLMEvent, Usage, } from "../schema/index.js";
|
|
6
|
+
import { BedrockEventStream } from "./bedrock-event-stream.js";
|
|
7
|
+
import { classifyProviderFailure } from "../provider-error.js";
|
|
8
|
+
import { JsonObject, optionalArray, ProviderShared } from "./shared.js";
|
|
9
|
+
import { BedrockAuth } from "./utils/bedrock-auth.js";
|
|
10
|
+
import { BedrockCache } from "./utils/bedrock-cache.js";
|
|
11
|
+
import { BedrockMedia } from "./utils/bedrock-media.js";
|
|
12
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
13
|
+
import { ToolSchemaProjection } from "./utils/tool-schema.js";
|
|
14
|
+
import { ToolStream } from "./utils/tool-stream.js";
|
|
15
15
|
const ADAPTER = "bedrock-converse";
|
|
16
16
|
// =============================================================================
|
|
17
17
|
// Request Body Schema
|
|
@@ -581,4 +581,4 @@ export const route = Route.make({
|
|
|
581
581
|
framing,
|
|
582
582
|
});
|
|
583
583
|
export const sigV4Auth = BedrockAuth.sigV4;
|
|
584
|
-
export * as BedrockConverse from "./bedrock-converse";
|
|
584
|
+
export * as BedrockConverse from "./bedrock-converse.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Framing } from "../route/framing";
|
|
1
|
+
import { Framing } from "../route/framing.js";
|
|
2
2
|
/**
|
|
3
3
|
* AWS event-stream framing for Bedrock Converse. Each frame is decoded by
|
|
4
4
|
* `@smithy/eventstream-codec` (length + header + payload + CRC) and rewrapped
|
|
@@ -6,4 +6,4 @@ import { Framing } from "../route/framing";
|
|
|
6
6
|
* payload directly.
|
|
7
7
|
*/
|
|
8
8
|
export declare const framing: (route: string) => Framing.Definition<object>;
|
|
9
|
-
export * as BedrockEventStream from "./bedrock-event-stream";
|
|
9
|
+
export * as BedrockEventStream from "./bedrock-event-stream.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EventStreamCodec } from "@smithy/eventstream-codec";
|
|
2
2
|
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
3
3
|
import { Effect, Stream } from "effect";
|
|
4
|
-
import { Framing } from "../route/framing";
|
|
5
|
-
import { ProviderShared } from "./shared";
|
|
4
|
+
import { Framing } from "../route/framing.js";
|
|
5
|
+
import { ProviderShared } from "./shared.js";
|
|
6
6
|
// Bedrock streams responses using the AWS event stream binary protocol — each
|
|
7
7
|
// frame is `[length:4][headers-length:4][prelude-crc:4][headers][payload][crc:4]`.
|
|
8
8
|
// We use `@smithy/eventstream-codec` to validate framing and CRCs, then
|
|
@@ -70,4 +70,4 @@ export const framing = (route) => ({
|
|
|
70
70
|
id: "aws-event-stream",
|
|
71
71
|
frame: (bytes) => bytes.pipe(Stream.mapAccumEffect(() => initialFrameBuffer, consumeFrames(route))),
|
|
72
72
|
});
|
|
73
|
-
export * as BedrockEventStream from "./bedrock-event-stream";
|
|
73
|
+
export * as BedrockEventStream from "./bedrock-event-stream.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { Route } from "../route/client";
|
|
3
|
-
import { Protocol } from "../route/protocol";
|
|
4
|
-
import { type ProviderOptions } from "../schema";
|
|
5
|
-
import { Lifecycle } from "./utils/lifecycle";
|
|
2
|
+
import { Route } from "../route/client.js";
|
|
3
|
+
import { Protocol } from "../route/protocol.js";
|
|
4
|
+
import { type ProviderOptions } from "../schema/index.js";
|
|
5
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
6
6
|
export declare const DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
7
7
|
export interface OptionsInput {
|
|
8
8
|
readonly [key: string]: unknown;
|
|
@@ -296,5 +296,5 @@ export declare const route: Route<{
|
|
|
296
296
|
} | undefined;
|
|
297
297
|
readonly maxOutputTokens?: number | undefined;
|
|
298
298
|
} | undefined;
|
|
299
|
-
}, import("../route/transport/http").HttpPrepared<string>>;
|
|
300
|
-
export * as Gemini from "./gemini";
|
|
299
|
+
}, import("../route/transport/http.js").HttpPrepared<string>>;
|
|
300
|
+
export * as Gemini from "./gemini.js";
|
package/dist/protocols/gemini.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { Tool } from "@opencode-ai/schema/tool";
|
|
3
|
-
import { Route } from "../route/client";
|
|
4
|
-
import { Auth } from "../route/auth";
|
|
5
|
-
import { Endpoint } from "../route/endpoint";
|
|
6
|
-
import { Framing } from "../route/framing";
|
|
7
|
-
import { Protocol } from "../route/protocol";
|
|
8
|
-
import { LLMEvent, Usage, } from "../schema";
|
|
9
|
-
import { JsonObject, optionalArray, ProviderShared } from "./shared";
|
|
10
|
-
import { GeminiToolSchema } from "./utils/gemini-tool-schema";
|
|
11
|
-
import { Lifecycle } from "./utils/lifecycle";
|
|
12
|
-
import { ToolSchemaProjection } from "./utils/tool-schema";
|
|
3
|
+
import { Route } from "../route/client.js";
|
|
4
|
+
import { Auth } from "../route/auth.js";
|
|
5
|
+
import { Endpoint } from "../route/endpoint.js";
|
|
6
|
+
import { Framing } from "../route/framing.js";
|
|
7
|
+
import { Protocol } from "../route/protocol.js";
|
|
8
|
+
import { LLMEvent, Usage, } from "../schema/index.js";
|
|
9
|
+
import { JsonObject, optionalArray, ProviderShared } from "./shared.js";
|
|
10
|
+
import { GeminiToolSchema } from "./utils/gemini-tool-schema.js";
|
|
11
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
12
|
+
import { ToolSchemaProjection } from "./utils/tool-schema.js";
|
|
13
13
|
const ADAPTER = "gemini";
|
|
14
14
|
const MEDIA_MIMES = new Set(ProviderShared.MEDIA_MIMES);
|
|
15
15
|
// Google documents this sentinel for replaying Gemini 3 function calls after their original signature was lost.
|
|
@@ -509,4 +509,4 @@ export const route = Route.make({
|
|
|
509
509
|
auth: Auth.none,
|
|
510
510
|
framing: Framing.sse,
|
|
511
511
|
});
|
|
512
|
-
export * as Gemini from "./gemini";
|
|
512
|
+
export * as Gemini from "./gemini.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ImageModel } from "../image";
|
|
2
|
-
import { type Definition as AuthDefinition } from "../route/auth";
|
|
3
|
-
import { type HttpOptions } from "../schema";
|
|
1
|
+
import { ImageModel } from "../image.js";
|
|
2
|
+
import { type Definition as AuthDefinition } from "../route/auth.js";
|
|
3
|
+
import { type HttpOptions } from "../schema/index.js";
|
|
4
4
|
export declare const DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
5
5
|
export type GoogleImageString<Known extends string> = Known | (string & {});
|
|
6
6
|
export type GoogleImageOptions = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Effect, Encoding, Schema } from "effect";
|
|
2
2
|
import { Headers, HttpClientRequest } from "effect/unstable/http";
|
|
3
|
-
import { GeneratedImage, ImageModel, ImageResponse, } from "../image";
|
|
4
|
-
import { Auth } from "../route/auth";
|
|
5
|
-
import { InvalidProviderOutputReason, AIError, Usage, mergeHttpOptions, mergeJsonRecords, } from "../schema";
|
|
6
|
-
import { ProviderShared } from "./shared";
|
|
7
|
-
import { ImageInputs } from "./utils/image-input";
|
|
3
|
+
import { GeneratedImage, ImageModel, ImageResponse, } from "../image.js";
|
|
4
|
+
import { Auth } from "../route/auth.js";
|
|
5
|
+
import { InvalidProviderOutputReason, AIError, Usage, mergeHttpOptions, mergeJsonRecords, } from "../schema/index.js";
|
|
6
|
+
import { ProviderShared } from "./shared.js";
|
|
7
|
+
import { ImageInputs } from "./utils/image-input.js";
|
|
8
8
|
const ADAPTER = "google-images";
|
|
9
9
|
export const DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
10
10
|
const GoogleUsage = Schema.StructWithRest(Schema.Struct({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * as AnthropicMessages from "./anthropic-messages";
|
|
2
|
-
export * as BedrockConverse from "./bedrock-converse";
|
|
3
|
-
export * as Gemini from "./gemini";
|
|
4
|
-
export * as OpenAIChat from "./openai-chat";
|
|
5
|
-
export * as OpenAIImages from "./openai-images";
|
|
6
|
-
export * as OpenAICompatibleChat from "./openai-compatible-chat";
|
|
7
|
-
export * as OpenAICompatibleResponses from "./openai-compatible-responses";
|
|
8
|
-
export * as OpenAIResponses from "./openai-responses";
|
|
9
|
-
export * as OpenResponses from "./open-responses";
|
|
1
|
+
export * as AnthropicMessages from "./anthropic-messages.js";
|
|
2
|
+
export * as BedrockConverse from "./bedrock-converse.js";
|
|
3
|
+
export * as Gemini from "./gemini.js";
|
|
4
|
+
export * as OpenAIChat from "./openai-chat.js";
|
|
5
|
+
export * as OpenAIImages from "./openai-images.js";
|
|
6
|
+
export * as OpenAICompatibleChat from "./openai-compatible-chat.js";
|
|
7
|
+
export * as OpenAICompatibleResponses from "./openai-compatible-responses.js";
|
|
8
|
+
export * as OpenAIResponses from "./openai-responses.js";
|
|
9
|
+
export * as OpenResponses from "./open-responses.js";
|
package/dist/protocols/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * as AnthropicMessages from "./anthropic-messages";
|
|
2
|
-
export * as BedrockConverse from "./bedrock-converse";
|
|
3
|
-
export * as Gemini from "./gemini";
|
|
4
|
-
export * as OpenAIChat from "./openai-chat";
|
|
5
|
-
export * as OpenAIImages from "./openai-images";
|
|
6
|
-
export * as OpenAICompatibleChat from "./openai-compatible-chat";
|
|
7
|
-
export * as OpenAICompatibleResponses from "./openai-compatible-responses";
|
|
8
|
-
export * as OpenAIResponses from "./openai-responses";
|
|
9
|
-
export * as OpenResponses from "./open-responses";
|
|
1
|
+
export * as AnthropicMessages from "./anthropic-messages.js";
|
|
2
|
+
export * as BedrockConverse from "./bedrock-converse.js";
|
|
3
|
+
export * as Gemini from "./gemini.js";
|
|
4
|
+
export * as OpenAIChat from "./openai-chat.js";
|
|
5
|
+
export * as OpenAIImages from "./openai-images.js";
|
|
6
|
+
export * as OpenAICompatibleChat from "./openai-compatible-chat.js";
|
|
7
|
+
export * as OpenAICompatibleResponses from "./openai-compatible-responses.js";
|
|
8
|
+
export * as OpenAIResponses from "./openai-responses.js";
|
|
9
|
+
export * as OpenResponses from "./open-responses.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { HttpTransport } from "../route/transport";
|
|
3
|
-
import { Protocol } from "../route/protocol";
|
|
4
|
-
import { AIError, LLMEvent, Usage, type LLMRequest, type MediaPart, type ProviderMetadata, type ToolDefinition } from "../schema";
|
|
5
|
-
import { ProviderShared } from "./shared";
|
|
6
|
-
import { Lifecycle } from "./utils/lifecycle";
|
|
7
|
-
import { ToolStream } from "./utils/tool-stream";
|
|
2
|
+
import { HttpTransport } from "../route/transport/index.js";
|
|
3
|
+
import { Protocol } from "../route/protocol.js";
|
|
4
|
+
import { AIError, LLMEvent, Usage, type LLMRequest, type MediaPart, type ProviderMetadata, type ToolDefinition } from "../schema/index.js";
|
|
5
|
+
import { ProviderShared } from "./shared.js";
|
|
6
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
7
|
+
import { ToolStream } from "./utils/tool-stream.js";
|
|
8
8
|
export declare const PATH = "/responses";
|
|
9
9
|
declare const MediaInput: Schema.Union<readonly [Schema.Struct<{
|
|
10
10
|
readonly type: Schema.tag<"input_image">;
|
|
@@ -904,4 +904,4 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
|
904
904
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
905
905
|
readonly max_output_tokens?: number | undefined;
|
|
906
906
|
}, string>;
|
|
907
|
-
export * as OpenResponses from "./open-responses";
|
|
907
|
+
export * as OpenResponses from "./open-responses.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { HttpTransport } from "../route/transport";
|
|
3
|
-
import { Protocol } from "../route/protocol";
|
|
4
|
-
import { AIError, LLMEvent, Usage, } from "../schema";
|
|
5
|
-
import { JsonObject, optionalArray, optionalNull, ProviderShared } from "./shared";
|
|
6
|
-
import { classifyProviderFailure } from "../provider-error";
|
|
7
|
-
import { OpenResponsesOptions } from "./utils/open-responses-options";
|
|
8
|
-
import { Lifecycle } from "./utils/lifecycle";
|
|
9
|
-
import { ToolSchemaProjection } from "./utils/tool-schema";
|
|
10
|
-
import { ToolStream } from "./utils/tool-stream";
|
|
2
|
+
import { HttpTransport } from "../route/transport/index.js";
|
|
3
|
+
import { Protocol } from "../route/protocol.js";
|
|
4
|
+
import { AIError, LLMEvent, Usage, } from "../schema/index.js";
|
|
5
|
+
import { JsonObject, optionalArray, optionalNull, ProviderShared } from "./shared.js";
|
|
6
|
+
import { classifyProviderFailure } from "../provider-error.js";
|
|
7
|
+
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
8
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
9
|
+
import { ToolSchemaProjection } from "./utils/tool-schema.js";
|
|
10
|
+
import { ToolStream } from "./utils/tool-stream.js";
|
|
11
11
|
const ADAPTER = "open-responses";
|
|
12
12
|
const NAME = "Open Responses";
|
|
13
13
|
const MEDIA_MIMES = new Set([...ProviderShared.IMAGE_MIMES, ...ProviderShared.PDF_MIMES]);
|
|
@@ -840,4 +840,4 @@ export const protocol = Protocol.make({
|
|
|
840
840
|
},
|
|
841
841
|
});
|
|
842
842
|
export const httpTransport = HttpTransport.sseJson.with();
|
|
843
|
-
export * as OpenResponses from "./open-responses";
|
|
843
|
+
export * as OpenResponses from "./open-responses.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { Route } from "../route/client";
|
|
3
|
-
import { HttpTransport } from "../route/transport";
|
|
4
|
-
import { Protocol } from "../route/protocol";
|
|
5
|
-
import { AIError, LLMEvent, Usage, type FinishReasonDetails, type CacheHint, type LLMRequest } from "../schema";
|
|
6
|
-
import { Lifecycle } from "./utils/lifecycle";
|
|
7
|
-
import { ToolStream } from "./utils/tool-stream";
|
|
2
|
+
import { Route } from "../route/client.js";
|
|
3
|
+
import { HttpTransport } from "../route/transport/index.js";
|
|
4
|
+
import { Protocol } from "../route/protocol.js";
|
|
5
|
+
import { AIError, LLMEvent, Usage, type FinishReasonDetails, type CacheHint, type LLMRequest } from "../schema/index.js";
|
|
6
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
7
|
+
import { ToolStream } from "./utils/tool-stream.js";
|
|
8
8
|
export declare const DEFAULT_BASE_URL = "https://api.openai.com/v1";
|
|
9
9
|
export declare const PATH = "/chat/completions";
|
|
10
10
|
declare const OpenAIChatCacheControl: Schema.Struct<{
|
|
@@ -792,4 +792,4 @@ export declare const route: Route<{
|
|
|
792
792
|
readonly frequency_penalty?: number | undefined;
|
|
793
793
|
readonly presence_penalty?: number | undefined;
|
|
794
794
|
}, HttpTransport.HttpPrepared<string>>;
|
|
795
|
-
export * as OpenAIChat from "./openai-chat";
|
|
795
|
+
export * as OpenAIChat from "./openai-chat.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { Tool } from "@opencode-ai/schema/tool";
|
|
3
|
-
import { Route } from "../route/client";
|
|
4
|
-
import { Auth } from "../route/auth";
|
|
5
|
-
import { Endpoint } from "../route/endpoint";
|
|
6
|
-
import { HttpTransport } from "../route/transport";
|
|
7
|
-
import { Protocol } from "../route/protocol";
|
|
8
|
-
import { AIError, LLMEvent, Usage, } from "../schema";
|
|
9
|
-
import { classifyProviderFailure } from "../provider-error";
|
|
10
|
-
import { isRecord, JsonObject, optionalArray, optionalNull, ProviderShared } from "./shared";
|
|
11
|
-
import { OpenAIOptions } from "./utils/openai-options";
|
|
12
|
-
import { Lifecycle } from "./utils/lifecycle";
|
|
13
|
-
import { ToolSchemaProjection } from "./utils/tool-schema";
|
|
14
|
-
import { ToolStream } from "./utils/tool-stream";
|
|
3
|
+
import { Route } from "../route/client.js";
|
|
4
|
+
import { Auth } from "../route/auth.js";
|
|
5
|
+
import { Endpoint } from "../route/endpoint.js";
|
|
6
|
+
import { HttpTransport } from "../route/transport/index.js";
|
|
7
|
+
import { Protocol } from "../route/protocol.js";
|
|
8
|
+
import { AIError, LLMEvent, Usage, } from "../schema/index.js";
|
|
9
|
+
import { classifyProviderFailure } from "../provider-error.js";
|
|
10
|
+
import { isRecord, JsonObject, optionalArray, optionalNull, ProviderShared } from "./shared.js";
|
|
11
|
+
import { OpenAIOptions } from "./utils/openai-options.js";
|
|
12
|
+
import { Lifecycle } from "./utils/lifecycle.js";
|
|
13
|
+
import { ToolSchemaProjection } from "./utils/tool-schema.js";
|
|
14
|
+
import { ToolStream } from "./utils/tool-stream.js";
|
|
15
15
|
const ADAPTER = "openai-chat";
|
|
16
16
|
const IMAGE_MIMES = new Set(ProviderShared.IMAGE_MIMES);
|
|
17
17
|
const RESERVED_REASONING_FIELDS = new Set(["role", "content", "tool_calls"]);
|
|
@@ -715,4 +715,4 @@ export const route = Route.make({
|
|
|
715
715
|
auth: Auth.none,
|
|
716
716
|
transport: httpTransport,
|
|
717
717
|
});
|
|
718
|
-
export * as OpenAIChat from "./openai-chat";
|
|
718
|
+
export * as OpenAIChat from "./openai-chat.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Route, type RouteRoutedLanguageModelInput } from "../route/client";
|
|
1
|
+
import { Route, type RouteRoutedLanguageModelInput } from "../route/client.js";
|
|
2
2
|
export type OpenAICompatibleChatLanguageModelInput = RouteRoutedLanguageModelInput;
|
|
3
3
|
/**
|
|
4
4
|
* Route for non-OpenAI providers that expose an OpenAI Chat-compatible
|
|
@@ -103,5 +103,5 @@ export declare const route: Route<{
|
|
|
103
103
|
readonly reasoning_effort?: string | undefined;
|
|
104
104
|
readonly frequency_penalty?: number | undefined;
|
|
105
105
|
readonly presence_penalty?: number | undefined;
|
|
106
|
-
}, import("../route/transport/http").HttpPrepared<string>>;
|
|
107
|
-
export * as OpenAICompatibleChat from "./openai-compatible-chat";
|
|
106
|
+
}, import("../route/transport/http.js").HttpPrepared<string>>;
|
|
107
|
+
export * as OpenAICompatibleChat from "./openai-compatible-chat.js";
|