diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 000000000..47dc3e3d8 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/core/http/endpoints/openai/realtime.go b/core/http/endpoints/openai/realtime.go index b34ee031e..415e75b18 100644 --- a/core/http/endpoints/openai/realtime.go +++ b/core/http/endpoints/openai/realtime.go @@ -1046,6 +1046,27 @@ func triggerResponse(session *Session, conv *Conversation, c *LockedWebsocket, o Content: content.Text, }) } + } else if item.FunctionCall != nil { + conversationHistory = append(conversationHistory, schema.Message{ + Role: string(types.MessageRoleAssistant), + ToolCalls: []schema.ToolCall{ + { + ID: item.FunctionCall.CallID, + Type: "function", + FunctionCall: schema.FunctionCall{ + Name: item.FunctionCall.Name, + Arguments: item.FunctionCall.Arguments, + }, + }, + }, + }) + } else if item.FunctionCallOutput != nil { + conversationHistory = append(conversationHistory, schema.Message{ + Role: "tool", + Name: item.FunctionCallOutput.CallID, + Content: item.FunctionCallOutput.Output, + StringContent: item.FunctionCallOutput.Output, + }) } } conv.Lock.Unlock()