Skip to content

Commit d5307fd

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 d5307fd

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-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

+13
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func TestRun(t *testing.T) {
2222
order := "desc"
2323
after := "asst_abc122"
2424
before := "asst_abc124"
25+
functionCallOutput := "test"
2526

2627
client, server, teardown := setupOpenAITestServer()
2728
defer teardown()
@@ -52,6 +53,18 @@ func TestRun(t *testing.T) {
5253
Object: "run",
5354
CreatedAt: 1234567890,
5455
Status: openai.RunStepStatusCompleted,
56+
StepDetails: openai.StepDetails{
57+
Type: openai.RunStepTypeToolCalls,
58+
ToolCalls: []openai.ToolCall{
59+
{
60+
Function: openai.FunctionCall{
61+
Name: "test",
62+
Arguments: "{}",
63+
Output: &functionCallOutput,
64+
},
65+
},
66+
},
67+
},
5568
},
5669
},
5770
})

0 commit comments

Comments
 (0)