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