refactor(core): nest model api id (#30603)

This commit is contained in:
Dax
2026-06-03 14:11:38 -04:00
committed by GitHub
parent af6383485b
commit 11dbd15812
35 changed files with 129 additions and 79 deletions
@@ -12,8 +12,8 @@ const it = testEffect(PluginV2.locationLayer.pipe(Layer.provide(EventV2.defaultL
const model = new ModelV2.Info({
...ModelV2.Info.empty(ProviderV2.ID.make("xai"), ModelV2.ID.make("grok-4")),
apiID: ModelV2.ID.make("grok-4"),
api: {
id: ModelV2.ID.make("grok-4"),
type: "aisdk",
package: "@ai-sdk/xai",
},
@@ -72,7 +72,7 @@ describe("XAIPlugin", () => {
}),
)
it.effect("uses responses with the model apiID for xAI language models", () =>
it.effect("uses responses with the model api.id for xAI language models", () =>
Effect.gen(function* () {
const plugin = yield* PluginV2.Service
const calls: string[] = []
@@ -81,7 +81,7 @@ describe("XAIPlugin", () => {
const result = yield* plugin.trigger(
"aisdk.language",
{
model: new ModelV2.Info({ ...model, id: ModelV2.ID.make("alias"), apiID: ModelV2.ID.make("grok-4") }),
model: new ModelV2.Info({ ...model, id: ModelV2.ID.make("alias") }),
sdk: fakeSelectorSdk(calls),
options: {},
},