Buckets:
| import { Effect } from "effect" | |
| import { ModelV2 } from "../../model" | |
| import { PluginV2 } from "../../plugin" | |
| import { ProviderV2 } from "../../provider" | |
| import { Integration } from "../../integration" | |
| import { browser, headless } from "./openai-auth" | |
| export const OpenAIPlugin = PluginV2.define({ | |
| id: PluginV2.ID.make("openai"), | |
| effect: Effect.gen(function* () { | |
| const integrations = yield* Integration.Service | |
| yield* integrations.update((editor) => { | |
| editor.method.update(browser) | |
| editor.method.update(headless) | |
| }) | |
| return { | |
| "aisdk.sdk": Effect.fn(function* (evt) { | |
| if (evt.package !== "@ai-sdk/openai") return | |
| const mod = yield* Effect.promise(() => import("@ai-sdk/openai")) | |
| evt.sdk = mod.createOpenAI(evt.options) | |
| }), | |
| "aisdk.language": Effect.fn(function* (evt) { | |
| if (evt.model.providerID !== ProviderV2.ID.openai) return | |
| evt.language = evt.sdk.responses(evt.model.api.id) | |
| }), | |
| "catalog.transform": Effect.fn(function* (evt) { | |
| for (const item of evt.provider.list()) { | |
| if (item.provider.api.type !== "aisdk") continue | |
| if (item.provider.api.package !== "@ai-sdk/openai") continue | |
| if (!item.models.has(ModelV2.ID.make("gpt-5-chat-latest"))) continue | |
| evt.model.update(item.provider.id, ModelV2.ID.make("gpt-5-chat-latest"), (model) => { | |
| // OpenAIPlugin sends OpenAI models through Responses; this alias is a | |
| // chat-completions-only model, so hide it only from OpenAI's catalog. | |
| model.enabled = false | |
| }) | |
| } | |
| }), | |
| } | |
| }), | |
| }) | |
Xet Storage Details
- Size:
- 1.64 kB
- Xet hash:
- f264b1cb252529d9c08586c66437fbbd8537cb58899f85a6602d9e6899ff3dd3
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.