diff --git a/admin.proto b/admin.proto deleted file mode 100644 index 987c6f7..0000000 --- a/admin.proto +++ /dev/null @@ -1,286 +0,0 @@ -syntax = "proto3"; - -import "protoc-gen-openapiv2/options/annotations.proto"; - -import "admin_apikey.proto"; -import "admin_metric.proto"; -import "status.proto"; - -option go_package = "vectara.com/public/proto/admin"; - -option java_package = "com.vectara.admin"; -option java_outer_classname = "AdminProtos"; - -package com.vectara.admin; - -/****************************************************************************** - Corpus Management (add, remove corpora, star a corpus) - ******************************************************************************/ - -message Corpus { - // The Corpus ID. - // This value is ignored during Corpus creation. - uint32 id = 1; - // The name of the corpus. - string name = 2; - // A description for the corpus. - string description = 3; - // The time at which the corpus was provisioned. - // This value is ignored during Corpus creation. - int64 dt_provision = 4; - // Whether the corpus is enabled for use or not. - // This value is ignored during Corpus creation. - bool enabled = 5; - - - bool swap_qenc = 6; - // The default query encoder is designed for normal question-answering types - // of queries when the text contains the answer. Swapping the index encoder - // is generally rare, but can be used to help directly match questions to - // questions. This can be useful if you have a FAQ dataset and you want to - // directly match the user question to the question in the FAQ. - bool swap_ienc = 7; - // When a corpus is "textless", Vectara does not store the original text. - // Instead, Vectara converts the text to vectors and only retains metadata. - bool textless = 8; - // Encryption is on by default and cannot be turned off. - bool encrypted = 9; - - // This is an advanced setting for changing the underlying model type. The - // default value is "1", which is Vectara's high-performing global model. - // Underlying models may be swapped for some paying customers by contacting - // our support team. - uint64 encoder_id = 10; - // An optional maximum size of the metadata that each document can contain. - uint32 metadata_max_bytes = 11; - - - repeated Dimension custom_dimensions = 13; - repeated FilterAttribute filter_attributes = 14; -} - -// A custom dimension is additional numeric metadata that you want to affect -// Vectara's scoring. For example, these could be "number of stars" ratings, -// or other business metrics like a product's margins that you want to use -// to boost where a result is in the list. -message Dimension { - // The name of the custom dimension. The maximum length of the name is - // 8 characters. - string name = 1; - // A description for the custom dimension. - string description = 2; - - // The default weight to give this dimension when running queries. A value of - // 0.0, for example, gives it no weight at all. - double serving_default = 3; - // The default value to give to documents for this custom dimension. - double indexing_default = 4; -} - -// Defines metadata fields that can be used in predicate queries. -message FilterAttribute { - // Name of the field, as seen in metadata. - string name = 5; - // An optional description. - string description = 10; - // Whether the field is indexed for maximum query speed. - bool indexed = 15; - // The data type of the attribute. - FilterAttributeType type = 20; - // Whether the attribute lives at the document or part level. - FilterAttributeLevel level = 25; -} - -enum FilterAttributeType { - FILTER_ATTRIBUTE_TYPE__UNDEFINED = 0; - FILTER_ATTRIBUTE_TYPE__INTEGER = 5; - FILTER_ATTRIBUTE_TYPE__INTEGER_LIST = 10; - FILTER_ATTRIBUTE_TYPE__REAL = 15; - FILTER_ATTRIBUTE_TYPE__REAL_LIST = 20; - FILTER_ATTRIBUTE_TYPE__TEXT = 25; - FILTER_ATTRIBUTE_TYPE__TEXT_LIST = 30; - FILTER_ATTRIBUTE_TYPE__BOOLEAN = 35; -} - -enum FilterAttributeLevel { - FILTER_ATTRIBUTE_LEVEL__UNDEFINED = 0; - // Document-level attribute - FILTER_ATTRIBUTE_LEVEL__DOCUMENT = 5; - // Part-level attribute - FILTER_ATTRIBUTE_LEVEL__DOCUMENT_PART = 10; -} - -message CreateCorpusRequest { - Corpus corpus = 1; -} - -message CreateCorpusResponse { - // The Corpus ID that was created. - uint32 corpus_id = 1; - Status status = 2; -} - -message DeleteCorpusRequest { - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { - json_schema: { required: [ "customerId", "corpusId" ] } - example: "{ \"corpusId\": 1 }" - }; - - // The Customer ID that contains the corpus to be deleted. - uint32 customer_id = 1; - // The Corpus ID to be deleted. - uint32 corpus_id = 2 [ - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - minimum: 1 - }]; -} - -message DeleteCorpusResponse { - Status status = 1; -} - -message ResetCorpusRequest { - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { - json_schema: { required: [ "customerId", "corpusId" ] } - example: "{ \"corpusId\": 1 }" - }; - - // The Customer ID that contains the corpus to be reset. - uint32 customer_id = 1; - // The Corpus ID to be reset. - uint32 corpus_id = 2 [ - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - minimum: 1 - }]; -} - -message ResetCorpusResponse { - Status status = 1; -} - -message ListCorporaRequest { - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { - json_schema: { required: [ "numResults" ] } - example: "{ \"numResults\": 10, \"filter\": \"[Tt][Ee][Ss][Tt]\" }" - }; - - // A regex over the names and descriptions to match corpora against. - string filter = 2 [ - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - example: "\"[Tt][Ee][Ss][Tt]\"" - }]; - - // The maximum results to return. - uint32 num_results = 4 [ - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - minimum: 1 - }]; - - // A key that is passed in to retrieve a specific page of results. - bytes page_key = 5; -} - -message ListCorporaResponse { - repeated Corpus corpus = 1; - - // A key that is passed into a subsequent result in order to - // retrieve the next page of results. - bytes page_key = 2; - Status status = 1000; -} - -message UpdateCorpusEnablementRequest { - // The corpus to enable or disable. - uint32 corpus_id = 1; - // If true, enable the corpus. Otherwise, disable it. - bool enable = 2; -} - -message UpdateCorpusEnablementResponse { - Status status = 1; -} - -message CorpusSize { - // The time at which the size was calculated. - int64 epoch_secs = 1; - - // The size of the corpus. - uint64 size = 2; -} - -message ReadCorpusRequest { - // Corpora IDs to read. - repeated uint32 corpus_id = 1; - - // Subset of information to read. - // Set to true to read basic information about the corpus such as id, name, - // description, enabled, etc. - bool read_basic_info = 1000; - // Set to true to read the size of the corpus. - bool read_size = 1001; - // Set to true to read the API keys associated with the corpus. - bool read_api_keys = 1003; - // Set to true to read the custom dimensions of the corpus. - bool read_custom_dimensions = 1004; - // Set to true to read the filter attributes of the corpus. - bool read_filter_attributes = 1005; -} - -message ReadCorpusResponse { - // A Corpus information object containing the requested information. - message CorpusInfo { - // Only requested fields are populated. - Corpus corpus = 1; - // Status of the corpus. - Status corpus_status = 1001; - // Size of the corpus. Only populated if read_size is true. - CorpusSize size = 2; - // Status of the size. - Status size_status = 1002; - // API keys associated with the corpus. Only populated if read_api_keys is true. - repeated ApiKey api_key = 4; - // Status of the API keys. - Status api_key_status = 1004; - // Custom dimensions of the corpus. Only populated if read_custom_dimensions is true. - repeated Dimension custom_dimension = 5; - // Status of the custom dimensions. - Status custom_dimension_status = 1005; - // Filter attributes of the corpus. Only populated if read_filter_attributes is true. - repeated FilterAttribute filter_attribute = 6; - // Status of the filter attributes. - Status filter_attribute_status = 1006; - } - - // Information about the requested corpora. - repeated CorpusInfo corpora = 1; -} - -message ComputeCorpusSizeRequest { - // The corpus for which to compute the size. - uint32 corpus_id = 1; -} - -message ComputeCorpusSizeResponse { - // The size of the corpus. - CorpusSize size = 1; - // The status of the size computation. - Status status = 2; -} - -message ReplaceCorpusFilterAttrsRequest { - // The corpus for which to update filters. - uint32 corpus_id = 1; - // The filters to set. The existing filters are replaced with this list of filters. - repeated FilterAttribute filter_attributes = 10; -} - -message ReplaceCorpusFilterAttrsResponse { - Status status = 1000; - - // If 'status' represents success, this contains the ID assigned to the job - // for updating the list of filters. This ID can be used to query the status - // of the job. - string job_id = 10; -} - - diff --git a/admin_account.proto b/admin_account.proto deleted file mode 100644 index 35801d4..0000000 --- a/admin_account.proto +++ /dev/null @@ -1,33 +0,0 @@ -syntax = "proto3"; - -import "status.proto"; - -option go_package = "vectara.com/public/proto/admin"; - -option java_package = "com.vectara.admin"; -option java_outer_classname = "AdminAccountProtos"; - -package com.vectara.admin; - -// Please note that this is an expensive operation, and the requests can be throttled -// by the platform. -message ComputeAccountSizeRequest { -} - -// A TextSize object represents the size of stored text. -message TextSize { - // Count of actual characters in the text that will be searched. - uint64 num_chars = 1; - // Count of metadata characters such as URL, author, date of creation etc. - uint64 num_metadata_chars = 2; -} - -message ComputeAccountSizeResponse { - // One TextSize represents one cluster. The account size is a sum of all the sizes. - // Generally, this will only have one value. - repeated TextSize size = 1; - // Status response of the operation. - Status status = 2; -} - - diff --git a/admin_apikey.proto b/admin_apikey.proto deleted file mode 100644 index 6b0aadd..0000000 --- a/admin_apikey.proto +++ /dev/null @@ -1,146 +0,0 @@ -syntax = "proto3"; - -import "status.proto"; - -option go_package = "vectara.com/public/proto/admin"; - -option java_package = "com.vectara.admin"; -option java_outer_classname = "AdminApiKeyProtos"; - -package com.vectara.admin; - -/****************************************************************************** - API Keys - ******************************************************************************/ -// Types of ApiKey. -enum ApiKeyType { - API_KEY_TYPE__UNDEFINED = 0; - // ApiKey for serving. Only gives access to query data. - API_KEY_TYPE__SERVING = 1; - // ApiKey for serving and indexing. Gives access to both query and index data. - API_KEY_TYPE__SERVING_INDEXING = 2; - // ApiKey for personal access key. - API_KEY_TYPE__PERSONAL = 3; -} - -// Status of ApiKey. -enum ApiKeyStatus { - UNKNOWN = 0; - ENABLED = 1; - DISABLED = 2; - DELETED = 3; -} - -// Represents an ApiKey. -// An ApiKey provides anonymous access to common tasks such as index data, query data, etc. -message ApiKey { - string id = 1; - // Description of the ApiKey. - string description = 2; - // Type of the ApiKey. - ApiKeyType key_type = 3; - // Whether the ApiKey is enabled. - bool enabled = 4; - // Seconds sinch Epoch when the ApiKey becomes active. - optional int64 ts_start = 5; - // Seconds sinch Epoch when the ApiKey becomes inactive. - optional int64 ts_end = 6; - // Status of the ApiKey. - ApiKeyStatus status = 7; -} - -// This request can be used to create one or more ApiKeys. -// Every ApiKey is bound to one or more corpora. -message CreateApiKeyRequest { - // ApiKey data to create the ApiKey bound to one or more corpora. - message ApiKeyCorpus { - // Description of the ApiKey. - string description = 1; - // Type of the ApiKey. - ApiKeyType api_key_type = 3; - // List of corpus ids to bind the ApiKey to. - repeated uint32 corpus_id = 2; - } - // List of ApiKey data to create. - repeated ApiKeyCorpus api_key_data = 1; -} - -// Response of the CreateApiKeyRequest. -message CreateApiKeyResponse { - // A valid key or Status of the ApiKey creation (in case of failure). - message ApiKeyOrStatus { - // A valid ApiKey. - string key_id = 1; - // Status of the ApiKey creation. - Status status = 2; - } - // List of ApiKeyOrStatus corresponding to the list of ApiKey data in request. - repeated ApiKeyOrStatus response = 1; -} - -message ListApiKeysRequest { - // Max results to return. - uint32 num_results = 1; - // A key that is passed to retrieve a specific page of results. - // Leave empty to retrieve first page. Subsequent page requests should - // use the page key returned in previous response, and all other - // fields are ignored. - bytes page_key = 2; - // [Optional] Get API keys of these types. - // Default: If not set, API_KEY_TYPE__SERVING and API_KEY_TYPE__SERVING_INDEXING are returned. - repeated ApiKeyType api_key_type = 3; - // If set, returns corpus name & id associated with api keys. - bool read_corpora_info = 1000; -} - -message ListApiKeysResponse { - // A message containing ApiKey and associated corpora. - message KeyAndCorpora{ - // ApiKey data. - ApiKey api_key = 1; - // Message containing corpus name and id. - message CorpusInfo { - // Corpus id. - uint32 id = 1; - // Corpus name. - string name = 2; - } - // List of corpora associated with the ApiKey. - repeated CorpusInfo corpus = 2; - } - - // List of ApiKey and associated corpora. - repeated KeyAndCorpora key_data = 1; - // A key that is passed into a subsequent result in order to - // retrieve the next page of results. - bytes page_key = 2; - // Status of the ListApiKeysRequest. - Status status = 1000; -} - -message DeleteApiKeyRequest { - // List of ApiKey ids to delete. - repeated string key_id = 1; -} - -message DeleteApiKeyResponse { - // Status of the DeleteApiKeyRequest. - repeated Status status = 1000; -} - -message EnableApiKeyRequest { - message ApiKeyEnablement { - // ApiKey id to enable or disable. - string key_id = 1; - // Enable or disable using this variable - bool enable = 2; - } - // List of ApiKey ids to enable or disable. - repeated ApiKeyEnablement key_enablement = 1; -} - -message EnableApiKeyResponse { - // List of Status such as OK, FAILED corresponding to the EnableApiKeyRequest. - repeated Status status = 1000; -} - diff --git a/admin_job.proto b/admin_job.proto deleted file mode 100644 index ab96564..0000000 --- a/admin_job.proto +++ /dev/null @@ -1,85 +0,0 @@ -syntax = "proto3"; - -import "status.proto"; - -option go_package = "vectara.com/public/proto/admin"; - -option java_package = "com.vectara.admin"; -option java_outer_classname = "AdminJobProtos"; - -package com.vectara.admin; - -// Type of jobs. -enum JobType { - JOB__UNKNOWN = 0; - JOB__CORPUS_REBUILD_VECTOR_INDEX = 1; - JOB__CORPUS_REPLACE_FILTER_ATTRS = 2; -} - -// The state of a job. -enum JobState { - JOB_STATE__UNKNOWN = 0; - JOB_STATE__QUEUED = 5; - JOB_STATE__STARTED = 10; - JOB_STATE__COMPLETED = 15; - JOB_STATE__FAILED = 20; - JOB_STATE__TRANSIENT_FAILURE_RETRY_IMMINENT = 25; - JOB_STATE__ABORTED = 30; -} - -message ListJobsRequest { - // Optional filters. If specified, the filters are logically ANDed. - // - // [Optional] If specified, return the job for this id. - string job_id = 1; - // [Optional] If specified, return jobs for these corpora only. - repeated uint32 corpus_id = 2; - - // [Optional] Get jobs that were created since this epoch timestamp. - // Max allowed value is 180 days ago. Default is 180 days. - int64 epoch_secs = 3; - - // [Optional] Get jobs with these states. If not specified, all job - // states are fetched. - // Default: If not set, JOB_STATE__QUEUED and JOB_STATE__STARTED are returned. - repeated JobState state = 4; - - // Maximum results to return. Max allowed value is 100. - uint32 num_results = 25; - // A key that is passed in to retrieve a specific page of results. - // Leave empty to retrieve first page. Subsequent page request should - // use the page key returned in previous response, and all other - // fields are ignored. - bytes page_key = 30; -} - -// Represents a job in the system. -// A job is typically a long running unit of work for achieving a particular outcome. -// Example job: replace filter attributes of a corpus. -message Job { - string id = 1; - JobType type = 2; - // Set if the job belongs to a corpus. - repeated uint32 corpus_id = 3; - JobState state = 4; - - // Epoch (secs) when the job was created. - int64 ts_create = 10; - // Epoch (secs) when the job was started. Not set if the job - // hasn't started yet. - int64 ts_start = 15; - // Epoch (secs) when the job completed. Not set if the job - // hasn't completed yet. - int64 ts_complete = 16; - // Handle of the user that created this job. - string user_handle = 17; -} - -message ListJobsResponse { - repeated Status status = 1000; - repeated Job job = 10; - - // A key that is passed into a subsequent result in order to - // retrieve the next page of results. - bytes page_key = 500; -} diff --git a/admin_metric.proto b/admin_metric.proto deleted file mode 100644 index 3c0381e..0000000 --- a/admin_metric.proto +++ /dev/null @@ -1,84 +0,0 @@ -syntax = "proto3"; - -import "status.proto"; - -option go_package = "vectara.com/public/proto/admin"; - -option java_package = "com.vectara.admin"; -option java_outer_classname = "AdminMetricProtos"; - -package com.vectara.admin; - -/****************************************************************************** - Metrics (get request rate etc.) - ******************************************************************************/ - -// This window is used to specify a time range for metrics -message AbsoluteWindow { - int64 start_epoch_secs = 1; - int64 end_epoch_secs = 2; -} - -// The request type for usage metrics -message UsageMetricsRequest { - // The type of metric to get - enum MetricType { - METRICTYPE__NONE = 0; - METRICTYPE__INDEXING = 1; - METRICTYPE__SERVING = 2; - } - - // The corpus for which the metric is requested. - uint32 corpus_id = 1; - // The time period for which the metric is requested. - AbsoluteWindow window = 2; - // The type of metric to get. - MetricType type = 3; - // The response stats will be aggregated by this interval. Minimum aggregation interval is 1 minute. - // Supported granularity units for aggregation are days, hours and minutes. - // For example, If 2.5 days (in seconds) are passed, results will be aggregated by 2 days. - // Similarly, if 7.6 hours (in seconds) are passed, results will be aggregated by 7 hours. - int64 aggregation_interval_secs = 4; -} - -// Indexing data -message IndexingMetric { - // The number of documents indexed - uint64 doc_count = 1; - // The number of document parts indexed - uint64 doc_part_count = 2; - // The number of bytes indexed. - // In case of Upload API, this is the actual bytes extracted from the document and not - // the size of the document. - // In case of Index API, this is the combined size of text in all the sections of the document. - uint64 doc_part_bytes = 3; - // The start time for this metric - int64 start_epoch_secs = 4; -} - -// Serving/querying data -message ServingMetric { - // The number of rows read - uint64 rows_read = 1; - // The number of queries - uint64 query_count = 2; - // The start time for this metric - int64 start_epoch_secs = 3; -} - -message UsageMetricsResponse { - // The response for a single interval - message IntervalValue { - // Interval containing value for either Indexing or Serving - oneof value { - IndexingMetric indexing_value = 1; - ServingMetric serving_value = 2; - } - } - - // List of IntervalValue containing values for either Indexing or Serving. These are - // aggregated by the interval specified in the request. - repeated IntervalValue values = 1; - // The status response of the request - Status status = 2; -} diff --git a/admin_security.proto b/admin_security.proto deleted file mode 100644 index 95f7a58..0000000 --- a/admin_security.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; - -import "status.proto"; - -option go_package = "vectara.com/public/proto/admin"; - -option java_package = "com.vectara.admin"; -option java_outer_classname = "AdminSecurityProtos"; - -package com.vectara.admin; - - -enum CustomerRole { - CustomerRole_None = 0; - // The owner is the root user of the account. Only an owner can shut - // down the account completely. - CustomerRole_Owner = 1; - // An account administrator can do things like create corpora, add or remove users etc. - CustomerRole_Admin = 2; - // View and modify billing-related information for the account. - CustomerRole_Billing_Admin = 3; - // View and modify corpus-related information for the account. - CustomerRole_Corpus_Admin = 4; -} - diff --git a/admin_user.proto b/admin_user.proto deleted file mode 100644 index 2901aaf..0000000 --- a/admin_user.proto +++ /dev/null @@ -1,125 +0,0 @@ -syntax = "proto3"; - -import "admin_security.proto"; -import "status.proto"; - -option go_package = "vectara.com/public/proto/admin"; - -option java_package = "com.vectara.admin"; -option java_outer_classname = "AdminUserProtos"; - -package com.vectara.admin; - -// Represents a user in an account. -// A user is a person or an application that has access to the system. -message User { - // Unique ID for the user. This is required for deleting, enabling, disabling a user - // or to reset their password. This can be retrieved via ListUsers API or it is also - // returned as part of ManageUser API when a new user is created. - uint32 id = 1; - // Name of the user. This is required for creating a new user. - string handle = 3; - // Type of user - UserType type = 4; - // Comment about the user - string comment = 5; - // Seconds since epoch when the user was created. - int64 ts_create = 6; - // ID of the user who created this user. - uint32 id_create = 7; - // Email address associated with the user. This is required for creating a new user. - string email = 10; - // Status of the user such as ACTIVE, DISABLED etc. - UserStatus user_status = 11; - // List of customer level roles - repeated CustomerRole role = 12; -} - -enum UserType { - USER_TYPE__NONE = 0; - // A normal user - USER_TYPE__USER = 1; - // A user that is authenticated by an external identity provider such as Google etc. - USER_TYPE__FEDERATED_USER = 2; - // An application client. Please note that this doesn't work with ManageUser API. - // To create an App Client, use the ManageAppClient API. - USER_TYPE__APP_CLIENT = 3; -} - -enum UserStatus { - USER_STATUS__NONE = 0; - // User is active - USER_STATUS__ACTIVE = 1; - // User is disabled - USER_STATUS__DISABLED = 2; -} - -enum ListUsersType { - LIST_USERS_TYPE__NONE = 0; - // Only List users with customer account-level authorizations. - LIST_USERS_TYPE__CUSTOMER = 2; - // List All the users - LIST_USERS_TYPE__ALL = 3; -} - -message ListUsersRequest { - // Type of users that we want to retrieve - ListUsersType list_users_type = 3; - // A key that is passed to retrieve a specific page of results. - // Leave empty to retrieve first page. Subsequent page requests should - // use the page key returned in previous response, and all other - // fields are ignored. - bytes page_key = 4; - // Number of results to return. - uint32 num_results = 5; -} - -message ListUsersResponse { - // List of users - repeated User user = 1; - // A key that is passed into a subsequent result in order to - // retrieve the next page of results. - bytes page_key = 2; - // Status response of the request such as OK, FAILED etc. - Status status = 1000; -} - -enum UserActionType { - USER_ACTION_TYPE__NONE = 0; - // Add User - USER_ACTION_TYPE__ADD = 1; - // Delete User - USER_ACTION_TYPE__DELETE = 2; - // Disable User - USER_ACTION_TYPE__DISABLE = 3; - // Enable User - USER_ACTION_TYPE__ENABLE = 4; - // Reset User Password - USER_ACTION_TYPE__RESET_PASSWORD = 5; -} - -message ManageUserRequest { - // User and action to be performed on user - message UserAction { - // User object - User user = 1; - // Action to be performed on user - UserActionType user_action_type = 2; - } - // List of users and actions to be performed on them - repeated UserAction user_action = 1; -} - -message ManageUserResponse { - // List of users and their status - message UserResponse { - // User object - User user = 1; - // Status response of the request such as OK, FAILED etc. - Status status = 1000; - } - // List of users alongwith relative status such as OK, FAILED etc. - repeated UserResponse response = 1; -} - - diff --git a/attribute.proto b/attribute.proto deleted file mode 100644 index 1d08396..0000000 --- a/attribute.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -option java_package = "com.vectara"; -option java_outer_classname = "AttributeProtos"; - -option go_package = "vectara.com/public/proto/common"; - -package com.vectara; - -// A key/value pair representing a document attribute (metadata item). -message Attribute { - // Name of the document metadata attribute. - string name = 5; - // Value of the document metadata attribute. - string value = 10; -} diff --git a/chat.proto b/chat.proto deleted file mode 100644 index 75473cc..0000000 --- a/chat.proto +++ /dev/null @@ -1,106 +0,0 @@ -syntax = "proto3"; - -import "status.proto"; - -option java_package = "com.vectara.chat"; -option java_outer_classname = "ChatProtos"; - -option go_package = "vectara.com/public/proto/chat"; - -package com.vectara.chat; - -// A turn in a conversation is a single exchange of query and answer. -// A conversation is composed of several turns. -message Turn { - // The ID of the turn. The ID of the first turn in a conversation is the same as the - // ID of the conversation. This is unique within the chat history corpus. - string id = 1; - // The ID of the conversation this turn belongs to. This is the same as the ID of the - // first turn in the conversation. - string conversation_id = 5; - // The query text. - string query = 10; - // The answer text. - string answer = 15; - // Whether this turn is enabled. If a turn is disabled, it will not be used when - // generating answers for subsequent queries in the conversation. - bool enabled = 20; - // The time at which this turn was created. - int64 epoch_secs = 25; -} - -// A chat contains several back-and-forth messages called turns. -message Conversation { - // The ID of the conversation. This is unique within the chat history corpus. - string id = 1; - // The turns comprising this conversation. - repeated Turn turn = 5; -} - -message ListConversationsRequest { - - // Maximum number of conversations to return per page. - uint32 num_results = 5; - - // A key that is passed in to retrieve a specific page of results. - // Leave empty to retrieve the first page. Subsequent page request should - // use the page key returned in previous response, and all other - // fields are ignored. - bytes page_key = 10; -} - -message ListConversationsResponse { - // The first turn in each conversation. - // This doesn't comprise all turns in each conversation; only the first turn of each - // conversation is returned. - repeated Turn conversation = 1; - Status status = 5; - - // A key that is passed in to retrieve a specific page of results. - // Pass this as is in to the next request to retrieve the next page of results. - bytes page_key = 10; -} - -message ReadConversationsRequest { - // The IDs of the conversations to read. Limit: 10 conversations. - repeated string conversation_id = 5; -} - -message ReadConversationsResponse { - repeated Conversation Conversation = 1; - Status status = 5; -} - -message DeleteConversationsRequest { - // The IDs of the conversations to delete. Limit: 1000 conversations. - repeated string conversation_id = 5; -} - -message DeleteConversationsResponse { - Status status = 1; -} - -message DeleteTurnsRequest { - // The ID of the conversations from which to delete turns. - string conversation_id = 5; - // The ID of the turn to start deletion from. All turns in this conversation starting from this - // turn (inclusive) will be deleted. - string turn_id = 10; -} - -message DeleteTurnsResponse { - Status status = 1; -} - -message DisableTurnsRequest { - // The ID of the conversations from which to disable turns. - string conversation_id = 5; - // The ID of the turn to start disabling from. All turns in this conversation starting from this - // turn will be disabled. - string turn_id = 10; -} - -message DisableTurnsResponse { - Status status = 1; -} - diff --git a/common.proto b/common.proto deleted file mode 100644 index c021314..0000000 --- a/common.proto +++ /dev/null @@ -1,98 +0,0 @@ -syntax = "proto3"; - -option java_package = "com.vectara"; -option java_outer_classname = "CommonProtos"; - -option go_package = "vectara.com/public/proto/common"; - -package com.vectara; - -// Languages supported by Vectara. -message Language { - enum Code { - UNKNOWN = 0; - - // English. - ENG = 1; - // German. - DEU = 2; - // French. - FRA = 3; - // Chinese. - ZHO = 4; - // Korean. - KOR = 5; - // Arabic. - ARA = 6; - // Russian. - RUS = 7; - // Thai. - THA = 8; - // Dutch. - NLD = 9; - // Italian. - ITA = 10; - // Portuguese. - POR = 11; - // Spanish. - SPA = 12; - // Japanese. - JPN = 13; - // Polish. - POL = 14; - // Turkish. - TUR = 15; - // Vietnamese. - VIE = 16; - // Indonesian. - IND = 17; - // Czech. - CES = 18; - // Ukrainian. - UKR = 19; - // Greek. - ELL = 20; - // Hebrew. - HEB = 21; - // Farsi/Persian. - FAS = 22; - // Hindi. - HIN = 23; - // Urdu. - URD = 24; - // Swedish. - SWE = 25; - // Bengali. - BEN = 26; - // Malay. - MSA = 27; - // Romanian. - RON = 28; - - // Let the platform detect the language. - AUTO = 5000; - } -} - - // Request to delete a document from an index. -message DeleteDocumentRequest { - // The Customer ID to issue the request for. - int64 customer_id = 1; - // The Corpus ID that contains the document. - int64 corpus_id = 2; - // The Document ID to be deleted. - string document_id = 3; -} - -message DeleteDocumentResponse { -} - -// Encapsulates storage quota consumed by indexed documents. -// NextId: 3 -message StorageQuota { - // The number of chars from the document that consumed the storage quota. - int64 num_chars = 1; - // The number of chars in the metadata of the document that consumed the - // storage quota. - int64 num_metadata_chars = 2; -} diff --git a/core_services.proto b/core_services.proto deleted file mode 100644 index c2c8a5c..0000000 --- a/core_services.proto +++ /dev/null @@ -1,51 +0,0 @@ -// These are public services that we only share with some of our customers. - -syntax = "proto3"; - -import "common.proto"; -import "indexing_core.proto"; -import "status.proto"; -import "google/api/annotations.proto"; - -option java_package = "com.vectara"; -option java_outer_classname = "CoreServiceProtos"; - -option go_package = "vectara.com/public/proto/coreservices"; - -package com.vectara; - -// Request to index a document. -message IndexCoreDocumentRequest { - // The Customer ID to issue the request for. - int64 customer_id = 1; - // The Corpus ID to index the document into. - int64 corpus_id = 2; - com.vectara.indexing.CoreDocument document = 3; -} - -message IndexCoreDocumentResponse { - // If ALREADY_EXISTS, it means the document was already indexed, and no new quota was consumed. - Status status = 1; - - // The storage quota needed for the document indexed in the request. - // If "status" is ALREADY_EXISTS, it means that the document was already in the index prior to - // this request. In such cases, quota is not consumed again and the value in this field - // represents the quota consumed when the document was indexed the first time. - StorageQuota quota_consumed = 2; -} - -service CoreIndexService { - rpc Index(IndexCoreDocumentRequest) returns (IndexCoreDocumentResponse) { - option (google.api.http) = { - post: "/v1/core/index" - body: "*" - }; - } - - rpc Delete(DeleteDocumentRequest) returns (DeleteDocumentResponse) { - option (google.api.http) = { - post: "/v1/core/delete-doc" - body: "*" - }; - } -} diff --git a/custom_dim.proto b/custom_dim.proto deleted file mode 100644 index 63f7fc3..0000000 --- a/custom_dim.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -option java_package = "com.vectara.indexing"; -option java_outer_classname = "CustomDimProtos"; - -option go_package = "vectara.com/public/proto/customdim"; - -package com.vectara.indexing; - -// The value of a custom dimension. A valid list of custom dimensions is defined ahead of time for a corpus. -message CustomDimension { - // The name of the dimension. - string name = 1; - // The value of the dimension. - double value = 2; -} diff --git a/indexing.proto b/indexing.proto deleted file mode 100644 index 2081389..0000000 --- a/indexing.proto +++ /dev/null @@ -1,58 +0,0 @@ -syntax = "proto3"; - -import "custom_dim.proto"; - -option java_package = "com.vectara.indexing"; -option java_outer_classname = "IndexingProtos"; - -option go_package = "vectara.com/public/proto/indexing"; - -package com.vectara.indexing; - -// A section within a structured document. -message Section { - // Optionally, the unique ID of this section. If set, it will be returned as - // metadata in query results. - int32 id = 1; - // Optionally, the title of the section. This may be empty. - string title = 2; - // The text of the section. This should never be empty. - string text = 3; - // Metadata about this section. This should be a json string. It is passed - // through the system, without being used at indexing time. It can be - // retrieved at query time. - string metadata_json = 4; - // A list of custom dimension values that are included in the generated - // representation of all subsections (i.e. sections contains by this section). - repeated CustomDimension custom_dims = 5; - - // A list of subsections. - repeated Section section = 10; -} - -// A document to index. -message Document { - // Client assigned document ID to this document. - string document_id = 1; - // The title of the document. - string title = 2; - // An optional description for the document. - string description = 3; - // Metadata about the document. This is a string containing a JSON - // object. It can be an arbitrary object except that any keys - // that match a metadata filter of the corpus must have the - // same value type as metadata filter's value type. - // - // A query can use this object to filter if the object's key/value pair - // has been defined as a metadata filter. - // - // The whole object will be in the query result. - string metadata_json = 4; - // A list of custom dimension values that are included in the generated - // representation of all sections. - repeated CustomDimension custom_dims = 5; - - // The actual content of the document, structured as a repeating list - // of sections. - repeated Section section = 10; -} diff --git a/indexing_core.proto b/indexing_core.proto deleted file mode 100644 index 479e5db..0000000 --- a/indexing_core.proto +++ /dev/null @@ -1,45 +0,0 @@ -syntax = "proto3"; - -import "custom_dim.proto"; - -option java_package = "com.vectara.indexing"; -option java_outer_classname = "CoreIndexingProtos"; - -option go_package = "vectara.com/public/proto/indexingcore"; - -package com.vectara.indexing; - -// Part of a document. A document consists of several such parts. -message CoreDocumentPart { - // A part of the document. e.g., a sentence. - string text = 1; - // Context of the part. - string context = 2; - // Metadata about this part of the document. This should be a json string. - // It is passed through the system, without being used at indexing time. It - // can be retrieved at query time. - string metadata_json = 3; - // A list of custom dimension values that are included in the generated - // representation of this part. These are optional and take on the corpus - // default custom dimension value if not explicitly provided for the document - repeated CustomDimension custom_dims = 4; -} - -// A document to index. -message CoreDocument { - // A document ID to assign to this document. - string document_id = 1; - // Metadata about the document. This should be a json string. It can be - // retrieved at query time. - string metadata_json = 2; - // All parts of this document. - repeated CoreDocumentPart parts = 3; - // This field provides a way to specify a blanket context for all parts. If - // the context in a part is empty, this context will be used. - string default_part_context = 4; - // A list of custom dimension values that are included in the generated - // representation of all parts. - repeated CustomDimension custom_dims = 5; -} - - diff --git a/list_documents.proto b/list_documents.proto deleted file mode 100644 index 0040bf1..0000000 --- a/list_documents.proto +++ /dev/null @@ -1,49 +0,0 @@ -syntax = "proto3"; - -import "attribute.proto"; - -option java_package = "com.vectara.lists"; -option java_outer_classname = "ListProtos"; - -option go_package = "vectara.com/public/proto/lists"; - -package com.vectara.lists; - -// Request to list documents in a corpus. -message ListDocumentsRequest { - // The Corpus ID. - uint32 corpus_id = 5; - - // Maximum number of results to be returned by the server. - // Max is 1000. - // If the value is larger than 1000, it will be capped to 1000. - uint32 num_results = 10; - // Key of the specific page of the list results to return. - // Null/empty value means the very first page of the results is requested. - bytes page_key = 15; - - // Filter on document metadata. If empty, no filtering is done. - // Otherwise, only documents that match all of the specified metadata - // will be returned. The syntax is the same as for QueryRequest.metadata. - string metadata_filter = 20; -} - -// Response of listing documents in a corpus. -message ListDocumentsResponse { - // Document information format of each document in the list. - message DocumentInfo { - // The document ID that was used when indexing the document. - string id = 1; - // Document metadata. - repeated Attribute metadata = 5; - } - - // The list of documents. - repeated DocumentInfo document = 1; - // Represents the pagination key to retrieve the next page of results. - // If the value is "", it means no further results for the request. - // To retrieve the next page of results, client shall pass the value of next_page_key in the subsequent - // ListDocumentsRequest method call (in the request message's page_key field). - bytes next_page_key = 5; -} - diff --git a/protoc-gen-openapiv2/options/annotations.proto b/protoc-gen-openapiv2/options/annotations.proto deleted file mode 100644 index d63d3c8..0000000 --- a/protoc-gen-openapiv2/options/annotations.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; - -package grpc.gateway.protoc_gen_openapiv2.options; - -import "google/protobuf/descriptor.proto"; -import "protoc-gen-openapiv2/options/openapiv2.proto"; - -option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"; - -extend google.protobuf.FileOptions { - // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - Swagger openapiv2_swagger = 1042; -} -extend google.protobuf.MethodOptions { - // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - Operation openapiv2_operation = 1042; -} -extend google.protobuf.MessageOptions { - // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - Schema openapiv2_schema = 1042; -} -extend google.protobuf.ServiceOptions { - // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - Tag openapiv2_tag = 1042; -} -extend google.protobuf.FieldOptions { - // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - JSONSchema openapiv2_field = 1042; -} diff --git a/protoc-gen-openapiv2/options/openapiv2.proto b/protoc-gen-openapiv2/options/openapiv2.proto deleted file mode 100644 index 34ddb52..0000000 --- a/protoc-gen-openapiv2/options/openapiv2.proto +++ /dev/null @@ -1,720 +0,0 @@ -syntax = "proto3"; - -package grpc.gateway.protoc_gen_openapiv2.options; - -import "google/protobuf/struct.proto"; - -option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"; - -// Scheme describes the schemes supported by the OpenAPI Swagger -// and Operation objects. -enum Scheme { - UNKNOWN = 0; - HTTP = 1; - HTTPS = 2; - WS = 3; - WSS = 4; -} - -// `Swagger` is a representation of OpenAPI v2 specification's Swagger object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject -// -// Example: -// -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { -// info: { -// title: "Echo API"; -// version: "1.0"; -// description: ""; -// contact: { -// name: "gRPC-Gateway project"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway"; -// email: "none@example.com"; -// }; -// license: { -// name: "BSD 3-Clause License"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE.txt"; -// }; -// }; -// schemes: HTTPS; -// consumes: "application/json"; -// produces: "application/json"; -// }; -// -message Swagger { - // Specifies the OpenAPI Specification version being used. It can be - // used by the OpenAPI UI and other clients to interpret the API listing. The - // value MUST be "2.0". - string swagger = 1; - // Provides metadata about the API. The metadata can be used by the - // clients if needed. - Info info = 2; - // The host (name or ip) serving the API. This MUST be the host only and does - // not include the scheme nor sub-paths. It MAY include a port. If the host is - // not included, the host serving the documentation is to be used (including - // the port). The host does not support path templating. - string host = 3; - // The base path on which the API is served, which is relative to the host. If - // it is not included, the API is served directly under the host. The value - // MUST start with a leading slash (/). The basePath does not support path - // templating. - // Note that using `base_path` does not change the endpoint paths that are - // generated in the resulting OpenAPI file. If you wish to use `base_path` - // with relatively generated OpenAPI paths, the `base_path` prefix must be - // manually removed from your `google.api.http` paths and your code changed to - // serve the API from the `base_path`. - string base_path = 4; - // The transfer protocol of the API. Values MUST be from the list: "http", - // "https", "ws", "wss". If the schemes is not included, the default scheme to - // be used is the one used to access the OpenAPI definition itself. - repeated Scheme schemes = 5; - // A list of MIME types the APIs can consume. This is global to all APIs but - // can be overridden on specific API calls. Value MUST be as described under - // Mime Types. - repeated string consumes = 6; - // A list of MIME types the APIs can produce. This is global to all APIs but - // can be overridden on specific API calls. Value MUST be as described under - // Mime Types. - repeated string produces = 7; - // field 8 is reserved for 'paths'. - reserved 8; - // field 9 is reserved for 'definitions', which at this time are already - // exposed as and customizable as proto messages. - reserved 9; - // An object to hold responses that can be used across operations. This - // property does not define global responses for all operations. - map responses = 10; - // Security scheme definitions that can be used across the specification. - SecurityDefinitions security_definitions = 11; - // A declaration of which security schemes are applied for the API as a whole. - // The list of values describes alternative security schemes that can be used - // (that is, there is a logical OR between the security requirements). - // Individual operations can override this definition. - repeated SecurityRequirement security = 12; - // A list of tags for API documentation control. Tags can be used for logical - // grouping of operations by resources or any other qualifier. - repeated Tag tags = 13; - // Additional external documentation. - ExternalDocumentation external_docs = 14; - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 15; -} - -// `Operation` is a representation of OpenAPI v2 specification's Operation object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject -// -// Example: -// -// service EchoService { -// rpc Echo(SimpleMessage) returns (SimpleMessage) { -// option (google.api.http) = { -// get: "/v1/example/echo/{id}" -// }; -// -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { -// summary: "Get a message."; -// operation_id: "getMessage"; -// tags: "echo"; -// responses: { -// key: "200" -// value: { -// description: "OK"; -// } -// } -// }; -// } -// } -message Operation { - // A list of tags for API documentation control. Tags can be used for logical - // grouping of operations by resources or any other qualifier. - repeated string tags = 1; - // A short summary of what the operation does. For maximum readability in the - // swagger-ui, this field SHOULD be less than 120 characters. - string summary = 2; - // A verbose explanation of the operation behavior. GFM syntax can be used for - // rich text representation. - string description = 3; - // Additional external documentation for this operation. - ExternalDocumentation external_docs = 4; - // Unique string used to identify the operation. The id MUST be unique among - // all operations described in the API. Tools and libraries MAY use the - // operationId to uniquely identify an operation, therefore, it is recommended - // to follow common programming naming conventions. - string operation_id = 5; - // A list of MIME types the operation can consume. This overrides the consumes - // definition at the OpenAPI Object. An empty value MAY be used to clear the - // global definition. Value MUST be as described under Mime Types. - repeated string consumes = 6; - // A list of MIME types the operation can produce. This overrides the produces - // definition at the OpenAPI Object. An empty value MAY be used to clear the - // global definition. Value MUST be as described under Mime Types. - repeated string produces = 7; - // field 8 is reserved for 'parameters'. - reserved 8; - // The list of possible responses as they are returned from executing this - // operation. - map responses = 9; - // The transfer protocol for the operation. Values MUST be from the list: - // "http", "https", "ws", "wss". The value overrides the OpenAPI Object - // schemes definition. - repeated Scheme schemes = 10; - // Declares this operation to be deprecated. Usage of the declared operation - // should be refrained. Default value is false. - bool deprecated = 11; - // A declaration of which security schemes are applied for this operation. The - // list of values describes alternative security schemes that can be used - // (that is, there is a logical OR between the security requirements). This - // definition overrides any declared top-level security. To remove a top-level - // security declaration, an empty array can be used. - repeated SecurityRequirement security = 12; - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 13; - // Custom parameters such as HTTP request headers. - // See: https://swagger.io/docs/specification/2-0/describing-parameters/ - // and https://swagger.io/specification/v2/#parameter-object. - Parameters parameters = 14; -} - -// `Parameters` is a representation of OpenAPI v2 specification's parameters object. -// Note: This technically breaks compatibility with the OpenAPI 2 definition structure as we only -// allow header parameters to be set here since we do not want users specifying custom non-header -// parameters beyond those inferred from the Protobuf schema. -// See: https://swagger.io/specification/v2/#parameter-object -message Parameters { - // `Headers` is one or more HTTP header parameter. - // See: https://swagger.io/docs/specification/2-0/describing-parameters/#header-parameters - repeated HeaderParameter headers = 1; -} - -// `HeaderParameter` a HTTP header parameter. -// See: https://swagger.io/specification/v2/#parameter-object -message HeaderParameter { - // `Type` is a a supported HTTP header type. - // See https://swagger.io/specification/v2/#parameterType. - enum Type { - UNKNOWN = 0; - STRING = 1; - NUMBER = 2; - INTEGER = 3; - BOOLEAN = 4; - } - - // `Name` is the header name. - string name = 1; - // `Description` is a short description of the header. - string description = 2; - // `Type` is the type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. - // See: https://swagger.io/specification/v2/#parameterType. - Type type = 3; - // `Format` The extending format for the previously mentioned type. - string format = 4; - // `Required` indicates if the header is optional - bool required = 5; - // field 6 is reserved for 'items', but in OpenAPI-specific way. - reserved 6; - // field 7 is reserved `Collection Format`. Determines the format of the array if type array is used. - reserved 7; -} - -// `Header` is a representation of OpenAPI v2 specification's Header object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject -// -message Header { - // `Description` is a short description of the header. - string description = 1; - // The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. - string type = 2; - // `Format` The extending format for the previously mentioned type. - string format = 3; - // field 4 is reserved for 'items', but in OpenAPI-specific way. - reserved 4; - // field 5 is reserved `Collection Format` Determines the format of the array if type array is used. - reserved 5; - // `Default` Declares the value of the header that the server will use if none is provided. - // See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. - // Unlike JSON Schema this value MUST conform to the defined type for the header. - string default = 6; - // field 7 is reserved for 'maximum'. - reserved 7; - // field 8 is reserved for 'exclusiveMaximum'. - reserved 8; - // field 9 is reserved for 'minimum'. - reserved 9; - // field 10 is reserved for 'exclusiveMinimum'. - reserved 10; - // field 11 is reserved for 'maxLength'. - reserved 11; - // field 12 is reserved for 'minLength'. - reserved 12; - // 'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3. - string pattern = 13; - // field 14 is reserved for 'maxItems'. - reserved 14; - // field 15 is reserved for 'minItems'. - reserved 15; - // field 16 is reserved for 'uniqueItems'. - reserved 16; - // field 17 is reserved for 'enum'. - reserved 17; - // field 18 is reserved for 'multipleOf'. - reserved 18; -} - -// `Response` is a representation of OpenAPI v2 specification's Response object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject -// -message Response { - // `Description` is a short description of the response. - // GFM syntax can be used for rich text representation. - string description = 1; - // `Schema` optionally defines the structure of the response. - // If `Schema` is not provided, it means there is no content to the response. - Schema schema = 2; - // `Headers` A list of headers that are sent with the response. - // `Header` name is expected to be a string in the canonical format of the MIME header key - // See: https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey - map headers = 3; - // `Examples` gives per-mimetype response examples. - // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object - map examples = 4; - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 5; -} - -// `Info` is a representation of OpenAPI v2 specification's Info object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject -// -// Example: -// -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { -// info: { -// title: "Echo API"; -// version: "1.0"; -// description: ""; -// contact: { -// name: "gRPC-Gateway project"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway"; -// email: "none@example.com"; -// }; -// license: { -// name: "BSD 3-Clause License"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE.txt"; -// }; -// }; -// ... -// }; -// -message Info { - // The title of the application. - string title = 1; - // A short description of the application. GFM syntax can be used for rich - // text representation. - string description = 2; - // The Terms of Service for the API. - string terms_of_service = 3; - // The contact information for the exposed API. - Contact contact = 4; - // The license information for the exposed API. - License license = 5; - // Provides the version of the application API (not to be confused - // with the specification version). - string version = 6; - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 7; -} - -// `Contact` is a representation of OpenAPI v2 specification's Contact object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject -// -// Example: -// -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { -// info: { -// ... -// contact: { -// name: "gRPC-Gateway project"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway"; -// email: "none@example.com"; -// }; -// ... -// }; -// ... -// }; -// -message Contact { - // The identifying name of the contact person/organization. - string name = 1; - // The URL pointing to the contact information. MUST be in the format of a - // URL. - string url = 2; - // The email address of the contact person/organization. MUST be in the format - // of an email address. - string email = 3; -} - -// `License` is a representation of OpenAPI v2 specification's License object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject -// -// Example: -// -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { -// info: { -// ... -// license: { -// name: "BSD 3-Clause License"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE.txt"; -// }; -// ... -// }; -// ... -// }; -// -message License { - // The license name used for the API. - string name = 1; - // A URL to the license used for the API. MUST be in the format of a URL. - string url = 2; -} - -// `ExternalDocumentation` is a representation of OpenAPI v2 specification's -// ExternalDocumentation object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject -// -// Example: -// -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { -// ... -// external_docs: { -// description: "More about gRPC-Gateway"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway"; -// } -// ... -// }; -// -message ExternalDocumentation { - // A short description of the target documentation. GFM syntax can be used for - // rich text representation. - string description = 1; - // The URL for the target documentation. Value MUST be in the format - // of a URL. - string url = 2; -} - -// `Schema` is a representation of OpenAPI v2 specification's Schema object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject -// -message Schema { - JSONSchema json_schema = 1; - // Adds support for polymorphism. The discriminator is the schema property - // name that is used to differentiate between other schema that inherit this - // schema. The property name used MUST be defined at this schema and it MUST - // be in the required property list. When used, the value MUST be the name of - // this schema or any schema that inherits it. - string discriminator = 2; - // Relevant only for Schema "properties" definitions. Declares the property as - // "read only". This means that it MAY be sent as part of a response but MUST - // NOT be sent as part of the request. Properties marked as readOnly being - // true SHOULD NOT be in the required list of the defined schema. Default - // value is false. - bool read_only = 3; - // field 4 is reserved for 'xml'. - reserved 4; - // Additional external documentation for this schema. - ExternalDocumentation external_docs = 5; - // A free-form property to include an example of an instance for this schema in JSON. - // This is copied verbatim to the output. - string example = 6; -} - -// `JSONSchema` represents properties from JSON Schema taken, and as used, in -// the OpenAPI v2 spec. -// -// This includes changes made by OpenAPI v2. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject -// -// See also: https://cswr.github.io/JsonSchema/spec/basic_types/, -// https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json -// -// Example: -// -// message SimpleMessage { -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { -// json_schema: { -// title: "SimpleMessage" -// description: "A simple message." -// required: ["id"] -// } -// }; -// -// // Id represents the message identifier. -// string id = 1; [ -// (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { -// description: "The unique identifier of the simple message." -// }]; -// } -// -message JSONSchema { - // field 1 is reserved for '$id', omitted from OpenAPI v2. - reserved 1; - // field 2 is reserved for '$schema', omitted from OpenAPI v2. - reserved 2; - // Ref is used to define an external reference to include in the message. - // This could be a fully qualified proto message reference, and that type must - // be imported into the protofile. If no message is identified, the Ref will - // be used verbatim in the output. - // For example: - // `ref: ".google.protobuf.Timestamp"`. - string ref = 3; - // field 4 is reserved for '$comment', omitted from OpenAPI v2. - reserved 4; - // The title of the schema. - string title = 5; - // A short description of the schema. - string description = 6; - string default = 7; - bool read_only = 8; - // A free-form property to include a JSON example of this field. This is copied - // verbatim to the output swagger.json. Quotes must be escaped. - // This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject - string example = 9; - double multiple_of = 10; - // Maximum represents an inclusive upper limit for a numeric instance. The - // value of MUST be a number, - double maximum = 11; - bool exclusive_maximum = 12; - // minimum represents an inclusive lower limit for a numeric instance. The - // value of MUST be a number, - double minimum = 13; - bool exclusive_minimum = 14; - uint64 max_length = 15; - uint64 min_length = 16; - string pattern = 17; - // field 18 is reserved for 'additionalItems', omitted from OpenAPI v2. - reserved 18; - // field 19 is reserved for 'items', but in OpenAPI-specific way. - // TODO(ivucica): add 'items'? - reserved 19; - uint64 max_items = 20; - uint64 min_items = 21; - bool unique_items = 22; - // field 23 is reserved for 'contains', omitted from OpenAPI v2. - reserved 23; - uint64 max_properties = 24; - uint64 min_properties = 25; - repeated string required = 26; - // field 27 is reserved for 'additionalProperties', but in OpenAPI-specific - // way. TODO(ivucica): add 'additionalProperties'? - reserved 27; - // field 28 is reserved for 'definitions', omitted from OpenAPI v2. - reserved 28; - // field 29 is reserved for 'properties', but in OpenAPI-specific way. - // TODO(ivucica): add 'additionalProperties'? - reserved 29; - // following fields are reserved, as the properties have been omitted from - // OpenAPI v2: - // patternProperties, dependencies, propertyNames, const - reserved 30 to 33; - // Items in 'array' must be unique. - repeated string array = 34; - - enum JSONSchemaSimpleTypes { - UNKNOWN = 0; - ARRAY = 1; - BOOLEAN = 2; - INTEGER = 3; - NULL = 4; - NUMBER = 5; - OBJECT = 6; - STRING = 7; - } - - repeated JSONSchemaSimpleTypes type = 35; - // `Format` - string format = 36; - // following fields are reserved, as the properties have been omitted from - // OpenAPI v2: contentMediaType, contentEncoding, if, then, else - reserved 37 to 41; - // field 42 is reserved for 'allOf', but in OpenAPI-specific way. - // TODO(ivucica): add 'allOf'? - reserved 42; - // following fields are reserved, as the properties have been omitted from - // OpenAPI v2: - // anyOf, oneOf, not - reserved 43 to 45; - // Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 - repeated string enum = 46; - - // Additional field level properties used when generating the OpenAPI v2 file. - FieldConfiguration field_configuration = 1001; - - // 'FieldConfiguration' provides additional field level properties used when generating the OpenAPI v2 file. - // These properties are not defined by OpenAPIv2, but they are used to control the generation. - message FieldConfiguration { - // Alternative parameter name when used as path parameter. If set, this will - // be used as the complete parameter name when this field is used as a path - // parameter. Use this to avoid having auto generated path parameter names - // for overlapping paths. - string path_param_name = 47; - } - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 48; -} - -// `Tag` is a representation of OpenAPI v2 specification's Tag object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject -// -message Tag { - // The name of the tag. Use it to allow override of the name of a - // global Tag object, then use that name to reference the tag throughout the - // OpenAPI file. - string name = 1; - // A short description for the tag. GFM syntax can be used for rich text - // representation. - string description = 2; - // Additional external documentation for this tag. - ExternalDocumentation external_docs = 3; - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 4; -} - -// `SecurityDefinitions` is a representation of OpenAPI v2 specification's -// Security Definitions object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject -// -// A declaration of the security schemes available to be used in the -// specification. This does not enforce the security schemes on the operations -// and only serves to provide the relevant details for each scheme. -message SecurityDefinitions { - // A single security scheme definition, mapping a "name" to the scheme it - // defines. - map security = 1; -} - -// `SecurityScheme` is a representation of OpenAPI v2 specification's -// Security Scheme object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject -// -// Allows the definition of a security scheme that can be used by the -// operations. Supported schemes are basic authentication, an API key (either as -// a header or as a query parameter) and OAuth2's common flows (implicit, -// password, application and access code). -message SecurityScheme { - // The type of the security scheme. Valid values are "basic", - // "apiKey" or "oauth2". - enum Type { - TYPE_INVALID = 0; - TYPE_BASIC = 1; - TYPE_API_KEY = 2; - TYPE_OAUTH2 = 3; - } - - // The location of the API key. Valid values are "query" or "header". - enum In { - IN_INVALID = 0; - IN_QUERY = 1; - IN_HEADER = 2; - } - - // The flow used by the OAuth2 security scheme. Valid values are - // "implicit", "password", "application" or "accessCode". - enum Flow { - FLOW_INVALID = 0; - FLOW_IMPLICIT = 1; - FLOW_PASSWORD = 2; - FLOW_APPLICATION = 3; - FLOW_ACCESS_CODE = 4; - } - - // The type of the security scheme. Valid values are "basic", - // "apiKey" or "oauth2". - Type type = 1; - // A short description for security scheme. - string description = 2; - // The name of the header or query parameter to be used. - // Valid for apiKey. - string name = 3; - // The location of the API key. Valid values are "query" or - // "header". - // Valid for apiKey. - In in = 4; - // The flow used by the OAuth2 security scheme. Valid values are - // "implicit", "password", "application" or "accessCode". - // Valid for oauth2. - Flow flow = 5; - // The authorization URL to be used for this flow. This SHOULD be in - // the form of a URL. - // Valid for oauth2/implicit and oauth2/accessCode. - string authorization_url = 6; - // The token URL to be used for this flow. This SHOULD be in the - // form of a URL. - // Valid for oauth2/password, oauth2/application and oauth2/accessCode. - string token_url = 7; - // The available scopes for the OAuth2 security scheme. - // Valid for oauth2. - Scopes scopes = 8; - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 9; -} - -// `SecurityRequirement` is a representation of OpenAPI v2 specification's -// Security Requirement object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject -// -// Lists the required security schemes to execute this operation. The object can -// have multiple security schemes declared in it which are all required (that -// is, there is a logical AND between the schemes). -// -// The name used for each property MUST correspond to a security scheme -// declared in the Security Definitions. -message SecurityRequirement { - // If the security scheme is of type "oauth2", then the value is a list of - // scope names required for the execution. For other security scheme types, - // the array MUST be empty. - message SecurityRequirementValue { - repeated string scope = 1; - } - // Each name must correspond to a security scheme which is declared in - // the Security Definitions. If the security scheme is of type "oauth2", - // then the value is a list of scope names required for the execution. - // For other security scheme types, the array MUST be empty. - map security_requirement = 1; -} - -// `Scopes` is a representation of OpenAPI v2 specification's Scopes object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject -// -// Lists the available scopes for an OAuth2 security scheme. -message Scopes { - // Maps between a name of a scope to a short description of it (as the value - // of the property). - map scope = 1; -} diff --git a/services.proto b/services.proto deleted file mode 100644 index 22eba7d..0000000 --- a/services.proto +++ /dev/null @@ -1,268 +0,0 @@ -syntax = "proto3"; - -import "admin_account.proto"; -import "admin_apikey.proto"; -import "admin.proto"; -import "admin_job.proto"; -import "admin_metric.proto"; -import "admin_security.proto"; -import "admin_user.proto"; - -import "chat.proto"; -import "common.proto"; -import "indexing.proto"; -import "serving.proto"; -import "status.proto"; -import "list_documents.proto"; -import "google/api/annotations.proto"; - -option java_package = "com.vectara"; -option java_outer_classname = "ServiceProtos"; - -option go_package = "vectara.com/public/proto/services"; - -package com.vectara; - -// Request to index a document. -message IndexDocumentRequest { - // The Customer ID to issue the request for. - int64 customer_id = 1; - // The Corpus ID to index the document into. - int64 corpus_id = 2; - // The Document to index. - com.vectara.indexing.Document document = 3; -} - -message IndexDocumentResponse { - // If ALREADY_EXISTS, it means the document was already indexed, and no new quota was consumed. - Status status = 1; - - // The storage quota needed for the document indexed in the request. - // If "status" is ALREADY_EXISTS, it means that the document was already in the index prior to - // this request. In such cases, quota is not consumed again and the value in this field - // represents the quota consumed when the document was indexed the first time. - StorageQuota quota_consumed = 2; -} - -service IndexService { - rpc Index(IndexDocumentRequest) returns (IndexDocumentResponse) { - option (google.api.http) = { - post: "/v1/index" - body: "*" - }; - } - - rpc Delete(DeleteDocumentRequest) returns (DeleteDocumentResponse) { - option (google.api.http) = { - post: "/v1/delete-doc" - body: "*" - }; - } -} - -service QueryService { - // A standard single-request, single-response endpoint designed for high performance. - rpc Query(com.vectara.serving.BatchQueryRequest) - returns (com.vectara.serving.BatchQueryResponse) { - option (google.api.http) = { - post: "/v1/query" - body: "*" - }; - } - - // A streamed response interface when lower latency is absolutely critical. - rpc StreamQuery(com.vectara.serving.BatchQueryRequest) - returns (stream com.vectara.serving.QueryResponsePart) { - } -} - - -service AdminService { - rpc CreateCorpus(com.vectara.admin.CreateCorpusRequest) returns (com.vectara.admin.CreateCorpusResponse){ - option (google.api.http) = { - post: "/v1/create-corpus" - body: "*" - }; - } - - rpc DeleteCorpus(com.vectara.admin.DeleteCorpusRequest) returns (com.vectara.admin.DeleteCorpusResponse){ - option (google.api.http) = { - post: "/v1/delete-corpus" - body: "*" - }; - } - - rpc ResetCorpus(com.vectara.admin.ResetCorpusRequest) returns (com.vectara.admin.ResetCorpusResponse){ - option (google.api.http) = { - post: "/v1/reset-corpus" - body: "*" - }; - } - - rpc ListCorpora(com.vectara.admin.ListCorporaRequest) - returns (com.vectara.admin.ListCorporaResponse) { - option (google.api.http) = { - post: "/v1/list-corpora" - body: "*" - }; - } - - rpc ListJobs(com.vectara.admin.ListJobsRequest) returns (com.vectara.admin.ListJobsResponse) { - option (google.api.http) = { - post: "/v1/list-jobs" - body: "*" - }; - } - - // Return information about corpora. - rpc ReadCorpus(com.vectara.admin.ReadCorpusRequest) - returns (com.vectara.admin.ReadCorpusResponse) { - option (google.api.http) = { - post: "/v1/read-corpus" - body: "*" - }; - } - - rpc ComputeCorpusSize(com.vectara.admin.ComputeCorpusSizeRequest) - returns (com.vectara.admin.ComputeCorpusSizeResponse) { - option (google.api.http) = { - post: "/v1/compute-corpus-size" - body: "*" - }; - } - - rpc ComputeAccountSize(com.vectara.admin.ComputeAccountSizeRequest) - returns (com.vectara.admin.ComputeAccountSizeResponse) { - option (google.api.http) = { - post: "/v1/compute-account-size" - body: "*" - }; - } - - rpc ListUsers(com.vectara.admin.ListUsersRequest) - returns (com.vectara.admin.ListUsersResponse) { - option (google.api.http) = { - post: "/v1/list-users" - body: "*" - }; - } - - rpc ManageUser(com.vectara.admin.ManageUserRequest) - returns (com.vectara.admin.ManageUserResponse) { - option (google.api.http) = { - post: "/v1/manage-user" - body: "*" - }; - } - - rpc UpdateCorpusEnablement(com.vectara.admin.UpdateCorpusEnablementRequest) returns (com.vectara.admin.UpdateCorpusEnablementResponse) { - option (google.api.http) = { - post: "/v1/update-corpus-enablement" - body: "*" - }; - } - - rpc ReplaceCorpusFilterAttrs(com.vectara.admin.ReplaceCorpusFilterAttrsRequest) returns (com.vectara.admin.ReplaceCorpusFilterAttrsResponse) { - option (google.api.http) = { - post: "/v1/replace-corpus-filter-attrs" - body: "*" - }; - } - - // Get metric usage of either sliding windows or between two timestamps - rpc GetUsageMetrics(com.vectara.admin.UsageMetricsRequest) returns (com.vectara.admin.UsageMetricsResponse){ - option (google.api.http) = { - post: "/v1/get-usage-metrics" - body: "*" - }; - } - - rpc CreateApiKey(com.vectara.admin.CreateApiKeyRequest) returns (com.vectara.admin.CreateApiKeyResponse) { - option (google.api.http) = { - post: "/v1/create-api-key" - body: "*" - }; - } - - rpc EnableApiKey(com.vectara.admin.EnableApiKeyRequest) returns (com.vectara.admin.EnableApiKeyResponse) { - option (google.api.http) = { - post: "/v1/enable-api-key" - body: "*" - }; - } - - rpc DeleteApiKey(com.vectara.admin.DeleteApiKeyRequest) returns (com.vectara.admin.DeleteApiKeyResponse) { - option (google.api.http) = { - post: "/v1/delete-api-key" - body: "*" - }; - } - - rpc ListApiKeys(com.vectara.admin.ListApiKeysRequest) returns (com.vectara.admin.ListApiKeysResponse) { - option (google.api.http) = { - post: "/v1/list-api-keys" - body: "*" - }; - } - -} - -// Service for working with documents. -service DocumentService { - // Returns a list of documents for customer/corpus with pagination and optional document metadata filtering. - rpc ListDocuments(com.vectara.lists.ListDocumentsRequest) returns (com.vectara.lists.ListDocumentsResponse) { - option (google.api.http) = { - post: "/v1/list-documents" - body: "*" - }; - } -} - -// Service for working with chat conversations. -service ChatService { - - // List all conversations. - rpc ListConversations(com.vectara.chat.ListConversationsRequest) - returns (com.vectara.chat.ListConversationsResponse) { - option (google.api.http) = { - post: "/v1/list-conversations" - body: "*" - }; - } - - // Read all turns within the passed conversations. - rpc ReadConversations(com.vectara.chat.ReadConversationsRequest) - returns (com.vectara.chat.ReadConversationsResponse) { - option (google.api.http) = { - post: "/v1/read-conversations" - body: "*" - }; - } - - // Delete conversations (including all turns in it). - rpc DeleteConversations(com.vectara.chat.DeleteConversationsRequest) - returns (com.vectara.chat.DeleteConversationsResponse) { - option (google.api.http) = { - post: "/v1/delete-conversations" - body: "*" - }; - } - - // Delete turns. - rpc DeleteTurns(com.vectara.chat.DeleteTurnsRequest) - returns (com.vectara.chat.DeleteTurnsResponse) { - option (google.api.http) = { - post: "/v1/delete-turns" - body: "*" - }; - } - - // Disable turn. The turn will no longer be used in conversations. - rpc DisableTurns(com.vectara.chat.DisableTurnsRequest) - returns (com.vectara.chat.DisableTurnsResponse) { - option (google.api.http) = { - post: "/v1/disable-turns" - body: "*" - }; - } -} diff --git a/serving.proto b/serving.proto deleted file mode 100644 index a389b3b..0000000 --- a/serving.proto +++ /dev/null @@ -1,338 +0,0 @@ -syntax = "proto3"; - -import "protoc-gen-openapiv2/options/annotations.proto"; - -import "status.proto"; - -option java_package = "com.vectara.serving"; -option java_outer_classname = "ServingProtos"; - -option go_package = "vectara.com/public/proto/serving"; - -package com.vectara.serving; - -// Defined the weight of a custom dimension at query time. -message CustomDimension { - string name = 1; - double weight = 2; -} - -// Configuration for a linear interpolation. -message LinearInterpolation { - // Controls the weight given to lexical matches. The final score, S, is then: - // S = (lambda) * (lexical score) + (1 - lambda) * (dense score) - float lambda = 1; -} - -message CorpusKey { - // The Customer ID. - uint32 customer_id = 5; - // The Corpus ID. - uint32 corpus_id = 10; - - // Semantics controls the interpretation of the query string by the - // server, and can be used to override the default semantics assigned - // in the corpus definition. - enum Semantics { - // Use corpus-assigned semantics. This is the most common setting. - DEFAULT = 0; - // Use query semantics. This is also common. - QUERY = 1; - // Use response semantics. Usage of this is rare. - RESPONSE = 2; - } - Semantics semantics = 15; - - // Weights on custom dimensions for the corpus. - repeated CustomDimension dim = 20; - - string metadata_filter = 25; - - LinearInterpolation lexical_interpolation_config = 30; -} - - -message SummarizationRequest { - // The name of the summarizer+prompt combination to use for summarization. - string summarizer_prompt_name = 3; - // Maximum number of results to summarize. - uint32 max_summarized_results = 15; - // ISO 639-1 or ISO 639-3 language code for the response, or "auto" to indicate that - // the auto-detected language of the incoming query should be used. - string response_lang = 20; - - - // Vectara manages both system and user roles and prompts for the generative - // LLM out of the box by default. However, Scale customers can override the - // prompt_text via this variable. The prompt_text is in the form of an - // Apache Velocity template. For more details on how to configure the - // prompt_text, see the long-form documentation at - // https://docs.vectara.com/docs/prompts/vectara-prompt-engine - // See https://vectara.com/pricing/ for more details on becoming a Scale customer. - string prompt_text = 200; - - // Debugging the generative prompt is currently a Scale-only feature. - // See https://vectara.com/pricing/ for more details on becoming a Scale customer. - bool debug = 205; - - // Controls the length of the summary. - // This is a rough estimate and not a hard limit: the end summary can be longer or shorter - // than this value. This is currently a Scale-only feature. - // See https://vectara.com/pricing/ for more details on becoming a Scale customer. - uint32 response_chars = 210; - - // Parameters for the summarizer model. These are currently a Scale-only feature. - // See https://vectara.com/pricing/ for more details on becoming a Scale customer. - // WARNING: This is an experimental feature, and breakable at any point with virtually no - // notice. It is meant for experimentation to converge on optimal parameters that can then - // be set in the prompt definitions. - message ModelParams { - optional uint32 max_tokens = 5; - // The sampling temperature to use. Higher values make the summary more random, while lower - // values make it more focused and deterministic. - optional float temperature = 10; - // Higher values penalize new tokens based on their existing frequency in the text so far, - // decreasing the model's likelihood to repeat the same line verbatim. - optional float frequency_penalty = 15; - // Higher values penalize new tokens based on whether they appear in the text so far, - // increasing the model's likelihood to talk about new topics. - optional float presence_penalty = 20; - } - ModelParams model_params = 215; - - - // If present, the query will be treated as a chat query. - // When using chat, only one summarization request is allowed per query. - ChatRequest chat = 225; -} - - -message QueryRequest { - // The query text to use from the end user. - string query = 5; - - - // The start position in the result set - uint32 start = 15; - // The number of results to return. - uint32 num_results = 20; - message ContextConfig { - // chars_before is used for showing the end user the characters leading up - // to the result snippet. This can help the end-user understand the - // context of that result. Ignored if sentences_before is set. - int32 chars_before = 5 [ - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - example: "30" - }]; - - // chars_after is used for showing the end user the characters after the - // result snippet. This can help the end-user understand the context of - // that result. Ignored if sentences_before is set. - int32 chars_after = 10 [ - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - example: "30" - }]; - - // sentences_before is used for showing the end user the sentences leading - // up to the result snippet. This can help the end-user understand the - // context of that result. - int32 sentences_before = 15 [ - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - example: "3" - }]; - - // sentences_after is used for showing the end user the sentences leading - // up to the result snippet. This can help the end-user understand the - // context of that result. - int32 sentences_after = 20 [ - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - example: "3" - }]; - - // The tag that wraps the snippet at the start. Often this is used to - // provide a start HTML/XML tag or some other delimiter you can use in an - // application to understand where to provide highlighting in your UI and - // understand where the context before ends and the snippet begins. - string start_tag = 25 [ - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - example: "\"\"" - }]; - - // The tag that wraps the snippet at the end. Often this is used to provide - // a start HTML/XML tag or some other delimiter you can use in an - // application to understand where to provide highlighting in your UI and - // understand where the snippet ends and the context after begins. - string end_tag = 30 [ - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - example: "\"\"" - }]; - } - ContextConfig context_config = 22; - - // The query is run on all these corpora, and the results are - // merged together in the response, ranked by score. - repeated CorpusKey corpus_key = 25; - - // Configuration options to apply to the reranking. - message RerankingConfig { - // Which reranking model to use if reranking. Currently, the only IDs - // available are: - // - 272725717, HuggingFace Open Source x-attentional reranker - // - 272725718, Maximum Marginal Relevance Reranker - uint32 reranker_id = 5; - - // Reranker-specific parameters. The numbering starts from 100, and moves - // upwards in increments of 5. - optional MMRConfig mmr_config = 100; - } - RerankingConfig reranking_config = 30; - - // Optionally, one or more requests to summarize the results. - repeated SummarizationRequest summary = 35; - -} - - -// The chat request. -message ChatRequest { - // Whether to store the query/answer pair. - bool store = 5; - - // The conversation id of the chat. - // If empty, a new conversation will be started. - string conversation_id = 15; -} - -message Chat { - // The conversation id of the chat. - string conversation_id = 5; - // The id assigned to this query and answer. - string turn_id = 10; - - - // Any errors when processing the chat request. - Status status = 1000; -} - -message Attribute { - string name = 5; - string value = 10; -} - -message Summary { - // The summary text. - string text = 10; - - // ISO 639 language code of the summary. If the requested language was set to "AUTO", the - // summary language is the same as the auto-detected language of the query. - string lang = 15; - - - // Populated if chat was requested in the SummaryRequest. - Chat chat = 205; - - // Statuses are marked “repeated” for consistency and flexibility. A failed - // summary should bubble up into the status code of the entire ResponseSet. - repeated Status status = 1000; - // Populated for streaming requests only. - int32 future_id = 1010; -} - -message Response { - string text = 5; - // The score used for ranking results. The higher the score, the better the match. - float score = 10; - repeated Attribute metadata = 20; - // Use this ID to find the document in the ResponseSet. - uint32 document_index = 25; - CorpusKey corpus_key = 30; - -} - -message ResponseSet { - repeated Response response = 5; - // Potentially multiple warnings. - repeated Status status = 10; - - message Document { - string id = 5; - repeated Attribute metadata = 10; - } - repeated Document document = 15; - - // A summary. If using synchronous APIs for querying, the summary will be - // included directly in this response. However, if using the streaming APIs - // for query, the summary messages only set the future_id field. Later, as - // summary results are computed and returned over the stream, the future_id - // within the summary can be used for correlation. - repeated Summary summary = 25; - - // Populated for streaming requests only. - int32 future_id = 1010; -} - -message BatchQueryRequest { - repeated QueryRequest query = 5; -} - -message BatchQueryResponse { - // The response sets for queries within the batch. If using synchronous APIs - // for querying, the response set will be included directly in the response. - // However, if using the streaming APIs for query, the response set messages - // only set the future_id field. Later, as response sets are computed and - // returned over the stream, the future_id within the summary can be used for - // correlation. - repeated ResponseSet response_set = 5; - - repeated Status status = 1000; - PerformanceMetrics metrics = 1005; -} - -// This message contains individual partial results that are returned -// asynchronously by the streaming interface. -message QueryResponsePart { - // The top-level query response. This is sent exactly once over the stream. - BatchQueryResponse batch_query_response = 5; - - // A response set. Use the future_id for correlation. One of these is sent - // for every query in the batch. - ResponseSet response_set = 10; - - // A summary set. Use the future_id for correlation. One of these is sent - // for every summary that's requested. - Summary summary = 15; - - // A status code at the level of a BatchQueryResponse. - repeated Status status = 1000; -} - -// Basic performance metrics that can be attached to a server response. -message PerformanceMetrics { - // How long it took to encode the query. - uint32 query_encode_ms = 5; - // How long it took to retrieve relevant results. - uint32 retrieval_ms = 10; - // How long it took to retrieve user data. - uint32 userdata_retrieval_ms = 15; - // How long it took to rerank the results. - uint32 rerank_ms = 20; -} - -//Configuration for the maximum marginal relevance (MMR) reranker. -message MMRConfig { - // Intuitively, this bias controls how much the reranker should favor - // diversity over relevance. A bias of 1 means that relevance is not - // considered at all, while a bias of 0 means that diversity is not - // considered. A score of 0.8 means that diversity counts for 80% of the - // score, and relevance for 20%. - // - // The bias is defined as (1 - lambda), where lambda is defined as in - // the original paper, "The Use of MMR, Diversity-Based Reranking for - // Reordering Documents and Producing Summaries" by Carbonell and Goldstein, - // 1998. - float diversity_bias = 5 [ - (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - description: "The diversity bias. Higher values indicate more diversity." - example: "0.3" - }]; -} diff --git a/status.proto b/status.proto deleted file mode 100644 index aa81c84..0000000 --- a/status.proto +++ /dev/null @@ -1,203 +0,0 @@ -syntax = "proto3"; - -import "google/protobuf/any.proto"; - -option java_package = "com.vectara"; -option java_outer_classname = "StatusProtos"; - -option go_package = "vectara.com/public/proto/status"; - -package com.vectara; - -message Status { - StatusCode code = 1; - string status_detail = 2; - -} - -enum StatusCode { // Reasons for an error - OK = 0; - FAILURE = 1; - - // gRPC Codes ---------------------------------------------------------------- - - UNKNOWN = 2; - INVALID_ARGUMENT = 3; - DEADLINE_EXCEEDED = 4; - ALREADY_EXISTS = 6; - PERMISSION_DENIED = 7; - RESOURCE_EXHAUSTED = 8; - FAILED_PRECONDITION = 9; - ABORTED = 10; - OUT_OF_RANGE = 11; - UNIMPLEMENTED = 12; - INTERNAL = 13; - UNAVAILABLE = 14; - DATA_LOSS = 15; - UNAUTHENTICATED = 16; - - // HTTP Codes ---------------------------------------------------------------- - - BAD_REQUEST = 400; - UNAUTHORIZED = 401; - FORBIDDEN = 403; - NOT_FOUND = 404; - METHOD_NOT_ALLOWED = 405; - CONFLICT = 409; - UNSUPPORTED_MEDIA_TYPE = 415; - TOO_MANY_REQUESTS = 429; - INTERNAL_SERVER_ERROR = 500; - NOT_IMPLEMENTED = 501; - SERVICE_UNAVAILABLE = 503; - INSUFFICIENT_STORAGE = 507; - - UNPARSEABLE_RESPONSE = 1000; - - // General Failures----------------------------------------------------------- - - DISABLED_CUSTOMER = 1100; - INVALID_CUSTOMER_ID = 1101; - DISABLED_CORPUS = 1102; - INVALID_CORPUS_ID = 1103; - DISABLED_API_KEY = 1104; - EXPIRED_API_KEY = 1105; - INVALID_API_KEY = 1106; - // The customer managed key is inaccessible. This can be for various reasons, e.g., - // the key does not exist, or the platform does not have permissions to use it. - CMK_INACCESSIBLE = 1107; - - // Serving Query ------------------------------------------------------------- - - QRY__DISABLED_CORPUS = 1500; - QRY__DOCUMENT_DB_FAILURE = 1505; - QRY__ENCODER_FAILURE = 1510; - QRY__INTERRUPTED = 1515; - QRY__INVALID_CORPUS = 1520; - QRY__INVALID_START = 1525; - QRY__INVALID_NUM_RESULTS = 1530; - QRY__INVALID_CONTEXT = 1531; - QRY__MISSING_QUERY = 1535; - QRY__MISSING_CORPUS = 1540; - QRY__TIMEOUT = 1545; - QRY__TOO_MANY_CORPORA = 1550; - QRY__TOO_MANY_QUERIES = 1555; - QRY__VECTOR_INDEX_FAILURE = 1560; - QRY__INVALID_DIMENSION = 1565; - QRY__INVALID_CLIENTKEY = 1570; - QRY__DECRYPTION_FAILURE = 1575; - QRY__INVALID_RERANKER = 1580; - QRY__PARTIAL_RERANK = 1585; - QRY__RERANK_FAILURE = 1590; - QRY__TOO_MANY_RESULT_ROWS = 1595; - QRY__PARTIAL_RETRIEVAL = 1600; - - // The summarization prompt is invalid. - QRY__SMRY__INVALID_SUMMARIZER_PROMPT = 1660; - // The requested language for summarization is invalid. It must be a - // valid ISO 639-3 code. - QRY__SMRY__INVALID_SUMMARY_LANG = 1665; - // The requested language for summarization is valid, but not supported - // by the Vectara platform. - QRY__SMRY__UNSUPPORTED_SUMMARY_LANG = 1670; - // Fewer than the requested number of results were summarized. - QRY__SMRY__PARTIAL_SUMMARY = 1675; - // There were no query results to generate the summary. - QRY__SMRY__NO_QUERY_RESULTS = 1680; - - // Generative failures while serving queries. - QRY__GEN__NO_QUERY_RESULTS = 1650 [deprecated = true]; - QRY__GEN__UNPARSEABLE_MODEL_PARAMS = 1651 [deprecated = true]; - - // Connection specs ---------------------------------------------------------- - - CX_SPECS__INVALID_JSON = 2000; - CX_SPECS__UNREGISTERED_TYPE = 2005; - CX_SPECS__MISSING_SPEC = 2010; - CX_SPECS__MISSING_TYPE = 2011; - CX_SPECS__UNPARSEABLE_SPEC = 2015; - - // Admin Service ------------------------------------------------------------- - - ADM__INVALID_CUSTOMER_ID = 2500; - ADM__INVALID_CORPUS_ID = 2501; - ADM__INVALID_ENCODER_ID = 2502; - ADM__INVALID_ROLE_ID = 2503; - ADM__ROLE_ALREADY_EXISTS = 2504; - ADM__ONLY_ONE_OWNER_SUPPORTED = 2505; - ADM__INVALID_PERMISSION = 2506; - ADM__ROLECREATION_FAILURE = 2507; - ADM__USER_EMAIL_NOT_AVAIALBLE = 2508; - ADM__USERNAME_NOT_AVAILABLE = 2509; - - ADM__SIGNUP_MISSING_NAME = 2510; - ADM__SIGNUP_MISSING_ORG = 2511; - ADM__SIGNUP_MISSING_EMAIL = 2512; - ADM__SIGNUP_MISSING_PAYMENT = 2513; - ADM__SIGNUP_MISSING_PLAN = 2514; - ADM__SIGNUP_MISSING_PASSWORD = 2515; - - ADM__SIGNUP_INVALID_NAME = 2516; - ADM__SIGNUP_INVALID_ORG = 2517; - ADM__SIGNUP_INVALID_EMAIL = 2518; - ADM__SIGNUP_INVALID_PAYMENT = 2519; - ADM__SIGNUP_INVALID_PLAN = 2520; - ADM__SIGNUP_INVALID_PASSWORD = 2521; - ADM__SIGNUP_INVALID_ACCOUNT_ALIAS = 2530; - ADM__SIGNUP_INVALID_EMAIL_VALIDATION_CODE = 2531; - ADM__SIGNUP_MISSING_COUNTRY_CODE = 2532; - ADM__SIGNUP_ROOT_EMAIL_NOT_AVAILABLE = 2533; - - ADM__CUST_MARK_DELETE_FAILED = 2522; - ADM__CUST_FAISS_DEALLOC_FAILED = 2523; - ADM__CUST_ALREADY_ACTIVE = 2534; - ADM__CUST_REACTIVATE_FAILED = 2535; - ADM__CUST_ENABLEMENT_FAILED = 2536; - - ADM__CORPUS_LIMIT_REACHED = 2524; - - ADM__STRIPE_CARD_DECLINED = 2525; - ADM__STRIPE_PROCESSING_ERROR = 2526; - - ADM__EMAIL_VALIDATION_REQUEST_NOT_FOUND = 2540; - ADM__EMAIL_NOT_VALIDATED = 2541; - - ADM__CHANGE_PLAN__NO_CURRENT_PLAN = 2550; - ADM__CHANGE_PLAN__REQUIRES_MANUAL_CHANGE = 2551; - ADM__CHANGE_PLAN__INVALID_PLAN_ID = 2552; - ADM__CHANGE_PLAN__NO_PAYMENT_SOURCE = 2553; - ADM__CHANGE_PLAN__INVALID_EFFECTIVE_DATE = 2554; - ADM__CHANGE_PLAN__CONFLICTING_CHANGE = 2555; - - // Schema Services ----------------------------------------------------------- - - SCM__MISCONFIGURED_CONNECTION = 3000; - - // StatDB Errors - STATS_DB_READ_FAILURE = 3550; - - // Vector Database ----------------------------------------------------------- - - VDB__TEXT_READ_FAILURE = 4000; - - // Index rebuild codes ------------------------------------------------------ - REBUILD__LOW_RECALL = 4500; - REBUILD__INDEX_UPLOAD_FAILURE = 4505; - REBUILD__UPDATE_JOURNAL_FAILURE = 4510; - REBUILD__UPDATE_FAISSPARAMS_FAILURE = 4515; - REBUILD__NO_DATA = 4520; - REBUILD__EVALUATION = 4525; - - // Indexing ------------------------------------------------------------------ - - IDX__TRANSIENT_PARTIAL_DELETION_FAILURE = 5000; - IDX__PERMANENT_PARTIAL_DELETION_FAILURE = 5001; - - // Calibration --------------------------------------------------------------- - - CALB__INVALID_JSON = 5500; - CALB__INVALID_SPEC = 5501; - CALB__UNREGISTERED_TYPE = 5505; - CALB__MISSING_SPEC = 5510; - CALB__MISSING_TYPE = 5511; - CALB__UNPARSABLE_SPEC = 5515; -}