syntax = "proto3"; package artifact.v1alpha; // Artifact definitions import "artifact/v1alpha/artifact.proto"; import "artifact/v1alpha/chunk.proto"; import "artifact/v1alpha/file.proto"; import "artifact/v1alpha/knowledge_base.proto"; import "artifact/v1alpha/object.proto"; // Google API import "google/api/annotations.proto"; import "google/api/visibility.proto"; // OpenAPI definition import "protoc-gen-openapiv2/options/annotations.proto"; // ArtifactPublicService exposes the public endpoints that allow clients to // manage artifacts. service ArtifactPublicService { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_tag) = {description: "Public Artifact endpoints"}; // Check if the artifact server is alive // // See https://github.com/grpc/grpc/blob/master/doc/health-checking.md. rpc Liveness(LivenessRequest) returns (LivenessResponse) { option (google.api.http) = { get: "/v1alpha/__liveness" additional_bindings: [ {get: "/v1alpha/health/artifact"}] }; option (google.api.method_visibility).restriction = "INTERNAL"; } // Check if the artifact server is ready // // See https://github.com/grpc/grpc/blob/master/doc/health-checking.md rpc Readiness(ReadinessRequest) returns (ReadinessResponse) { option (google.api.http) = { get: "/v1alpha/__readiness" additional_bindings: [ {get: "/v1alpha/ready/artifact"}] }; option (google.api.method_visibility).restriction = "INTERNAL"; } // Create a knowledge base // // Creates a knowledge base. rpc CreateKnowledgeBase(CreateKnowledgeBaseRequest) returns (CreateKnowledgeBaseResponse) { option (google.api.http) = { post: "/v1alpha/{parent=namespaces/*}/knowledge-bases" body: "knowledge_base" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Get a knowledge base // // Returns the details of a knowledge base. rpc GetKnowledgeBase(GetKnowledgeBaseRequest) returns (GetKnowledgeBaseResponse) { option (google.api.http) = {get: "/v1alpha/{name=namespaces/*/knowledge-bases/*}"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Get all knowledge bases info // // Returns a paginated list of knowledge bases. rpc ListKnowledgeBases(ListKnowledgeBasesRequest) returns (ListKnowledgeBasesResponse) { option (google.api.http) = {get: "/v1alpha/{parent=namespaces/*}/knowledge-bases"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Update a knowledge base info // // Updates the information of a knowledge base. rpc UpdateKnowledgeBase(UpdateKnowledgeBaseRequest) returns (UpdateKnowledgeBaseResponse) { option (google.api.http) = { patch: "/v1alpha/{knowledge_base.name=namespaces/*/knowledge-bases/*}" body: "knowledge_base" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Delete a knowledge base // // Deletes a knowledge base. rpc DeleteKnowledgeBase(DeleteKnowledgeBaseRequest) returns (DeleteKnowledgeBaseResponse) { option (google.api.http) = {delete: "/v1alpha/{name=namespaces/*/knowledge-bases/*}"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Create a file // // Uploads and converts a file. rpc CreateFile(CreateFileRequest) returns (CreateFileResponse) { option (google.api.http) = { post: "/v1alpha/{parent=namespaces/*/knowledge-bases/*}/files" body: "file" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Get a file // // Returns the details of a file. rpc GetFile(GetFileRequest) returns (GetFileResponse) { option (google.api.http) = {get: "/v1alpha/{name=namespaces/*/knowledge-bases/*/files/*}"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // List files // // Returns a paginated list of files. rpc ListFiles(ListFilesRequest) returns (ListFilesResponse) { option (google.api.http) = {get: "/v1alpha/{parent=namespaces/*/knowledge-bases/*}/files"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Update a file // // Updates a file. rpc UpdateFile(UpdateFileRequest) returns (UpdateFileResponse) { option (google.api.http) = { patch: "/v1alpha/{file.name=namespaces/*/knowledge-bases/*/files/*}" body: "file" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Reprocess a file // // Triggers reprocessing of a file with its current configuration. // This will regenerate embeddings, chunks, and summaries. rpc ReprocessFile(ReprocessFileRequest) returns (ReprocessFileResponse) { option (google.api.http) = { post: "/v1alpha/{name=namespaces/*/knowledge-bases/*/files/*}/reprocess" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Delete a file // // Deletes a file. rpc DeleteFile(DeleteFileRequest) returns (DeleteFileResponse) { option (google.api.http) = {delete: "/v1alpha/{name=namespaces/*/knowledge-bases/*/files/*}"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Get a chunk // // Returns the details of a chunk. rpc GetChunk(GetChunkRequest) returns (GetChunkResponse) { option (google.api.http) = {get: "/v1alpha/{name=namespaces/*/knowledge-bases/*/files/*/chunks/*}"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // List chunks // // Returns a paginated list of chunks. rpc ListChunks(ListChunksRequest) returns (ListChunksResponse) { option (google.api.http) = {get: "/v1alpha/{parent=namespaces/*/knowledge-bases/*/files/*}/chunks"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Update a chunk // // Updates a chunk. rpc UpdateChunk(UpdateChunkRequest) returns (UpdateChunkResponse) { option (google.api.http) = { patch: "/v1alpha/{name=namespaces/*/knowledge-bases/*/files/*/chunks/*}" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Search chunks // // Returns the top-K most similar chunks to a text prompt. rpc SearchChunks(SearchChunksRequest) returns (SearchChunksResponse) { option (google.api.http) = { post: "/v1alpha/{parent=namespaces/*}/search-chunks" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } parameters: { headers: { name: "Instill-Requester-Uid" description: "Indicates the authenticated namespace is making the " "request on behalf of another entity, typically an " "organization they belong to" type: STRING } } }; } // Get Object Upload URL // // Returns the upload URL of an object. rpc GetObjectUploadURL(GetObjectUploadURLRequest) returns (GetObjectUploadURLResponse) { option (google.api.http) = {get: "/v1alpha/{parent=namespaces/*}/object-upload-url"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Get Object Download URL // // Returns the download URL of an object. rpc GetObjectDownloadURL(GetObjectDownloadURLRequest) returns (GetObjectDownloadURLResponse) { option (google.api.http) = {get: "/v1alpha/{name=namespaces/*/objects/*}/download-url"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Get Object // // Returns the details of an object. rpc GetObject(GetObjectRequest) returns (GetObjectResponse) { option (google.api.http) = {get: "/v1alpha/{name=namespaces/*/objects/*}"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Update Object // // Updates an object. rpc UpdateObject(UpdateObjectRequest) returns (UpdateObjectResponse) { option (google.api.http) = { patch: "/v1alpha/{object.name=namespaces/*/objects/*}" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } // Delete Object // // Deletes an object. rpc DeleteObject(DeleteObjectRequest) returns (DeleteObjectResponse) { option (google.api.http) = {delete: "/v1alpha/{name=namespaces/*/objects/*}"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { tags: "Artifact" extensions: { key: "x-stage" value: {string_value: "alpha"} } }; } }