feat(ai): support custom reasoning fields (#38227)
This commit is contained in:
parent
69c05ae3fc
commit
23483ea013
24 changed files with 306 additions and 67 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { describe, expect, test } from "bun:test"
|
||||
import { Schema } from "effect"
|
||||
import { Model } from "../src/model.js"
|
||||
|
||||
describe("Model.Ref", () => {
|
||||
|
|
@ -20,3 +21,12 @@ describe("Model.Ref", () => {
|
|||
expect(() => Model.Ref.parse("openai/gpt-5#high#extra")).toThrow()
|
||||
})
|
||||
})
|
||||
|
||||
describe("Model.ReasoningField", () => {
|
||||
test("accepts suggested and custom fields", () => {
|
||||
const decode = Schema.decodeUnknownSync(Model.ReasoningField)
|
||||
|
||||
for (const field of ["reasoning", "reasoning_content", "reasoning_text", "vendor_reasoning"])
|
||||
expect(decode(field)).toBe(field)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue