提交测试代码

This commit is contained in:
ivamp 2024-05-26 00:21:15 +08:00
parent c550a5370e
commit d8bd65d268
12 changed files with 971 additions and 250 deletions

View File

@ -5,18 +5,5 @@
</template>
<script lang="ts" setup>
import { ref } from "vue";
import * as libraryProto from "@/proto/library/library";
import * as documentProto from "@/proto/document/document";
import keycloak from "@/plugins/keycloak"
import {libraryServiceClient} from "@/plugins/rpc"
let listLibrary: libraryProto.ListLibrariesRequest = {
page: 1
}
libraryServiceClient.listLibraries(listLibrary)
</script>

View File

@ -2,25 +2,50 @@
<!-- <v-app id="nav"> -->
<v-navigation-drawer v-model="drawer">
<div class="pa-2">
<v-btn
density="default"
icon="mdi-close"
@click="drawer = !drawer"
></v-btn>
<v-btn-group rounded="lg">
<v-btn
density="default"
icon="mdi-close"
@click="drawer = !drawer"
></v-btn>
<v-btn density="default" icon="mdi-plus" title="创建资料库" @click="to('libraries.create')">
</v-btn>
</v-btn-group>
</div>
<!-- <v-divider></v-divider> -->
<v-list density="compact" nav>
<template v-for="item in items">
<!-- <template v-for="item in items">
<v-list-item
rounded="lg"
:prepend-icon="item.icon"
:title="item.text"
:value="item.text"
:to="item.to"
:on-click="item?.click"
></v-list-item>
</template>
</template> -->
<v-list-item
rounded="lg"
prepend-icon="mdi-home"
title="首页"
:to="{
name: 'home',
}"
></v-list-item>
<v-list-item
rounded="lg"
prepend-icon="mdi-account"
title="登录"
:to="{
name: 'login',
}"
v-show="!logined"
></v-list-item>
<!-- <v-list-item
prepend-icon="mdi-forum"
@ -41,15 +66,45 @@
<script lang="ts" setup>
import { ref } from "vue";
import { useConfigStore } from "@/store/config";
import keycloak from "@/plugins/keycloak";
import rpcPlugin from "@/plugins/rpc";
import * as libraryPb from "@/proto/library/library";
import router from "@/router";
const configStore = useConfigStore();
const drawer = ref(false);
const items = [
{ icon: "mdi-home", text: "首页", to: { name: "home" } },
{ icon: "mdi-content-copy", text: "资料库", to: { name: "libraries" } },
// { icon: "mdi-history", text: "Frequently contacted", to: "/documents" },
{ icon: "mdi-account", text: "登录", to: { name: "login" } },
];
const logined = ref(false);
let inter = setInterval(() => {
logined.value = keycloak.authenticated === true;
if (logined.value) {
clearInterval(inter);
refreshLibraries()
}
}, 1000);
function refreshLibraries() {
const useRpc = rpcPlugin()
let listLibrary: libraryPb.ListLibrariesRequest = {
page: 1,
};
useRpc.libraryServiceClient.listLibraries(listLibrary).then((res) => {
console.log(res);
});
}
function to(name: string) {
router.push({
name: name,
});
}
</script>

View File

@ -1,4 +1,4 @@
let staticConfig = {
const staticConfig = {
url: "https://auth.leaflow.cn/",
realm: "UserLand",
clientId: "Leaf Library",

View File

@ -1,4 +1,4 @@
let matchResult = window.matchMedia('(prefers-color-scheme: dark)');
const matchResult = window.matchMedia('(prefers-color-scheme: dark)');
function getTheme() {

View File

@ -13,7 +13,6 @@ const keycloakOptions: KeycloakInitOptions = {
checkLoginIframe: config.checkLoginIframe,
redirectUri: config.redirectUri,
// onLoad: 'login-required',
}
// kc.updateToken

View File

@ -5,20 +5,22 @@ import { DocumentServiceClient } from "@/proto/document/document.client";
import { LibraryServiceClient } from "@/proto/library/library.client";
import config from "@/plugins/config"
let transport = new GrpcWebFetchTransport({
export default () => {
const transport = new GrpcWebFetchTransport({
baseUrl: config.rpc_base_url,
format: "text",
meta: {
"Authorization": "Bearer " + keycloak.idToken,
},
timeout: 100 * 1000,
});
});
let libraryServiceClient = new LibraryServiceClient(transport)
let documentClient = new DocumentServiceClient(transport)
export {
libraryServiceClient,
documentClient
}
const libraryServiceClient = new LibraryServiceClient(transport)
const documentClient = new DocumentServiceClient(transport)
return {
libraryServiceClient,
documentClient
}
}

View File

@ -1,24 +1,28 @@
// @generated by protobuf-ts 2.9.4 with parameter generate_dependencies
// @generated from protobuf file "proto/document/document.proto" (package "DocumentService", syntax proto3)
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import { DocumentService } from "./document";
import type { TestStreamResponse } from "./document";
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { DocumentChunkList } from "./document";
import type { VectorSearchByTextInDocumentRequest } from "./document";
import type { Empty } from "./document";
import type { DeleteDocumentRequest } from "./document";
import type { UpdateDocumentRequest } from "./document";
import type { GetDocumentRequest } from "./document";
import type { Document } from "./document";
import type { CreateDocumentRequest } from "./document";
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { DocumentList } from "./document";
import type { ListDocumentsRequest } from "./document";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
import type {RpcOptions, RpcTransport, ServiceInfo, UnaryCall} from "@protobuf-ts/runtime-rpc";
import {stackIntercept} from "@protobuf-ts/runtime-rpc";
import type {
CreateDocumentBlockRequest,
CreateDocumentRequest,
DeleteDocumentBlockRequest,
DeleteDocumentRequest,
Document,
DocumentBlock,
DocumentBlockList,
DocumentList,
Empty,
GetDocumentBlockRequest,
GetDocumentBlocksRequest,
GetDocumentRequest,
ListDocumentsRequest,
UpdateDocumentBlockRequest,
UpdateDocumentRequest,
VectorSearchByTextInDocumentRequest
} from "./document";
import {DocumentService} from "./document";
/**
* @generated from protobuf service DocumentService.DocumentService
*/
@ -46,13 +50,31 @@ export interface IDocumentServiceClient {
/**
* rpc SearchTextInDocument(TextSearchInDocumentRequest) returns (SearchResponse) {}
*
* @generated from protobuf rpc: VectorSearchByTextInDocument(DocumentService.VectorSearchByTextInDocumentRequest) returns (DocumentService.DocumentChunkList);
* @generated from protobuf rpc: VectorSearchByTextInDocument(DocumentService.VectorSearchByTextInDocumentRequest) returns (DocumentService.DocumentBlockList);
*/
vectorSearchByTextInDocument(input: VectorSearchByTextInDocumentRequest, options?: RpcOptions): UnaryCall<VectorSearchByTextInDocumentRequest, DocumentChunkList>;
vectorSearchByTextInDocument(input: VectorSearchByTextInDocumentRequest, options?: RpcOptions): UnaryCall<VectorSearchByTextInDocumentRequest, DocumentBlockList>;
/**
* @generated from protobuf rpc: TestStream(DocumentService.Empty) returns (stream DocumentService.TestStreamResponse);
* rpc TestStream(Empty) returns (stream TestStreamResponse) {}
*
* @generated from protobuf rpc: CreateDocumentBlock(DocumentService.CreateDocumentBlockRequest) returns (DocumentService.DocumentBlock);
*/
testStream(input: Empty, options?: RpcOptions): ServerStreamingCall<Empty, TestStreamResponse>;
createDocumentBlock(input: CreateDocumentBlockRequest, options?: RpcOptions): UnaryCall<CreateDocumentBlockRequest, DocumentBlock>;
/**
* @generated from protobuf rpc: GetBlock(DocumentService.GetDocumentBlockRequest) returns (DocumentService.DocumentBlock);
*/
getBlock(input: GetDocumentBlockRequest, options?: RpcOptions): UnaryCall<GetDocumentBlockRequest, DocumentBlock>;
/**
* @generated from protobuf rpc: GetDocumentBlocks(DocumentService.GetDocumentBlocksRequest) returns (DocumentService.DocumentBlockList);
*/
getDocumentBlocks(input: GetDocumentBlocksRequest, options?: RpcOptions): UnaryCall<GetDocumentBlocksRequest, DocumentBlockList>;
/**
* @generated from protobuf rpc: DeleteBlock(DocumentService.DeleteDocumentBlockRequest) returns (DocumentService.Empty);
*/
deleteBlock(input: DeleteDocumentBlockRequest, options?: RpcOptions): UnaryCall<DeleteDocumentBlockRequest, Empty>;
/**
* @generated from protobuf rpc: UpdateBlock(DocumentService.UpdateDocumentBlockRequest) returns (DocumentService.DocumentBlock);
*/
updateBlock(input: UpdateDocumentBlockRequest, options?: RpcOptions): UnaryCall<UpdateDocumentBlockRequest, DocumentBlock>;
}
/**
* @generated from protobuf service DocumentService.DocumentService
@ -101,17 +123,47 @@ export class DocumentServiceClient implements IDocumentServiceClient, ServiceInf
/**
* rpc SearchTextInDocument(TextSearchInDocumentRequest) returns (SearchResponse) {}
*
* @generated from protobuf rpc: VectorSearchByTextInDocument(DocumentService.VectorSearchByTextInDocumentRequest) returns (DocumentService.DocumentChunkList);
* @generated from protobuf rpc: VectorSearchByTextInDocument(DocumentService.VectorSearchByTextInDocumentRequest) returns (DocumentService.DocumentBlockList);
*/
vectorSearchByTextInDocument(input: VectorSearchByTextInDocumentRequest, options?: RpcOptions): UnaryCall<VectorSearchByTextInDocumentRequest, DocumentChunkList> {
vectorSearchByTextInDocument(input: VectorSearchByTextInDocumentRequest, options?: RpcOptions): UnaryCall<VectorSearchByTextInDocumentRequest, DocumentBlockList> {
const method = this.methods[5], opt = this._transport.mergeOptions(options);
return stackIntercept<VectorSearchByTextInDocumentRequest, DocumentChunkList>("unary", this._transport, method, opt, input);
return stackIntercept<VectorSearchByTextInDocumentRequest, DocumentBlockList>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: TestStream(DocumentService.Empty) returns (stream DocumentService.TestStreamResponse);
* rpc TestStream(Empty) returns (stream TestStreamResponse) {}
*
* @generated from protobuf rpc: CreateDocumentBlock(DocumentService.CreateDocumentBlockRequest) returns (DocumentService.DocumentBlock);
*/
testStream(input: Empty, options?: RpcOptions): ServerStreamingCall<Empty, TestStreamResponse> {
createDocumentBlock(input: CreateDocumentBlockRequest, options?: RpcOptions): UnaryCall<CreateDocumentBlockRequest, DocumentBlock> {
const method = this.methods[6], opt = this._transport.mergeOptions(options);
return stackIntercept<Empty, TestStreamResponse>("serverStreaming", this._transport, method, opt, input);
return stackIntercept<CreateDocumentBlockRequest, DocumentBlock>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: GetBlock(DocumentService.GetDocumentBlockRequest) returns (DocumentService.DocumentBlock);
*/
getBlock(input: GetDocumentBlockRequest, options?: RpcOptions): UnaryCall<GetDocumentBlockRequest, DocumentBlock> {
const method = this.methods[7], opt = this._transport.mergeOptions(options);
return stackIntercept<GetDocumentBlockRequest, DocumentBlock>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: GetDocumentBlocks(DocumentService.GetDocumentBlocksRequest) returns (DocumentService.DocumentBlockList);
*/
getDocumentBlocks(input: GetDocumentBlocksRequest, options?: RpcOptions): UnaryCall<GetDocumentBlocksRequest, DocumentBlockList> {
const method = this.methods[8], opt = this._transport.mergeOptions(options);
return stackIntercept<GetDocumentBlocksRequest, DocumentBlockList>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: DeleteBlock(DocumentService.DeleteDocumentBlockRequest) returns (DocumentService.Empty);
*/
deleteBlock(input: DeleteDocumentBlockRequest, options?: RpcOptions): UnaryCall<DeleteDocumentBlockRequest, Empty> {
const method = this.methods[9], opt = this._transport.mergeOptions(options);
return stackIntercept<DeleteDocumentBlockRequest, Empty>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: UpdateBlock(DocumentService.UpdateDocumentBlockRequest) returns (DocumentService.DocumentBlock);
*/
updateBlock(input: UpdateDocumentBlockRequest, options?: RpcOptions): UnaryCall<UpdateDocumentBlockRequest, DocumentBlock> {
const method = this.methods[10], opt = this._transport.mergeOptions(options);
return stackIntercept<UpdateDocumentBlockRequest, DocumentBlock>("unary", this._transport, method, opt, input);
}
}

View File

@ -1,16 +1,16 @@
// @generated by protobuf-ts 2.9.4 with parameter generate_dependencies
// @generated from protobuf file "proto/document/document.proto" (package "DocumentService", syntax proto3)
// tslint:disable
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import {ServiceType} from "@protobuf-ts/runtime-rpc";
import type {
BinaryReadOptions,
BinaryWriteOptions,
IBinaryReader,
IBinaryWriter,
PartialMessage
} from "@protobuf-ts/runtime";
import {MessageType, reflectionMergePartial, UnknownFieldHandler, WireType} from "@protobuf-ts/runtime";
/**
* @generated from protobuf message DocumentService.Empty
*/
@ -33,17 +33,13 @@ export interface Document {
*/
description: string;
/**
* @generated from protobuf field: string content = 4;
* @generated from protobuf field: repeated int64 block_ids = 4;
*/
content: string;
blockIds: bigint[];
/**
* @generated from protobuf field: uint32 library_id = 5;
*/
libraryId: number;
/**
* @generated from protobuf field: bool chunked = 6;
*/
chunked: boolean;
}
/**
* @generated from protobuf message DocumentService.DocumentNoContent
@ -65,10 +61,6 @@ export interface DocumentNoContent {
* @generated from protobuf field: uint32 library_id = 4;
*/
libraryId: number;
/**
* @generated from protobuf field: bool chunked = 5;
*/
chunked: boolean;
}
/**
* @generated from protobuf message DocumentService.ListDocumentsRequest
@ -105,11 +97,7 @@ export interface CreateDocumentRequest {
*/
description: string;
/**
* @generated from protobuf field: string content = 3;
*/
content: string;
/**
* @generated from protobuf field: uint32 library_id = 4;
* @generated from protobuf field: uint32 library_id = 3;
*/
libraryId: number;
}
@ -142,6 +130,10 @@ export interface UpdateDocumentRequest {
* @generated from protobuf field: string content = 4;
*/
content: string;
/**
* @generated from protobuf field: repeated int64 block_ids = 5;
*/
blockIds: bigint[];
}
/**
* @generated from protobuf message DocumentService.DeleteDocumentRequest
@ -205,21 +197,13 @@ export interface VectorSearchByTextInDocumentRequest {
documentId: number;
}
/**
* @generated from protobuf message DocumentService.DocumentChunkList
* @generated from protobuf message DocumentService.DocumentBlockList
*/
export interface DocumentChunkList {
export interface DocumentBlockList {
/**
* @generated from protobuf field: repeated string content = 1;
* @generated from protobuf field: repeated DocumentService.DocumentBlock blocks = 1;
*/
content: string[];
/**
* @generated from protobuf field: uint32 document_id = 2;
*/
documentId: number;
/**
* @generated from protobuf field: uint32 library_id = 3;
*/
libraryId: number;
blocks: DocumentBlock[];
}
/**
* @generated from protobuf message DocumentService.TestStreamResponse
@ -230,6 +214,126 @@ export interface TestStreamResponse {
*/
name: string;
}
/**
* @generated from protobuf message DocumentService.CreateDocumentBlockRequest
*/
export interface CreateDocumentBlockRequest {
/**
* @generated from protobuf field: string content = 1;
*/
content: string;
/**
* @generated from protobuf field: uint32 document_id = 3;
*/
documentId: number;
}
/**
* @generated from protobuf message DocumentService.DocumentBlock
*/
export interface DocumentBlock {
/**
* @generated from protobuf field: string content = 1;
*/
content: string;
/**
* @generated from protobuf field: uint32 document_id = 2;
*/
documentId: number;
/**
* @generated from protobuf field: uint32 library_id = 3;
*/
libraryId: number;
/**
* @generated from protobuf field: uint32 block_id = 4;
*/
blockId: number;
/**
* @generated from protobuf field: bool vectorized = 5;
*/
vectorized: boolean;
}
/**
* @generated from protobuf message DocumentService.GetDocumentBlockRequest
*/
export interface GetDocumentBlockRequest {
/**
* @generated from protobuf field: uint32 id = 1;
*/
id: number;
}
/**
* @generated from protobuf message DocumentService.GetDocumentBlocksRequest
*/
export interface GetDocumentBlocksRequest {
/**
* @generated from protobuf field: uint32 document_id = 1;
*/
documentId: number;
/**
* @generated from protobuf field: uint32 page = 2;
*/
page: number;
}
/**
* @generated from protobuf message DocumentService.DocumentBlockListResponse
*/
export interface DocumentBlockListResponse {
/**
* @generated from protobuf field: uint32 document_id = 1;
*/
documentId: number;
/**
* @generated from protobuf field: DocumentService.Pagination pagination = 2;
*/
pagination?: Pagination;
/**
* @generated from protobuf field: DocumentService.DocumentBlockList blocks = 3;
*/
blocks?: DocumentBlockList;
}
/**
* @generated from protobuf message DocumentService.Pagination
*/
export interface Pagination {
/**
* @generated from protobuf field: uint32 page = 1;
*/
page: number;
/**
* @generated from protobuf field: uint32 page_size = 2;
*/
pageSize: number;
/**
* @generated from protobuf field: uint32 total_page = 3;
*/
totalPage: number;
/**
* @generated from protobuf field: uint32 total_count = 4;
*/
totalCount: number;
}
/**
* @generated from protobuf message DocumentService.UpdateDocumentBlockRequest
*/
export interface UpdateDocumentBlockRequest {
/**
* @generated from protobuf field: uint32 id = 1;
*/
id: number;
/**
* @generated from protobuf field: string content = 2;
*/
content: string;
}
/**
* @generated from protobuf message DocumentService.DeleteDocumentBlockRequest
*/
export interface DeleteDocumentBlockRequest {
/**
* @generated from protobuf field: uint32 id = 1;
*/
id: number;
}
// @generated message type with reflection information, may provide speed optimized methods
class Empty$Type extends MessageType<Empty> {
constructor() {
@ -262,9 +366,8 @@ class Document$Type extends MessageType<Document> {
{ no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 2, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 3, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 4, name: "content", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 5, name: "library_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 6, name: "chunked", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
{ no: 4, name: "block_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 5, name: "library_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
]);
}
create(value?: PartialMessage<Document>): Document {
@ -272,9 +375,8 @@ class Document$Type extends MessageType<Document> {
message.id = 0;
message.title = "";
message.description = "";
message.content = "";
message.blockIds = [];
message.libraryId = 0;
message.chunked = false;
if (value !== undefined)
reflectionMergePartial<Document>(this, message, value);
return message;
@ -293,15 +395,16 @@ class Document$Type extends MessageType<Document> {
case /* string description */ 3:
message.description = reader.string();
break;
case /* string content */ 4:
message.content = reader.string();
case /* repeated int64 block_ids */ 4:
if (wireType === WireType.LengthDelimited)
for (let e = reader.int32() + reader.pos; reader.pos < e;)
message.blockIds.push(reader.int64().toBigInt());
else
message.blockIds.push(reader.int64().toBigInt());
break;
case /* uint32 library_id */ 5:
message.libraryId = reader.uint32();
break;
case /* bool chunked */ 6:
message.chunked = reader.bool();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
@ -323,15 +426,16 @@ class Document$Type extends MessageType<Document> {
/* string description = 3; */
if (message.description !== "")
writer.tag(3, WireType.LengthDelimited).string(message.description);
/* string content = 4; */
if (message.content !== "")
writer.tag(4, WireType.LengthDelimited).string(message.content);
/* repeated int64 block_ids = 4; */
if (message.blockIds.length) {
writer.tag(4, WireType.LengthDelimited).fork();
for (let i = 0; i < message.blockIds.length; i++)
writer.int64(message.blockIds[i]);
writer.join();
}
/* uint32 library_id = 5; */
if (message.libraryId !== 0)
writer.tag(5, WireType.Varint).uint32(message.libraryId);
/* bool chunked = 6; */
if (message.chunked !== false)
writer.tag(6, WireType.Varint).bool(message.chunked);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@ -349,8 +453,7 @@ class DocumentNoContent$Type extends MessageType<DocumentNoContent> {
{ no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 2, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 3, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 4, name: "library_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 5, name: "chunked", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
{ no: 4, name: "library_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
]);
}
create(value?: PartialMessage<DocumentNoContent>): DocumentNoContent {
@ -359,7 +462,6 @@ class DocumentNoContent$Type extends MessageType<DocumentNoContent> {
message.title = "";
message.description = "";
message.libraryId = 0;
message.chunked = false;
if (value !== undefined)
reflectionMergePartial<DocumentNoContent>(this, message, value);
return message;
@ -381,9 +483,6 @@ class DocumentNoContent$Type extends MessageType<DocumentNoContent> {
case /* uint32 library_id */ 4:
message.libraryId = reader.uint32();
break;
case /* bool chunked */ 5:
message.chunked = reader.bool();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
@ -408,9 +507,6 @@ class DocumentNoContent$Type extends MessageType<DocumentNoContent> {
/* uint32 library_id = 4; */
if (message.libraryId !== 0)
writer.tag(4, WireType.Varint).uint32(message.libraryId);
/* bool chunked = 5; */
if (message.chunked !== false)
writer.tag(5, WireType.Varint).bool(message.chunked);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@ -529,15 +625,13 @@ class CreateDocumentRequest$Type extends MessageType<CreateDocumentRequest> {
super("DocumentService.CreateDocumentRequest", [
{ no: 1, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 3, name: "content", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 4, name: "library_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
{ no: 3, name: "library_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
]);
}
create(value?: PartialMessage<CreateDocumentRequest>): CreateDocumentRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.title = "";
message.description = "";
message.content = "";
message.libraryId = 0;
if (value !== undefined)
reflectionMergePartial<CreateDocumentRequest>(this, message, value);
@ -554,10 +648,7 @@ class CreateDocumentRequest$Type extends MessageType<CreateDocumentRequest> {
case /* string description */ 2:
message.description = reader.string();
break;
case /* string content */ 3:
message.content = reader.string();
break;
case /* uint32 library_id */ 4:
case /* uint32 library_id */ 3:
message.libraryId = reader.uint32();
break;
default:
@ -578,12 +669,9 @@ class CreateDocumentRequest$Type extends MessageType<CreateDocumentRequest> {
/* string description = 2; */
if (message.description !== "")
writer.tag(2, WireType.LengthDelimited).string(message.description);
/* string content = 3; */
if (message.content !== "")
writer.tag(3, WireType.LengthDelimited).string(message.content);
/* uint32 library_id = 4; */
/* uint32 library_id = 3; */
if (message.libraryId !== 0)
writer.tag(4, WireType.Varint).uint32(message.libraryId);
writer.tag(3, WireType.Varint).uint32(message.libraryId);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@ -648,7 +736,8 @@ class UpdateDocumentRequest$Type extends MessageType<UpdateDocumentRequest> {
{ no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 2, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 3, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 4, name: "content", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
{ no: 4, name: "content", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 5, name: "block_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
]);
}
create(value?: PartialMessage<UpdateDocumentRequest>): UpdateDocumentRequest {
@ -657,6 +746,7 @@ class UpdateDocumentRequest$Type extends MessageType<UpdateDocumentRequest> {
message.title = "";
message.description = "";
message.content = "";
message.blockIds = [];
if (value !== undefined)
reflectionMergePartial<UpdateDocumentRequest>(this, message, value);
return message;
@ -678,6 +768,13 @@ class UpdateDocumentRequest$Type extends MessageType<UpdateDocumentRequest> {
case /* string content */ 4:
message.content = reader.string();
break;
case /* repeated int64 block_ids */ 5:
if (wireType === WireType.LengthDelimited)
for (let e = reader.int32() + reader.pos; reader.pos < e;)
message.blockIds.push(reader.int64().toBigInt());
else
message.blockIds.push(reader.int64().toBigInt());
break;
default:
let u = options.readUnknownField;
if (u === "throw")
@ -702,6 +799,13 @@ class UpdateDocumentRequest$Type extends MessageType<UpdateDocumentRequest> {
/* string content = 4; */
if (message.content !== "")
writer.tag(4, WireType.LengthDelimited).string(message.content);
/* repeated int64 block_ids = 5; */
if (message.blockIds.length) {
writer.tag(5, WireType.LengthDelimited).fork();
for (let i = 0; i < message.blockIds.length; i++)
writer.int64(message.blockIds[i]);
writer.join();
}
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@ -980,36 +1084,26 @@ class VectorSearchByTextInDocumentRequest$Type extends MessageType<VectorSearchB
*/
export const VectorSearchByTextInDocumentRequest = new VectorSearchByTextInDocumentRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DocumentChunkList$Type extends MessageType<DocumentChunkList> {
class DocumentBlockList$Type extends MessageType<DocumentBlockList> {
constructor() {
super("DocumentService.DocumentChunkList", [
{ no: 1, name: "content", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "document_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 3, name: "library_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
super("DocumentService.DocumentBlockList", [
{ no: 1, name: "blocks", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => DocumentBlock }
]);
}
create(value?: PartialMessage<DocumentChunkList>): DocumentChunkList {
create(value?: PartialMessage<DocumentBlockList>): DocumentBlockList {
const message = globalThis.Object.create((this.messagePrototype!));
message.content = [];
message.documentId = 0;
message.libraryId = 0;
message.blocks = [];
if (value !== undefined)
reflectionMergePartial<DocumentChunkList>(this, message, value);
reflectionMergePartial<DocumentBlockList>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DocumentChunkList): DocumentChunkList {
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DocumentBlockList): DocumentBlockList {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* repeated string content */ 1:
message.content.push(reader.string());
break;
case /* uint32 document_id */ 2:
message.documentId = reader.uint32();
break;
case /* uint32 library_id */ 3:
message.libraryId = reader.uint32();
case /* repeated DocumentService.DocumentBlock blocks */ 1:
message.blocks.push(DocumentBlock.internalBinaryRead(reader, reader.uint32(), options));
break;
default:
let u = options.readUnknownField;
@ -1022,16 +1116,10 @@ class DocumentChunkList$Type extends MessageType<DocumentChunkList> {
}
return message;
}
internalBinaryWrite(message: DocumentChunkList, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* repeated string content = 1; */
for (let i = 0; i < message.content.length; i++)
writer.tag(1, WireType.LengthDelimited).string(message.content[i]);
/* uint32 document_id = 2; */
if (message.documentId !== 0)
writer.tag(2, WireType.Varint).uint32(message.documentId);
/* uint32 library_id = 3; */
if (message.libraryId !== 0)
writer.tag(3, WireType.Varint).uint32(message.libraryId);
internalBinaryWrite(message: DocumentBlockList, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* repeated DocumentService.DocumentBlock blocks = 1; */
for (let i = 0; i < message.blocks.length; i++)
DocumentBlock.internalBinaryWrite(message.blocks[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@ -1039,9 +1127,9 @@ class DocumentChunkList$Type extends MessageType<DocumentChunkList> {
}
}
/**
* @generated MessageType for protobuf message DocumentService.DocumentChunkList
* @generated MessageType for protobuf message DocumentService.DocumentBlockList
*/
export const DocumentChunkList = new DocumentChunkList$Type();
export const DocumentBlockList = new DocumentBlockList$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TestStreamResponse$Type extends MessageType<TestStreamResponse> {
constructor() {
@ -1089,6 +1177,476 @@ class TestStreamResponse$Type extends MessageType<TestStreamResponse> {
* @generated MessageType for protobuf message DocumentService.TestStreamResponse
*/
export const TestStreamResponse = new TestStreamResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreateDocumentBlockRequest$Type extends MessageType<CreateDocumentBlockRequest> {
constructor() {
super("DocumentService.CreateDocumentBlockRequest", [
{ no: 1, name: "content", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 3, name: "document_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
]);
}
create(value?: PartialMessage<CreateDocumentBlockRequest>): CreateDocumentBlockRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.content = "";
message.documentId = 0;
if (value !== undefined)
reflectionMergePartial<CreateDocumentBlockRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateDocumentBlockRequest): CreateDocumentBlockRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string content */ 1:
message.content = reader.string();
break;
case /* uint32 document_id */ 3:
message.documentId = reader.uint32();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message: CreateDocumentBlockRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string content = 1; */
if (message.content !== "")
writer.tag(1, WireType.LengthDelimited).string(message.content);
/* uint32 document_id = 3; */
if (message.documentId !== 0)
writer.tag(3, WireType.Varint).uint32(message.documentId);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message DocumentService.CreateDocumentBlockRequest
*/
export const CreateDocumentBlockRequest = new CreateDocumentBlockRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DocumentBlock$Type extends MessageType<DocumentBlock> {
constructor() {
super("DocumentService.DocumentBlock", [
{ no: 1, name: "content", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "document_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 3, name: "library_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 4, name: "block_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 5, name: "vectorized", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
]);
}
create(value?: PartialMessage<DocumentBlock>): DocumentBlock {
const message = globalThis.Object.create((this.messagePrototype!));
message.content = "";
message.documentId = 0;
message.libraryId = 0;
message.blockId = 0;
message.vectorized = false;
if (value !== undefined)
reflectionMergePartial<DocumentBlock>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DocumentBlock): DocumentBlock {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string content */ 1:
message.content = reader.string();
break;
case /* uint32 document_id */ 2:
message.documentId = reader.uint32();
break;
case /* uint32 library_id */ 3:
message.libraryId = reader.uint32();
break;
case /* uint32 block_id */ 4:
message.blockId = reader.uint32();
break;
case /* bool vectorized */ 5:
message.vectorized = reader.bool();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message: DocumentBlock, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string content = 1; */
if (message.content !== "")
writer.tag(1, WireType.LengthDelimited).string(message.content);
/* uint32 document_id = 2; */
if (message.documentId !== 0)
writer.tag(2, WireType.Varint).uint32(message.documentId);
/* uint32 library_id = 3; */
if (message.libraryId !== 0)
writer.tag(3, WireType.Varint).uint32(message.libraryId);
/* uint32 block_id = 4; */
if (message.blockId !== 0)
writer.tag(4, WireType.Varint).uint32(message.blockId);
/* bool vectorized = 5; */
if (message.vectorized !== false)
writer.tag(5, WireType.Varint).bool(message.vectorized);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message DocumentService.DocumentBlock
*/
export const DocumentBlock = new DocumentBlock$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetDocumentBlockRequest$Type extends MessageType<GetDocumentBlockRequest> {
constructor() {
super("DocumentService.GetDocumentBlockRequest", [
{ no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
]);
}
create(value?: PartialMessage<GetDocumentBlockRequest>): GetDocumentBlockRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.id = 0;
if (value !== undefined)
reflectionMergePartial<GetDocumentBlockRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetDocumentBlockRequest): GetDocumentBlockRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* uint32 id */ 1:
message.id = reader.uint32();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message: GetDocumentBlockRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* uint32 id = 1; */
if (message.id !== 0)
writer.tag(1, WireType.Varint).uint32(message.id);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message DocumentService.GetDocumentBlockRequest
*/
export const GetDocumentBlockRequest = new GetDocumentBlockRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetDocumentBlocksRequest$Type extends MessageType<GetDocumentBlocksRequest> {
constructor() {
super("DocumentService.GetDocumentBlocksRequest", [
{ no: 1, name: "document_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 2, name: "page", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
]);
}
create(value?: PartialMessage<GetDocumentBlocksRequest>): GetDocumentBlocksRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.documentId = 0;
message.page = 0;
if (value !== undefined)
reflectionMergePartial<GetDocumentBlocksRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetDocumentBlocksRequest): GetDocumentBlocksRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* uint32 document_id */ 1:
message.documentId = reader.uint32();
break;
case /* uint32 page */ 2:
message.page = reader.uint32();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message: GetDocumentBlocksRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* uint32 document_id = 1; */
if (message.documentId !== 0)
writer.tag(1, WireType.Varint).uint32(message.documentId);
/* uint32 page = 2; */
if (message.page !== 0)
writer.tag(2, WireType.Varint).uint32(message.page);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message DocumentService.GetDocumentBlocksRequest
*/
export const GetDocumentBlocksRequest = new GetDocumentBlocksRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DocumentBlockListResponse$Type extends MessageType<DocumentBlockListResponse> {
constructor() {
super("DocumentService.DocumentBlockListResponse", [
{ no: 1, name: "document_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 2, name: "pagination", kind: "message", T: () => Pagination },
{ no: 3, name: "blocks", kind: "message", T: () => DocumentBlockList }
]);
}
create(value?: PartialMessage<DocumentBlockListResponse>): DocumentBlockListResponse {
const message = globalThis.Object.create((this.messagePrototype!));
message.documentId = 0;
if (value !== undefined)
reflectionMergePartial<DocumentBlockListResponse>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DocumentBlockListResponse): DocumentBlockListResponse {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* uint32 document_id */ 1:
message.documentId = reader.uint32();
break;
case /* DocumentService.Pagination pagination */ 2:
message.pagination = Pagination.internalBinaryRead(reader, reader.uint32(), options, message.pagination);
break;
case /* DocumentService.DocumentBlockList blocks */ 3:
message.blocks = DocumentBlockList.internalBinaryRead(reader, reader.uint32(), options, message.blocks);
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message: DocumentBlockListResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* uint32 document_id = 1; */
if (message.documentId !== 0)
writer.tag(1, WireType.Varint).uint32(message.documentId);
/* DocumentService.Pagination pagination = 2; */
if (message.pagination)
Pagination.internalBinaryWrite(message.pagination, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* DocumentService.DocumentBlockList blocks = 3; */
if (message.blocks)
DocumentBlockList.internalBinaryWrite(message.blocks, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message DocumentService.DocumentBlockListResponse
*/
export const DocumentBlockListResponse = new DocumentBlockListResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Pagination$Type extends MessageType<Pagination> {
constructor() {
super("DocumentService.Pagination", [
{ no: 1, name: "page", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 2, name: "page_size", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 3, name: "total_page", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 4, name: "total_count", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
]);
}
create(value?: PartialMessage<Pagination>): Pagination {
const message = globalThis.Object.create((this.messagePrototype!));
message.page = 0;
message.pageSize = 0;
message.totalPage = 0;
message.totalCount = 0;
if (value !== undefined)
reflectionMergePartial<Pagination>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Pagination): Pagination {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* uint32 page */ 1:
message.page = reader.uint32();
break;
case /* uint32 page_size */ 2:
message.pageSize = reader.uint32();
break;
case /* uint32 total_page */ 3:
message.totalPage = reader.uint32();
break;
case /* uint32 total_count */ 4:
message.totalCount = reader.uint32();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message: Pagination, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* uint32 page = 1; */
if (message.page !== 0)
writer.tag(1, WireType.Varint).uint32(message.page);
/* uint32 page_size = 2; */
if (message.pageSize !== 0)
writer.tag(2, WireType.Varint).uint32(message.pageSize);
/* uint32 total_page = 3; */
if (message.totalPage !== 0)
writer.tag(3, WireType.Varint).uint32(message.totalPage);
/* uint32 total_count = 4; */
if (message.totalCount !== 0)
writer.tag(4, WireType.Varint).uint32(message.totalCount);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message DocumentService.Pagination
*/
export const Pagination = new Pagination$Type();
// @generated message type with reflection information, may provide speed optimized methods
class UpdateDocumentBlockRequest$Type extends MessageType<UpdateDocumentBlockRequest> {
constructor() {
super("DocumentService.UpdateDocumentBlockRequest", [
{ no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 2, name: "content", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
]);
}
create(value?: PartialMessage<UpdateDocumentBlockRequest>): UpdateDocumentBlockRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.id = 0;
message.content = "";
if (value !== undefined)
reflectionMergePartial<UpdateDocumentBlockRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateDocumentBlockRequest): UpdateDocumentBlockRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* uint32 id */ 1:
message.id = reader.uint32();
break;
case /* string content */ 2:
message.content = reader.string();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message: UpdateDocumentBlockRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* uint32 id = 1; */
if (message.id !== 0)
writer.tag(1, WireType.Varint).uint32(message.id);
/* string content = 2; */
if (message.content !== "")
writer.tag(2, WireType.LengthDelimited).string(message.content);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message DocumentService.UpdateDocumentBlockRequest
*/
export const UpdateDocumentBlockRequest = new UpdateDocumentBlockRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteDocumentBlockRequest$Type extends MessageType<DeleteDocumentBlockRequest> {
constructor() {
super("DocumentService.DeleteDocumentBlockRequest", [
{ no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
]);
}
create(value?: PartialMessage<DeleteDocumentBlockRequest>): DeleteDocumentBlockRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.id = 0;
if (value !== undefined)
reflectionMergePartial<DeleteDocumentBlockRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteDocumentBlockRequest): DeleteDocumentBlockRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* uint32 id */ 1:
message.id = reader.uint32();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message: DeleteDocumentBlockRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* uint32 id = 1; */
if (message.id !== 0)
writer.tag(1, WireType.Varint).uint32(message.id);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message DocumentService.DeleteDocumentBlockRequest
*/
export const DeleteDocumentBlockRequest = new DeleteDocumentBlockRequest$Type();
/**
* @generated ServiceType for protobuf service DocumentService.DocumentService
*/
@ -1098,6 +1656,10 @@ export const DocumentService = new ServiceType("DocumentService.DocumentService"
{ name: "GetDocument", options: {}, I: GetDocumentRequest, O: Document },
{ name: "UpdateDocument", options: {}, I: UpdateDocumentRequest, O: Document },
{ name: "DeleteDocument", options: {}, I: DeleteDocumentRequest, O: Empty },
{ name: "VectorSearchByTextInDocument", options: {}, I: VectorSearchByTextInDocumentRequest, O: DocumentChunkList },
{ name: "TestStream", serverStreaming: true, options: {}, I: Empty, O: TestStreamResponse }
{ name: "VectorSearchByTextInDocument", options: {}, I: VectorSearchByTextInDocumentRequest, O: DocumentBlockList },
{ name: "CreateDocumentBlock", options: {}, I: CreateDocumentBlockRequest, O: DocumentBlock },
{ name: "GetBlock", options: {}, I: GetDocumentBlockRequest, O: DocumentBlock },
{ name: "GetDocumentBlocks", options: {}, I: GetDocumentBlocksRequest, O: DocumentBlockList },
{ name: "DeleteBlock", options: {}, I: DeleteDocumentBlockRequest, O: Empty },
{ name: "UpdateBlock", options: {}, I: UpdateDocumentBlockRequest, O: DocumentBlock }
]);

View File

@ -1,27 +1,27 @@
// @generated by protobuf-ts 2.9.4 with parameter generate_dependencies
// @generated from protobuf file "proto/library/library.proto" (package "LibraryService", syntax proto3)
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import { LibraryService } from "./library";
import type { VectorChunkSearchByTextFromLibraryResponse } from "./library";
import type { VectorChunkSearchByTextFromLibraryRequest } from "./library";
import type { DocumentTextSearchFromLibraryResponse } from "./library";
import type { DocumentTextSearchFromLibraryRequest } from "./library";
import type { DocumentVectorSearchByTextFromLibraryResponse } from "./library";
import type { DocumentVectorSearchByTextFromLibraryRequest } from "./library";
import type { DeleteLibraryRequest } from "./library";
import type { UpdateLibraryResponse } from "./library";
import type { UpdateLibraryRequest } from "./library";
import type { GetLibraryResponse } from "./library";
import type { GetLibraryRequest } from "./library";
import type { Library } from "./library";
import type { CreateLibraryRequest } from "./library";
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { LibraryList } from "./library";
import type { ListLibrariesRequest } from "./library";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
import type {RpcOptions, RpcTransport, ServiceInfo, UnaryCall} from "@protobuf-ts/runtime-rpc";
import {stackIntercept} from "@protobuf-ts/runtime-rpc";
import type {
CreateLibraryRequest,
DeleteLibraryRequest,
DocumentTextSearchFromLibraryRequest,
DocumentTextSearchFromLibraryResponse,
DocumentVectorSearchByTextFromLibraryRequest,
DocumentVectorSearchByTextFromLibraryResponse,
GetLibraryRequest,
GetLibraryResponse,
Library,
LibraryList,
ListLibrariesRequest,
UpdateLibraryRequest,
UpdateLibraryResponse,
VectorSearchByTextFromLibraryRequest,
VectorSearchByTextFromLibraryResponse
} from "./library";
import {LibraryService} from "./library";
/**
* @generated from protobuf service LibraryService.LibraryService
*/
@ -55,9 +55,9 @@ export interface ILibraryServiceClient {
*/
documentTextSearchFromLibrary(input: DocumentTextSearchFromLibraryRequest, options?: RpcOptions): UnaryCall<DocumentTextSearchFromLibraryRequest, DocumentTextSearchFromLibraryResponse>;
/**
* @generated from protobuf rpc: VectorChunkSearchByTextFromLibrary(LibraryService.VectorChunkSearchByTextFromLibraryRequest) returns (LibraryService.VectorChunkSearchByTextFromLibraryResponse);
* @generated from protobuf rpc: VectorSearchByTextFromLibrary(LibraryService.VectorSearchByTextFromLibraryRequest) returns (LibraryService.VectorSearchByTextFromLibraryResponse);
*/
vectorChunkSearchByTextFromLibrary(input: VectorChunkSearchByTextFromLibraryRequest, options?: RpcOptions): UnaryCall<VectorChunkSearchByTextFromLibraryRequest, VectorChunkSearchByTextFromLibraryResponse>;
vectorSearchByTextFromLibrary(input: VectorSearchByTextFromLibraryRequest, options?: RpcOptions): UnaryCall<VectorSearchByTextFromLibraryRequest, VectorSearchByTextFromLibraryResponse>;
}
/**
* @generated from protobuf service LibraryService.LibraryService
@ -118,10 +118,10 @@ export class LibraryServiceClient implements ILibraryServiceClient, ServiceInfo
return stackIntercept<DocumentTextSearchFromLibraryRequest, DocumentTextSearchFromLibraryResponse>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: VectorChunkSearchByTextFromLibrary(LibraryService.VectorChunkSearchByTextFromLibraryRequest) returns (LibraryService.VectorChunkSearchByTextFromLibraryResponse);
* @generated from protobuf rpc: VectorSearchByTextFromLibrary(LibraryService.VectorSearchByTextFromLibraryRequest) returns (LibraryService.VectorSearchByTextFromLibraryResponse);
*/
vectorChunkSearchByTextFromLibrary(input: VectorChunkSearchByTextFromLibraryRequest, options?: RpcOptions): UnaryCall<VectorChunkSearchByTextFromLibraryRequest, VectorChunkSearchByTextFromLibraryResponse> {
vectorSearchByTextFromLibrary(input: VectorSearchByTextFromLibraryRequest, options?: RpcOptions): UnaryCall<VectorSearchByTextFromLibraryRequest, VectorSearchByTextFromLibraryResponse> {
const method = this.methods[7], opt = this._transport.mergeOptions(options);
return stackIntercept<VectorChunkSearchByTextFromLibraryRequest, VectorChunkSearchByTextFromLibraryResponse>("unary", this._transport, method, opt, input);
return stackIntercept<VectorSearchByTextFromLibraryRequest, VectorSearchByTextFromLibraryResponse>("unary", this._transport, method, opt, input);
}
}

View File

@ -1,17 +1,17 @@
// @generated by protobuf-ts 2.9.4 with parameter generate_dependencies
// @generated from protobuf file "proto/library/library.proto" (package "LibraryService", syntax proto3)
// tslint:disable
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { DocumentList } from "../document/document";
import {ServiceType} from "@protobuf-ts/runtime-rpc";
import type {
BinaryReadOptions,
BinaryWriteOptions,
IBinaryReader,
IBinaryWriter,
PartialMessage
} from "@protobuf-ts/runtime";
import {MessageType, reflectionMergePartial, UnknownFieldHandler, WireType} from "@protobuf-ts/runtime";
import {DocumentList} from "../document/document";
/**
* @generated from protobuf message LibraryService.Library
*/
@ -206,9 +206,9 @@ export interface DocumentTextSearchFromLibraryResponse {
total: bigint;
}
/**
* @generated from protobuf message LibraryService.VectorChunkSearchByTextFromLibraryRequest
* @generated from protobuf message LibraryService.VectorSearchByTextFromLibraryRequest
*/
export interface VectorChunkSearchByTextFromLibraryRequest {
export interface VectorSearchByTextFromLibraryRequest {
/**
* @generated from protobuf field: string query = 1;
*/
@ -219,18 +219,18 @@ export interface VectorChunkSearchByTextFromLibraryRequest {
libraryId: number;
}
/**
* @generated from protobuf message LibraryService.VectorChunkSearchByTextFromLibraryResponse
* @generated from protobuf message LibraryService.VectorSearchByTextFromLibraryResponse
*/
export interface VectorChunkSearchByTextFromLibraryResponse {
export interface VectorSearchByTextFromLibraryResponse {
/**
* @generated from protobuf field: repeated LibraryService.DocumentChunkList hits = 1;
* @generated from protobuf field: repeated LibraryService.DocumentBlockList hits = 1;
*/
hits: DocumentChunkList[];
hits: DocumentBlockList[];
}
/**
* @generated from protobuf message LibraryService.DocumentChunkList
* @generated from protobuf message LibraryService.DocumentBlockList
*/
export interface DocumentChunkList {
export interface DocumentBlockList {
/**
* @generated from protobuf field: string content = 1;
*/
@ -243,6 +243,10 @@ export interface DocumentChunkList {
* @generated from protobuf field: uint32 library_id = 3;
*/
libraryId: number;
/**
* @generated from protobuf field: uint32 block_id = 4;
*/
blockId: number;
}
/**
* @generated from protobuf enum LibraryService.LibraryAccessibility
@ -1017,22 +1021,22 @@ class DocumentTextSearchFromLibraryResponse$Type extends MessageType<DocumentTex
*/
export const DocumentTextSearchFromLibraryResponse = new DocumentTextSearchFromLibraryResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class VectorChunkSearchByTextFromLibraryRequest$Type extends MessageType<VectorChunkSearchByTextFromLibraryRequest> {
class VectorSearchByTextFromLibraryRequest$Type extends MessageType<VectorSearchByTextFromLibraryRequest> {
constructor() {
super("LibraryService.VectorChunkSearchByTextFromLibraryRequest", [
super("LibraryService.VectorSearchByTextFromLibraryRequest", [
{ no: 1, name: "query", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "library_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
]);
}
create(value?: PartialMessage<VectorChunkSearchByTextFromLibraryRequest>): VectorChunkSearchByTextFromLibraryRequest {
create(value?: PartialMessage<VectorSearchByTextFromLibraryRequest>): VectorSearchByTextFromLibraryRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.query = "";
message.libraryId = 0;
if (value !== undefined)
reflectionMergePartial<VectorChunkSearchByTextFromLibraryRequest>(this, message, value);
reflectionMergePartial<VectorSearchByTextFromLibraryRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VectorChunkSearchByTextFromLibraryRequest): VectorChunkSearchByTextFromLibraryRequest {
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VectorSearchByTextFromLibraryRequest): VectorSearchByTextFromLibraryRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
@ -1054,7 +1058,7 @@ class VectorChunkSearchByTextFromLibraryRequest$Type extends MessageType<VectorC
}
return message;
}
internalBinaryWrite(message: VectorChunkSearchByTextFromLibraryRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
internalBinaryWrite(message: VectorSearchByTextFromLibraryRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string query = 1; */
if (message.query !== "")
writer.tag(1, WireType.LengthDelimited).string(message.query);
@ -1068,30 +1072,30 @@ class VectorChunkSearchByTextFromLibraryRequest$Type extends MessageType<VectorC
}
}
/**
* @generated MessageType for protobuf message LibraryService.VectorChunkSearchByTextFromLibraryRequest
* @generated MessageType for protobuf message LibraryService.VectorSearchByTextFromLibraryRequest
*/
export const VectorChunkSearchByTextFromLibraryRequest = new VectorChunkSearchByTextFromLibraryRequest$Type();
export const VectorSearchByTextFromLibraryRequest = new VectorSearchByTextFromLibraryRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class VectorChunkSearchByTextFromLibraryResponse$Type extends MessageType<VectorChunkSearchByTextFromLibraryResponse> {
class VectorSearchByTextFromLibraryResponse$Type extends MessageType<VectorSearchByTextFromLibraryResponse> {
constructor() {
super("LibraryService.VectorChunkSearchByTextFromLibraryResponse", [
{ no: 1, name: "hits", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => DocumentChunkList }
super("LibraryService.VectorSearchByTextFromLibraryResponse", [
{ no: 1, name: "hits", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => DocumentBlockList }
]);
}
create(value?: PartialMessage<VectorChunkSearchByTextFromLibraryResponse>): VectorChunkSearchByTextFromLibraryResponse {
create(value?: PartialMessage<VectorSearchByTextFromLibraryResponse>): VectorSearchByTextFromLibraryResponse {
const message = globalThis.Object.create((this.messagePrototype!));
message.hits = [];
if (value !== undefined)
reflectionMergePartial<VectorChunkSearchByTextFromLibraryResponse>(this, message, value);
reflectionMergePartial<VectorSearchByTextFromLibraryResponse>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VectorChunkSearchByTextFromLibraryResponse): VectorChunkSearchByTextFromLibraryResponse {
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VectorSearchByTextFromLibraryResponse): VectorSearchByTextFromLibraryResponse {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* repeated LibraryService.DocumentChunkList hits */ 1:
message.hits.push(DocumentChunkList.internalBinaryRead(reader, reader.uint32(), options));
case /* repeated LibraryService.DocumentBlockList hits */ 1:
message.hits.push(DocumentBlockList.internalBinaryRead(reader, reader.uint32(), options));
break;
default:
let u = options.readUnknownField;
@ -1104,10 +1108,10 @@ class VectorChunkSearchByTextFromLibraryResponse$Type extends MessageType<Vector
}
return message;
}
internalBinaryWrite(message: VectorChunkSearchByTextFromLibraryResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* repeated LibraryService.DocumentChunkList hits = 1; */
internalBinaryWrite(message: VectorSearchByTextFromLibraryResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* repeated LibraryService.DocumentBlockList hits = 1; */
for (let i = 0; i < message.hits.length; i++)
DocumentChunkList.internalBinaryWrite(message.hits[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
DocumentBlockList.internalBinaryWrite(message.hits[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@ -1115,28 +1119,30 @@ class VectorChunkSearchByTextFromLibraryResponse$Type extends MessageType<Vector
}
}
/**
* @generated MessageType for protobuf message LibraryService.VectorChunkSearchByTextFromLibraryResponse
* @generated MessageType for protobuf message LibraryService.VectorSearchByTextFromLibraryResponse
*/
export const VectorChunkSearchByTextFromLibraryResponse = new VectorChunkSearchByTextFromLibraryResponse$Type();
export const VectorSearchByTextFromLibraryResponse = new VectorSearchByTextFromLibraryResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DocumentChunkList$Type extends MessageType<DocumentChunkList> {
class DocumentBlockList$Type extends MessageType<DocumentBlockList> {
constructor() {
super("LibraryService.DocumentChunkList", [
super("LibraryService.DocumentBlockList", [
{ no: 1, name: "content", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "document_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 3, name: "library_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
{ no: 3, name: "library_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 4, name: "block_id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
]);
}
create(value?: PartialMessage<DocumentChunkList>): DocumentChunkList {
create(value?: PartialMessage<DocumentBlockList>): DocumentBlockList {
const message = globalThis.Object.create((this.messagePrototype!));
message.content = "";
message.documentId = 0;
message.libraryId = 0;
message.blockId = 0;
if (value !== undefined)
reflectionMergePartial<DocumentChunkList>(this, message, value);
reflectionMergePartial<DocumentBlockList>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DocumentChunkList): DocumentChunkList {
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DocumentBlockList): DocumentBlockList {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
@ -1150,6 +1156,9 @@ class DocumentChunkList$Type extends MessageType<DocumentChunkList> {
case /* uint32 library_id */ 3:
message.libraryId = reader.uint32();
break;
case /* uint32 block_id */ 4:
message.blockId = reader.uint32();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
@ -1161,7 +1170,7 @@ class DocumentChunkList$Type extends MessageType<DocumentChunkList> {
}
return message;
}
internalBinaryWrite(message: DocumentChunkList, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
internalBinaryWrite(message: DocumentBlockList, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string content = 1; */
if (message.content !== "")
writer.tag(1, WireType.LengthDelimited).string(message.content);
@ -1171,6 +1180,9 @@ class DocumentChunkList$Type extends MessageType<DocumentChunkList> {
/* uint32 library_id = 3; */
if (message.libraryId !== 0)
writer.tag(3, WireType.Varint).uint32(message.libraryId);
/* uint32 block_id = 4; */
if (message.blockId !== 0)
writer.tag(4, WireType.Varint).uint32(message.blockId);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@ -1178,9 +1190,9 @@ class DocumentChunkList$Type extends MessageType<DocumentChunkList> {
}
}
/**
* @generated MessageType for protobuf message LibraryService.DocumentChunkList
* @generated MessageType for protobuf message LibraryService.DocumentBlockList
*/
export const DocumentChunkList = new DocumentChunkList$Type();
export const DocumentBlockList = new DocumentBlockList$Type();
/**
* @generated ServiceType for protobuf service LibraryService.LibraryService
*/
@ -1192,5 +1204,5 @@ export const LibraryService = new ServiceType("LibraryService.LibraryService", [
{ name: "DeleteLibrary", options: {}, I: DeleteLibraryRequest, O: Library },
{ name: "DocumentVectorSearchByTextFromLibrary", options: {}, I: DocumentVectorSearchByTextFromLibraryRequest, O: DocumentVectorSearchByTextFromLibraryResponse },
{ name: "DocumentTextSearchFromLibrary", options: {}, I: DocumentTextSearchFromLibraryRequest, O: DocumentTextSearchFromLibraryResponse },
{ name: "VectorChunkSearchByTextFromLibrary", options: {}, I: VectorChunkSearchByTextFromLibraryRequest, O: VectorChunkSearchByTextFromLibraryResponse }
{ name: "VectorSearchByTextFromLibrary", options: {}, I: VectorSearchByTextFromLibraryRequest, O: VectorSearchByTextFromLibraryResponse }
]);

View File

@ -29,6 +29,14 @@ const routes = [
},
component: () => import("@/views/libraries/List.vue"),
},
{
path: "/libraries/create",
name: "libraries.create",
meta: {
auth: true,
},
component: () => import("@/views/libraries/Create.vue"),
},
{
path: "/library/:LibraryId/documents",
name: "library.documents",

View File

@ -0,0 +1,44 @@
<template>
<div>
<h1>创建资料库</h1>
</div>
<div>
<v-text-field
v-model="libraryName"
hide-details="auto"
label="资料库名称"
></v-text-field>
</div>
<div class="mt-3">
<v-btn @click="create">新建</v-btn>
</div>
</template>
<script lang="ts" setup>
import {ref} from "vue"
import rpc from "@/plugins/rpc";
import * as libraryPb from "@/proto/library/library";
const libraryName = ref("")
const useRpc = rpc()
function create() {
let createLibrary: libraryPb.CreateLibraryRequest = {
name: libraryName.value,
description: "",
icon: "",
accessibility: 0
};
useRpc.libraryServiceClient.createLibrary(createLibrary).then((res) => {
console.log(res);
});
}
</script>