Skip to content

Commit

Permalink
(feat) add gateway assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
tphoney committed Jul 22, 2024
1 parent 1f22472 commit bcdc17a
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 0 deletions.
113 changes: 113 additions & 0 deletions assistant.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
syntax = "proto3";

package assistant;

import "google/protobuf/timestamp.proto";
// _______ ________ |
// |ooooooo| ____ | __ __ | |
// |[]+++[]| [____] |/ \/ \| |
// |+ ___ +| ]()()[ |\__/\__/| |
// |:| |:| ___\__/___ |[][][][]| |
// |:|___|:| |__| |__| |++++++++| |
// |[]===[]| |_|_/\_|_| | ______ | |
// _ ||||||||| _ | | __ | | __ ||______|| __|
// |_______| |_|[::]|_| |________| \
// \_|_||_|_/ jro\
// |_||_| \
// _|_||_|_ \
// ____ |___||___| \
// / __\ ____ \
// \( oo (___ \ \
// _\_o/ oo~)/
// / \|/ \ _\-_/_
// / / __\ \___ / \|/ \
// \ \| |__/_) / / .- \ \
// \/_) | \ \ . /_/
// ||___| \/___(_/
// | | | | | |
// | | | | | |
// |_|_| |_|__|
// [__)_) (_(___]
// Credit: https://www.asciiart.eu/

option go_package = "github.com/overmindtech/sdp-go;sdp";

service AssistantService {
// CreateMessage creates a new message
rpc CreateAssistantMessage(CreateAssistantMessageRequest) returns (CreateAssistantMessageResponse);
// ListMessages returns all messages for a given user, and thread.
rpc ListAssistantMessages(ListAssistantMessagesRequest) returns (ListAssistantMessagesResponse);
}

// Assistant messages
message CreateAssistantMessageRequest {
AssistantMessage message = 1;
}

message CreateAssistantMessageResponse {
AssistantMessage message = 1;
}

message AssistantMessage {
string id = 1;
google.protobuf.Timestamp createdAt = 2;
string threadID= 3;
string status = 4;
google.protobuf.Timestamp completedAt = 5;
string assistantID = 6;
repeated Content content = 7;
repeated Attachments attachments = 8;
}

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;
}

// ListMessages request and response
message ListAssistantMessagesRequest {
string userID = 1;
string threadID = 2;
}

message ListAssistantMessagesResponse {
repeated AssistantMessage messages = 1;
}
30 changes: 30 additions & 0 deletions gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ message GatewayRequest {
// CancelLoadBookmark cancelLoadBookmark = ??;
// // undo the loading of a Bookmark
// UndoLoadBookmark undoLoadBookmark = ??;
CreateAssistantMessage createAssistantMessage = 16;
ListAssistantMessages listAssistantMessages = 17;
}

optional google.protobuf.Duration minStatusInterval = 2; // Minimum time between status updates. Setting this value too low can result in too many status messages
Expand Down Expand Up @@ -90,6 +92,9 @@ message GatewayResponse {
BookmarkLoadResult bookmarkLoadResult = 16;

QueryStatus queryStatus = 17; // Status of requested queries

AssistantMessageResult assistantMessageResult = 18;
ListAssistantMessagesResult listAssistantMessagesResult = 19;
}
}

Expand Down Expand Up @@ -205,3 +210,28 @@ 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 CreateAssistantMessage {
// The message to create
string message = 1;
// a correlation ID to match up requests and responses. set this to a value unique per connection
bytes msgID = 2;
}

message AssistantMessageResult {
bool success = 1;
string errorMessage = 2;
// a correlation ID to match up requests and responses. this field returns the contents of the request's msgID
bytes msgID = 3;
}

message ListAssistantMessages {
// a correlation ID to match up requests and responses. set this to a value unique per connection
bytes msgID = 1;
}

message ListAssistantMessagesResult {
repeated string messages = 1;
// a correlation ID to match up requests and responses. this field returns the contents of the request's msgID
bytes msgID = 2;
}

0 comments on commit bcdc17a

Please sign in to comment.