google.ts 461 B

123456789101112131415
  1. import { Effect } from "effect"
  2. import { PluginV2 } from "../../plugin"
  3. export const GooglePlugin = PluginV2.define({
  4. id: PluginV2.ID.make("google"),
  5. effect: Effect.gen(function* () {
  6. return {
  7. "aisdk.sdk": Effect.fn(function* (evt) {
  8. if (evt.package !== "@ai-sdk/google") return
  9. const mod = yield* Effect.promise(() => import("@ai-sdk/google"))
  10. evt.sdk = mod.createGoogleGenerativeAI(evt.options)
  11. }),
  12. }
  13. }),
  14. })