Download packages/core/src/plugin/provider/gateway.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 426 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/core/src/plugin/provider/gateway.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/core/src/plugin/provider/gateway.ts
-
curl -L -o gateway.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/core/src/plugin/provider/gateway.ts
426 Bytes
| import { Effect } from "effect" | |
| import { define } from "../internal" | |
| export const GatewayPlugin = define({ | |
| id: "gateway", | |
| effect: Effect.fn(function* (ctx) { | |
| yield* ctx.aisdk.sdk( | |
| Effect.fn(function* (evt) { | |
| if (evt.package !== "@ai-sdk/gateway") return | |
| const mod = yield* Effect.promise(() => import("@ai-sdk/gateway")) | |
| evt.sdk = mod.createGateway(evt.options) | |
| }), | |
| ) | |
| }), | |
| }) | |