Skip to content

Commit

Permalink
relax the test message shape to support incoming refusal
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Aug 7, 2024
1 parent cf62d07 commit f648419
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions openai/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local content_format = types.string + types.array_of(types.one_of({
})
}))
local test_message = types.one_of({
types.shape({
types.partial({
role = types.one_of({
"system",
"user",
Expand All @@ -29,7 +29,7 @@ local test_message = types.one_of({
name = empty + types.string,
function_call = empty + types.table
}),
types.shape({
types.partial({
role = types.one_of({
"function"
}),
Expand Down
4 changes: 2 additions & 2 deletions openai/init.moon
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ content_format = types.string + types.array_of types.one_of {
}

test_message = types.one_of {
types.shape {
types.partial {
role: types.one_of {"system", "user", "assistant"}
content: empty + content_format -- this can be empty when function_call is set
name: empty + types.string
function_call: empty + types.table
}

-- this message type is for sending a function call response back
types.shape {
types.partial {
role: types.one_of {"function"}
name: types.string
content: empty + types.string
Expand Down

0 comments on commit f648419

Please sign in to comment.