fix(core): tolerate missing models.dev temperature
This commit is contained in:
parent
bf3ae45439
commit
34a08cbdb8
2 changed files with 17 additions and 1 deletions
|
|
@ -67,7 +67,7 @@ export const Model = Schema.Struct({
|
||||||
attachment: Schema.Boolean,
|
attachment: Schema.Boolean,
|
||||||
reasoning: Schema.Boolean,
|
reasoning: Schema.Boolean,
|
||||||
reasoning_options: Schema.optional(Schema.Array(ReasoningOption)),
|
reasoning_options: Schema.optional(Schema.Array(ReasoningOption)),
|
||||||
temperature: Schema.Boolean,
|
temperature: Schema.optional(Schema.Boolean),
|
||||||
tool_call: Schema.Boolean,
|
tool_call: Schema.Boolean,
|
||||||
interleaved: Schema.optional(
|
interleaved: Schema.optional(
|
||||||
Schema.Union([
|
Schema.Union([
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,22 @@ describe("ModelsDev Service", () => {
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
it.effect("allows models.dev entries without temperature metadata", () =>
|
||||||
|
Effect.sync(() => {
|
||||||
|
const result = Schema.decodeUnknownSync(ModelsDev.Model)({
|
||||||
|
id: "no-temperature-model",
|
||||||
|
name: "No Temperature Model",
|
||||||
|
release_date: "2026-01-01",
|
||||||
|
attachment: false,
|
||||||
|
reasoning: false,
|
||||||
|
tool_call: true,
|
||||||
|
limit: { context: 128000, output: 8192 },
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(result.temperature).toBeUndefined()
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
it.live("get() returns providers from disk when cache file exists", () =>
|
it.live("get() returns providers from disk when cache file exists", () =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
yield* writeCache(fixture)
|
yield* writeCache(fixture)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue