| 1 | import { assert, describe, it } from "@effect/vitest" |
| 2 | import { Effect, Layer } from "effect" |
| 3 | import { Model } from "effect/ai" |
| 4 | |
| 5 | describe("Model", () => { |
| 6 | it.effect("provides metadata alongside the wrapped layer for the duration of the scope", () => |
| 7 | Effect.gen(function*() { |
| 8 | const providerName = yield* Model.ProviderName |
| 9 | const modelName = yield* Model.ModelName |
| 10 | |
| 11 | assert.strictEqual(providerName, "openai") |
| 12 | assert.strictEqual(modelName, "gpt-5") |
| 13 | }).pipe( |
| 14 | Effect.provide(Model.make("openai", "gpt-5", Layer.empty)) |
| 15 | )) |
| 16 | }) |