Skip to content

Commit f648419

Browse files
committed
relax the test message shape to support incoming refusal
1 parent cf62d07 commit f648419

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

openai/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ local content_format = types.string + types.array_of(types.one_of({
1919
})
2020
}))
2121
local test_message = types.one_of({
22-
types.shape({
22+
types.partial({
2323
role = types.one_of({
2424
"system",
2525
"user",
@@ -29,7 +29,7 @@ local test_message = types.one_of({
2929
name = empty + types.string,
3030
function_call = empty + types.table
3131
}),
32-
types.shape({
32+
types.partial({
3333
role = types.one_of({
3434
"function"
3535
}),

openai/init.moon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ content_format = types.string + types.array_of types.one_of {
1919
}
2020

2121
test_message = types.one_of {
22-
types.shape {
22+
types.partial {
2323
role: types.one_of {"system", "user", "assistant"}
2424
content: empty + content_format -- this can be empty when function_call is set
2525
name: empty + types.string
2626
function_call: empty + types.table
2727
}
2828

2929
-- this message type is for sending a function call response back
30-
types.shape {
30+
types.partial {
3131
role: types.one_of {"function"}
3232
name: types.string
3333
content: empty + types.string

0 commit comments

Comments
 (0)