Skip to content

Commit

Permalink
feat(model): add separate states for scaling (#429)
Browse files Browse the repository at this point in the history
Because

- When only "Scaling" is displayed, users don't know which specific
status it refers to.

This commit

- add separate states for scaling

---------

Co-authored-by: droplet-bot <[email protected]>
  • Loading branch information
heiruwu and droplet-bot committed Aug 20, 2024
1 parent 87e199c commit e72ed75
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 147 deletions.
4 changes: 1 addition & 3 deletions artifact/artifact/v1alpha/artifact_public_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ package artifact.artifact.v1alpha;
// Artifact definitions
import "artifact/artifact/v1alpha/artifact.proto";
import "artifact/artifact/v1alpha/chunk.proto";
import "artifact/artifact/v1alpha/conversation.proto";
import "artifact/artifact/v1alpha/file_catalog.proto";
import "artifact/artifact/v1alpha/qa.proto";
import "artifact/artifact/v1alpha/conversation.proto";

// Google API
import "google/api/annotations.proto";
import "google/api/visibility.proto";
Expand Down Expand Up @@ -200,5 +199,4 @@ service ArtifactPublicService {
option (google.api.http) = {delete: "/v1alpha/namespaces/{namespace_id}/catalogs/{catalog_id}/conversations/{conversation_id}/messages/{message_uid}"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Catalog"};
}

}
263 changes: 130 additions & 133 deletions artifact/artifact/v1alpha/conversation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,206 +2,203 @@ syntax = "proto3";

package artifact.artifact.v1alpha;

import "google/api/field_behavior.proto";
// Protocol Buffers Well-Known Types
import "google/protobuf/timestamp.proto";
import "google/api/field_behavior.proto";



// Conversation represents a chat conversation
message Conversation {
// unique identifier of the conversation created by the system
string uid = 1;
// namespace id
string namespace_id = 2;
// catalog id
string catalog_id = 3;
// conversation id/name
string id = 4;
// creation time of the conversation
google.protobuf.Timestamp create_time = 5;
// update time of the conversation
google.protobuf.Timestamp update_time = 6;
// unique identifier of the conversation created by the system
string uid = 1;
// namespace id
string namespace_id = 2;
// catalog id
string catalog_id = 3;
// conversation id/name
string id = 4;
// creation time of the conversation
google.protobuf.Timestamp create_time = 5;
// update time of the conversation
google.protobuf.Timestamp update_time = 6;
}

// Message represents a single message in a conversation
message Message {
// message type
enum MessageType {
// unspecified
MESSAGE_TYPE_UNSPECIFIED = 0;
// text
MESSAGE_TYPE_TEXT = 1;
}
// message uid
string uid = 1;
// catalog uid
string catalog_uid = 2;
// conversation uid
string conversation_uid = 3;
// message content
string content = 4;
// message role e.g., "user" or "assistant"
string role = 5;
// message type
MessageType type = 6;
// creation time of the message
google.protobuf.Timestamp create_time = 7;
// update time of the message
google.protobuf.Timestamp update_time = 8;
// message type
enum MessageType {
// unspecified
MESSAGE_TYPE_UNSPECIFIED = 0;
// text
MESSAGE_TYPE_TEXT = 1;
}
// message uid
string uid = 1;
// catalog uid
string catalog_uid = 2;
// conversation uid
string conversation_uid = 3;
// message content
string content = 4;
// message role e.g., "user" or "assistant"
string role = 5;
// message type
MessageType type = 6;
// creation time of the message
google.protobuf.Timestamp create_time = 7;
// update time of the message
google.protobuf.Timestamp update_time = 8;
}

// CreateConversationRequest is used to create a new conversation
message CreateConversationRequest {
// namespace id
string namespace_id = 1 [(google.api.field_behavior) = REQUIRED];
// catalog id
string catalog_id = 2;
// conversation id. only allow kebab case
string conversation_id = 3 [(google.api.field_behavior) = REQUIRED];
// namespace id
string namespace_id = 1 [(google.api.field_behavior) = REQUIRED];
// catalog id
string catalog_id = 2;
// conversation id. only allow kebab case
string conversation_id = 3 [(google.api.field_behavior) = REQUIRED];
}

// CreateConversationResponse returns the created conversation
message CreateConversationResponse {
// conversation
Conversation conversation = 1;
// conversation
Conversation conversation = 1;
}

// ListConversationsRequest is used to list conversations
message ListConversationsRequest {
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// page size
int32 page_size = 3;
// page token
string page_token = 4;
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// page size
int32 page_size = 3;
// page token
string page_token = 4;
}

// ListConversationsResponse returns a list of conversations
message ListConversationsResponse {
// conversations
repeated Conversation conversations = 1;
// next page token
string next_page_token = 2;
// total size
int32 total_size = 3;
// conversations
repeated Conversation conversations = 1;
// next page token
string next_page_token = 2;
// total size
int32 total_size = 3;
}

// UpdateConversationRequest is used to update a conversation
message UpdateConversationRequest {
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// conversation id
string conversation_id = 3;
// new conversation id
string new_conversation_id = 4;
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// conversation id
string conversation_id = 3;
// new conversation id
string new_conversation_id = 4;
}

// UpdateConversationResponse returns the updated conversation
message UpdateConversationResponse {
// conversation
Conversation conversation = 1;
// conversation
Conversation conversation = 1;
}

// DeleteConversationRequest is used to delete a conversation
message DeleteConversationRequest {
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// conversation id
string conversation_id = 3;
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// conversation id
string conversation_id = 3;
}

// DeleteConversationResponse is empty as no content needs to be returned
message DeleteConversationResponse {
}
message DeleteConversationResponse {}

// CreateMessageRequest is used to create a new message
message CreateMessageRequest {
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// conversation id
string conversation_id = 3;
// message content
string content = 4;
// message role
string role = 5;
// message type
Message.MessageType type = 6;
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// conversation id
string conversation_id = 3;
// message content
string content = 4;
// message role
string role = 5;
// message type
Message.MessageType type = 6;
}

// CreateMessageResponse returns the created message
message CreateMessageResponse {
// message
Message message = 1;
// message
Message message = 1;
}

// ListMessagesRequest is used to list messages in a conversation
message ListMessagesRequest {
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// conversation id
string conversation_id = 3;
// latest k messages
int32 latest_k = 4;
// page size
int32 page_size = 5;
// page token
string page_token = 6;
// include system messages
bool include_system_messages = 7;
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// conversation id
string conversation_id = 3;
// latest k messages
int32 latest_k = 4;
// page size
int32 page_size = 5;
// page token
string page_token = 6;
// include system messages
bool include_system_messages = 7;
}

// ListMessagesResponse returns a list of messages
message ListMessagesResponse {
// messages
repeated Message messages = 1;
// next page token
string next_page_token = 2;
// total size
int32 total_size = 3;
// messages
repeated Message messages = 1;
// next page token
string next_page_token = 2;
// total size
int32 total_size = 3;
}

// UpdateMessageRequest is used to update a message
message UpdateMessageRequest {
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// conversation id
string conversation_id = 3;
// message uid
string message_uid = 4;
// new message content
string content = 5;
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// conversation id
string conversation_id = 3;
// message uid
string message_uid = 4;
// new message content
string content = 5;
}

// UpdateMessageResponse returns the updated message
message UpdateMessageResponse {
// message
Message message = 1;
// message
Message message = 1;
}

// DeleteMessageRequest is used to delete a message
message DeleteMessageRequest {
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// conversation id
string conversation_id = 3;
// message uid
string message_uid = 4;
// namespace id
string namespace_id = 1;
// catalog id
string catalog_id = 2;
// conversation id
string conversation_id = 3;
// message uid
string message_uid = 4;
}

// DeleteMessageResponse is empty as no content needs to be returned
message DeleteMessageResponse {}
message DeleteMessageResponse {}
10 changes: 7 additions & 3 deletions model/model/v1alpha/model.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package model.model.v1alpha;

// common definitions
import "common/healthcheck/v1beta/healthcheck.proto";
import "common/task/v1alpha/task.proto";
import "common/run/v1alpha/run.proto";
import "common/task/v1alpha/task.proto";
// Core definitions
import "core/mgmt/v1beta/mgmt.proto";
// Google API
Expand Down Expand Up @@ -63,8 +63,8 @@ enum State {
STATE_UNSPECIFIED = 0;
// Offline is the state when the model instance number is 0.
STATE_OFFLINE = 1;
// Scaling is the transition state when a model instance is scaling up or down.
STATE_SCALING = 2;
// Deprecate state.
reserved 2;
// Active is the state when a model is processing requests.
STATE_ACTIVE = 3;
// Idle is the state when a model is alive but not processing requests.
Expand All @@ -74,6 +74,10 @@ enum State {
// Starting is the state when the system is provisioning the necessary
// resources for the model
STATE_STARTING = 6;
// Scaling Up is the transition state when the system is provisioning compute resource for this model instance.
STATE_SCALING_UP = 7;
// Scaling is the transition state when the system is releasing compute resource for this model instance.
STATE_SCALING_DOWN = 8;
}

// ModelVersion contains information about the version of a model.
Expand Down
Loading

0 comments on commit e72ed75

Please sign in to comment.