diff --git a/chat.proto b/chat.proto new file mode 100644 index 0000000..ed94500 --- /dev/null +++ b/chat.proto @@ -0,0 +1,81 @@ +syntax = "proto3"; + +package chat; + +// _______ ________ | +// |ooooooo| ____ | __ __ | | +// |[]+++[]| [____] |/ \/ \| | +// |+ ___ +| ]()()[ |\__/\__/| | +// |:| |:| ___\__/___ |[][][][]| | +// |:|___|:| |__| |__| |++++++++| | +// |[]===[]| |_|_/\_|_| | ______ | | +// _ ||||||||| _ | | __ | | __ ||______|| __| +// |_______| |_|[::]|_| |________| \ +// \_|_||_|_/ jro\ +// |_||_| \ +// _|_||_|_ \ +// ____ |___||___| \ +// / __\ ____ \ +// \( oo (___ \ \ +// _\_o/ oo~)/ +// / \|/ \ _\-_/_ +// / / __\ \___ / \|/ \ +// \ \| |__/_) / / .- \ \ +// \/_) | \ \ . /_/ +// ||___| \/___(_/ +// | | | | | | +// | | | | | | +// |_|_| |_|__| +// [__)_) (_(___] +// Credit: https://www.asciiart.eu/ + +option go_package = "github.com/overmindtech/sdp-go;sdp"; + +// this is based on https://platform.openai.com/docs/api-reference/messages/object +message ChatMessage { + repeated Content content = 1; + repeated Attachments attachments = 2; +} + +message Content { + string type = 1; + oneof content { + Text text = 2; + ImageFile imageFile = 3; + ImageURL imageURL = 4; + } +} + +message ImageFile { + string fileID = 1; + string detail = 2; +} + +message ImageURL { + string url = 1; + string detail = 2; +} + +message Text { + string text = 1; +} + +message Attachments { + string fileID = 1; + repeated Tools tools = 2; +} + +message Tools { + oneof tool { + CodeInterpreter codeInterpreter = 1; + FileSearch fileSearch = 2; + } +} + +message CodeInterpreter { + string Type = 1; +} + +message FileSearch { + string Type = 1; +} diff --git a/gateway.proto b/gateway.proto index 8df5ae8..bbe1aa4 100644 --- a/gateway.proto +++ b/gateway.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package gateway; +import "chat.proto"; import "items.proto"; import "responses.proto"; import "google/protobuf/duration.proto"; @@ -60,6 +61,7 @@ message GatewayRequest { // CancelLoadBookmark cancelLoadBookmark = ??; // // undo the loading of a Bookmark // UndoLoadBookmark undoLoadBookmark = ??; + SendChatMessage sendChatMessage = 16; } optional google.protobuf.Duration minStatusInterval = 2; // Minimum time between status updates. Setting this value too low can result in too many status messages @@ -90,6 +92,8 @@ message GatewayResponse { BookmarkLoadResult bookmarkLoadResult = 16; QueryStatus queryStatus = 17; // Status of requested queries + + ChatMessageResult chatMessageResult = 18; } } @@ -205,3 +209,22 @@ message SnapshotLoadResult { // a correlation ID to match up requests and responses. this field returns the contents of the request's msgID bytes msgID = 4; } + +message SendChatMessage { + // a correlation ID to match up requests and responses. set this to a value unique per connection + bytes msgID = 1; + // The message to create + string message = 2; + // we can in future only use ChatMessage instead of 'string message' + chat.ChatMessage chatMessage = 3; +} + +message ChatMessageResult { + // a correlation ID to match up requests and responses. this field returns the contents of the request's msgID + bytes msgID = 1; + bool success = 2; + string errorMessage = 3; + string message = 4; + // we can in future only use ChatMessage instead of 'string message' + chat.ChatMessage chatMessage = 5; +}