From 8c7b5f03b82aca37b265c1a62b5efa9f325862c0 Mon Sep 17 00:00:00 2001 From: TP Honey Date: Mon, 12 Aug 2024 17:00:47 +0100 Subject: [PATCH] (feat) adding a rich assistant protocol --- gateway.proto | 54 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/gateway.proto b/gateway.proto index b9c84a1..027aaf7 100644 --- a/gateway.proto +++ b/gateway.proto @@ -211,12 +211,60 @@ message SnapshotLoadResult { message ChatMessage { // The message to create - string message = 1; + oneof request_type { + MessagePayload message = 1; + // Cancel the last message sent to openAI, includes the message and tools that were started + bool cancel = 2; + } +} + +message MessagePayload { + // The text to send + string text = 1; + // this can be expanded to add in attachments, etc +} + +message MessageError { + // If an error has occured with openAI + string error = 1; +} + +message MessageInfo { + // An informational message, eg a cancellation notice + string info = 1; +} + +message ToolProperty { + // eg "method":"LIST" or "type":"ec2-instance" + string key = 1; + string value = 2; +} + +message MessageToolStart { + // The toolID from openAI + string toolCallID = 1; + // The tool name, eg query + string tool = 2; + // array of key value pairs + repeated ToolProperty properties = 3; + +} + +message MessageToolEnd { + // The toolID from openAI + string toolCallID = 1; + // the raw string output passed to openAI + string output = 2; + // the error message from the tool + string error = 3; } message ChatMessageResult { oneof response_type { - string error = 1; - string message = 2; + MessagePayload message = 1; + string error = 2; + string info = 3; + MessageToolStart toolStart = 4; + MessageToolEnd toolEnd = 5; } }