Skip to content

Commit 0198bc2

Browse files
committed
feat: add Output field to FunctionCall struct
- Added the `Output` string field to the `FunctionCall` struct as described in the OpenAI API docs.
1 parent 2a0ff5a commit 0198bc2

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

chat.go

+1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ type FunctionCall struct {
188188
Name string `json:"name,omitempty"`
189189
// call function with arguments in JSON format
190190
Arguments string `json:"arguments,omitempty"`
191+
Output string `json:"output,omitempty"`
191192
}
192193

193194
type ChatCompletionResponseFormatType string

run_test.go

+12
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ func TestRun(t *testing.T) {
5252
Object: "run",
5353
CreatedAt: 1234567890,
5454
Status: openai.RunStepStatusCompleted,
55+
StepDetails: openai.StepDetails{
56+
Type: openai.RunStepTypeToolCalls,
57+
ToolCalls: []openai.ToolCall{
58+
{
59+
Function: openai.FunctionCall{
60+
Name: "test",
61+
Arguments: "{}",
62+
Output: "test",
63+
},
64+
},
65+
},
66+
},
5567
},
5668
},
5769
})

0 commit comments

Comments
 (0)