-
Notifications
You must be signed in to change notification settings - Fork 245
Open
Description
Description
The Name attribute for the response.function_call_arguments.done event is Null so you can't figure out which function to call.
It looks very similar to the issue in the Python library.
import (
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/responses"
)
//...
//...
//...
client := openai.NewClient()
ctx := context.Background()
params := responses.ResponseNewParams{
Model: model.Selector,
MaxOutputTokens: openai.Int(int64(math.Min(model.MaxContextW, (user.Credits / (model.TokenPrice.Output / oneMillion))))),
Store: openai.Bool(false),
Tools: openai_tools.ToolsV2,
}
stream := client.Responses.NewStreaming(ctx, params)
for stream.Next() {
chunk := stream.Current()
//...
//...
if chunk.Type == "response.function_call_arguments.done" {
log.Println("finish-event: tool call stream finished:", chunk.Name, chunk.ItemID, chunk.Arguments)
//...
//...
}
//...
//...
}The result of log.Println("finish-event: tool call stream finished:", chunk.Name, chunk.ItemID, chunk.Arguments) is:
finish-event: tool call stream finished: fc_0c05fd7058d532be01693777ee9ef08198973ae5ceaf161a88 {"query":"best cocktail bars Raleigh signature cocktail best cocktails Raleigh 2025 "best cocktail in Raleigh""}
The attribute Name at chunk object is null.
That makes it impossible to know which tool was called and therefore there is no option for the use of multiple tools.
As per Responses Streaming Events at OpenAI Docs, the emitted object is:
{
"type": "response.function_call_arguments.done",
"item_id": "item-abc",
"name": "get_weather",
"output_index": 1,
"arguments": "{ \"arg\": 123 }",
"sequence_number": 1
}Metadata
Metadata
Assignees
Labels
No labels