mirror of https://github.com/usememos/memos.git
chore: generate protobuf code for AI connection test
- Update generated Go protobuf files for new test connection endpoints - Add OpenAPI specifications for AI connection testing - Generate TypeScript types for frontend AI connection test functionality Signed-off-by: ChaoLiu <chaoliu719@gmail.com>
This commit is contained in:
parent
8fb7727fb8
commit
69f946844b
|
|
@ -1869,6 +1869,159 @@ func (x *DeleteMemoReactionRequest) GetName() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
type SuggestMemoTagsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// Required. The content of the memo for tag suggestion.
|
||||
Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
|
||||
// Optional. The existing tags for the memo.
|
||||
ExistingTags []string `protobuf:"bytes,2,rep,name=existing_tags,json=existingTags,proto3" json:"existing_tags,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SuggestMemoTagsRequest) Reset() {
|
||||
*x = SuggestMemoTagsRequest{}
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[25]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SuggestMemoTagsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SuggestMemoTagsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SuggestMemoTagsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[25]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SuggestMemoTagsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SuggestMemoTagsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{25}
|
||||
}
|
||||
|
||||
func (x *SuggestMemoTagsRequest) GetContent() string {
|
||||
if x != nil {
|
||||
return x.Content
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SuggestMemoTagsRequest) GetExistingTags() []string {
|
||||
if x != nil {
|
||||
return x.ExistingTags
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type TagSuggestion struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// The suggested tag name.
|
||||
Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
|
||||
// The reason why this tag is recommended.
|
||||
Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TagSuggestion) Reset() {
|
||||
*x = TagSuggestion{}
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[26]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TagSuggestion) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TagSuggestion) ProtoMessage() {}
|
||||
|
||||
func (x *TagSuggestion) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[26]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TagSuggestion.ProtoReflect.Descriptor instead.
|
||||
func (*TagSuggestion) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{26}
|
||||
}
|
||||
|
||||
func (x *TagSuggestion) GetTag() string {
|
||||
if x != nil {
|
||||
return x.Tag
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TagSuggestion) GetReason() string {
|
||||
if x != nil {
|
||||
return x.Reason
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SuggestMemoTagsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// The suggested tags with reasons for the memo.
|
||||
SuggestedTags []*TagSuggestion `protobuf:"bytes,1,rep,name=suggested_tags,json=suggestedTags,proto3" json:"suggested_tags,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SuggestMemoTagsResponse) Reset() {
|
||||
*x = SuggestMemoTagsResponse{}
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[27]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SuggestMemoTagsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SuggestMemoTagsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SuggestMemoTagsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[27]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SuggestMemoTagsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SuggestMemoTagsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{27}
|
||||
}
|
||||
|
||||
func (x *SuggestMemoTagsResponse) GetSuggestedTags() []*TagSuggestion {
|
||||
if x != nil {
|
||||
return x.SuggestedTags
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Computed properties of a memo.
|
||||
type Memo_Property struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
|
|
@ -1882,7 +2035,7 @@ type Memo_Property struct {
|
|||
|
||||
func (x *Memo_Property) Reset() {
|
||||
*x = Memo_Property{}
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[25]
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[28]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
|
@ -1894,7 +2047,7 @@ func (x *Memo_Property) String() string {
|
|||
func (*Memo_Property) ProtoMessage() {}
|
||||
|
||||
func (x *Memo_Property) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[25]
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[28]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
|
|
@ -1952,7 +2105,7 @@ type MemoRelation_Memo struct {
|
|||
|
||||
func (x *MemoRelation_Memo) Reset() {
|
||||
*x = MemoRelation_Memo{}
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[26]
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[29]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
|
@ -1964,7 +2117,7 @@ func (x *MemoRelation_Memo) String() string {
|
|||
func (*MemoRelation_Memo) ProtoMessage() {}
|
||||
|
||||
func (x *MemoRelation_Memo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[26]
|
||||
mi := &file_api_v1_memo_service_proto_msgTypes[29]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
|
|
@ -2167,14 +2320,22 @@ const file_api_v1_memo_service_proto_rawDesc = "" +
|
|||
"\breaction\x18\x02 \x01(\v2\x16.memos.api.v1.ReactionB\x03\xe0A\x02R\breaction\"N\n" +
|
||||
"\x19DeleteMemoReactionRequest\x121\n" +
|
||||
"\x04name\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\n" +
|
||||
"\x15memos.api.v1/ReactionR\x04name*P\n" +
|
||||
"\x15memos.api.v1/ReactionR\x04name\"a\n" +
|
||||
"\x16SuggestMemoTagsRequest\x12\x1d\n" +
|
||||
"\acontent\x18\x01 \x01(\tB\x03\xe0A\x02R\acontent\x12(\n" +
|
||||
"\rexisting_tags\x18\x02 \x03(\tB\x03\xe0A\x01R\fexistingTags\"C\n" +
|
||||
"\rTagSuggestion\x12\x15\n" +
|
||||
"\x03tag\x18\x01 \x01(\tB\x03\xe0A\x02R\x03tag\x12\x1b\n" +
|
||||
"\x06reason\x18\x02 \x01(\tB\x03\xe0A\x02R\x06reason\"]\n" +
|
||||
"\x17SuggestMemoTagsResponse\x12B\n" +
|
||||
"\x0esuggested_tags\x18\x01 \x03(\v2\x1b.memos.api.v1.TagSuggestionR\rsuggestedTags*P\n" +
|
||||
"\n" +
|
||||
"Visibility\x12\x1a\n" +
|
||||
"\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\v\n" +
|
||||
"\aPRIVATE\x10\x01\x12\r\n" +
|
||||
"\tPROTECTED\x10\x02\x12\n" +
|
||||
"\n" +
|
||||
"\x06PUBLIC\x10\x032\xef\x10\n" +
|
||||
"\x06PUBLIC\x10\x032\xf7\x11\n" +
|
||||
"\vMemoService\x12e\n" +
|
||||
"\n" +
|
||||
"CreateMemo\x12\x1f.memos.api.v1.CreateMemoRequest\x1a\x12.memos.api.v1.Memo\"\"\xdaA\x04memo\x82\xd3\xe4\x93\x02\x15:\x04memo\"\r/api/v1/memos\x12f\n" +
|
||||
|
|
@ -2195,7 +2356,8 @@ const file_api_v1_memo_service_proto_rawDesc = "" +
|
|||
"\x10ListMemoComments\x12%.memos.api.v1.ListMemoCommentsRequest\x1a&.memos.api.v1.ListMemoCommentsResponse\".\xdaA\x04name\x82\xd3\xe4\x93\x02!\x12\x1f/api/v1/{name=memos/*}/comments\x12\x95\x01\n" +
|
||||
"\x11ListMemoReactions\x12&.memos.api.v1.ListMemoReactionsRequest\x1a'.memos.api.v1.ListMemoReactionsResponse\"/\xdaA\x04name\x82\xd3\xe4\x93\x02\"\x12 /api/v1/{name=memos/*}/reactions\x12\x89\x01\n" +
|
||||
"\x12UpsertMemoReaction\x12'.memos.api.v1.UpsertMemoReactionRequest\x1a\x16.memos.api.v1.Reaction\"2\xdaA\x04name\x82\xd3\xe4\x93\x02%:\x01*\" /api/v1/{name=memos/*}/reactions\x12\x80\x01\n" +
|
||||
"\x12DeleteMemoReaction\x12'.memos.api.v1.DeleteMemoReactionRequest\x1a\x16.google.protobuf.Empty\")\xdaA\x04name\x82\xd3\xe4\x93\x02\x1c*\x1a/api/v1/{name=reactions/*}B\xa8\x01\n" +
|
||||
"\x12DeleteMemoReaction\x12'.memos.api.v1.DeleteMemoReactionRequest\x1a\x16.google.protobuf.Empty\")\xdaA\x04name\x82\xd3\xe4\x93\x02\x1c*\x1a/api/v1/{name=reactions/*}\x12\x85\x01\n" +
|
||||
"\x0fSuggestMemoTags\x12$.memos.api.v1.SuggestMemoTagsRequest\x1a%.memos.api.v1.SuggestMemoTagsResponse\"%\x82\xd3\xe4\x93\x02\x1f:\x01*\"\x1a/api/v1/memos:suggest-tagsB\xa8\x01\n" +
|
||||
"\x10com.memos.api.v1B\x10MemoServiceProtoP\x01Z0github.com/usememos/memos/proto/gen/api/v1;apiv1\xa2\x02\x03MAX\xaa\x02\fMemos.Api.V1\xca\x02\fMemos\\Api\\V1\xe2\x02\x18Memos\\Api\\V1\\GPBMetadata\xea\x02\x0eMemos::Api::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
|
|
@ -2211,7 +2373,7 @@ func file_api_v1_memo_service_proto_rawDescGZIP() []byte {
|
|||
}
|
||||
|
||||
var file_api_v1_memo_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_api_v1_memo_service_proto_msgTypes = make([]protoimpl.MessageInfo, 27)
|
||||
var file_api_v1_memo_service_proto_msgTypes = make([]protoimpl.MessageInfo, 30)
|
||||
var file_api_v1_memo_service_proto_goTypes = []any{
|
||||
(Visibility)(0), // 0: memos.api.v1.Visibility
|
||||
(MemoRelation_Type)(0), // 1: memos.api.v1.MemoRelation.Type
|
||||
|
|
@ -2240,38 +2402,41 @@ var file_api_v1_memo_service_proto_goTypes = []any{
|
|||
(*ListMemoReactionsResponse)(nil), // 24: memos.api.v1.ListMemoReactionsResponse
|
||||
(*UpsertMemoReactionRequest)(nil), // 25: memos.api.v1.UpsertMemoReactionRequest
|
||||
(*DeleteMemoReactionRequest)(nil), // 26: memos.api.v1.DeleteMemoReactionRequest
|
||||
(*Memo_Property)(nil), // 27: memos.api.v1.Memo.Property
|
||||
(*MemoRelation_Memo)(nil), // 28: memos.api.v1.MemoRelation.Memo
|
||||
(*timestamppb.Timestamp)(nil), // 29: google.protobuf.Timestamp
|
||||
(State)(0), // 30: memos.api.v1.State
|
||||
(*Node)(nil), // 31: memos.api.v1.Node
|
||||
(*Attachment)(nil), // 32: memos.api.v1.Attachment
|
||||
(*fieldmaskpb.FieldMask)(nil), // 33: google.protobuf.FieldMask
|
||||
(*emptypb.Empty)(nil), // 34: google.protobuf.Empty
|
||||
(*SuggestMemoTagsRequest)(nil), // 27: memos.api.v1.SuggestMemoTagsRequest
|
||||
(*TagSuggestion)(nil), // 28: memos.api.v1.TagSuggestion
|
||||
(*SuggestMemoTagsResponse)(nil), // 29: memos.api.v1.SuggestMemoTagsResponse
|
||||
(*Memo_Property)(nil), // 30: memos.api.v1.Memo.Property
|
||||
(*MemoRelation_Memo)(nil), // 31: memos.api.v1.MemoRelation.Memo
|
||||
(*timestamppb.Timestamp)(nil), // 32: google.protobuf.Timestamp
|
||||
(State)(0), // 33: memos.api.v1.State
|
||||
(*Node)(nil), // 34: memos.api.v1.Node
|
||||
(*Attachment)(nil), // 35: memos.api.v1.Attachment
|
||||
(*fieldmaskpb.FieldMask)(nil), // 36: google.protobuf.FieldMask
|
||||
(*emptypb.Empty)(nil), // 37: google.protobuf.Empty
|
||||
}
|
||||
var file_api_v1_memo_service_proto_depIdxs = []int32{
|
||||
29, // 0: memos.api.v1.Reaction.create_time:type_name -> google.protobuf.Timestamp
|
||||
30, // 1: memos.api.v1.Memo.state:type_name -> memos.api.v1.State
|
||||
29, // 2: memos.api.v1.Memo.create_time:type_name -> google.protobuf.Timestamp
|
||||
29, // 3: memos.api.v1.Memo.update_time:type_name -> google.protobuf.Timestamp
|
||||
29, // 4: memos.api.v1.Memo.display_time:type_name -> google.protobuf.Timestamp
|
||||
31, // 5: memos.api.v1.Memo.nodes:type_name -> memos.api.v1.Node
|
||||
32, // 0: memos.api.v1.Reaction.create_time:type_name -> google.protobuf.Timestamp
|
||||
33, // 1: memos.api.v1.Memo.state:type_name -> memos.api.v1.State
|
||||
32, // 2: memos.api.v1.Memo.create_time:type_name -> google.protobuf.Timestamp
|
||||
32, // 3: memos.api.v1.Memo.update_time:type_name -> google.protobuf.Timestamp
|
||||
32, // 4: memos.api.v1.Memo.display_time:type_name -> google.protobuf.Timestamp
|
||||
34, // 5: memos.api.v1.Memo.nodes:type_name -> memos.api.v1.Node
|
||||
0, // 6: memos.api.v1.Memo.visibility:type_name -> memos.api.v1.Visibility
|
||||
32, // 7: memos.api.v1.Memo.attachments:type_name -> memos.api.v1.Attachment
|
||||
35, // 7: memos.api.v1.Memo.attachments:type_name -> memos.api.v1.Attachment
|
||||
16, // 8: memos.api.v1.Memo.relations:type_name -> memos.api.v1.MemoRelation
|
||||
2, // 9: memos.api.v1.Memo.reactions:type_name -> memos.api.v1.Reaction
|
||||
27, // 10: memos.api.v1.Memo.property:type_name -> memos.api.v1.Memo.Property
|
||||
30, // 10: memos.api.v1.Memo.property:type_name -> memos.api.v1.Memo.Property
|
||||
4, // 11: memos.api.v1.Memo.location:type_name -> memos.api.v1.Location
|
||||
3, // 12: memos.api.v1.CreateMemoRequest.memo:type_name -> memos.api.v1.Memo
|
||||
30, // 13: memos.api.v1.ListMemosRequest.state:type_name -> memos.api.v1.State
|
||||
33, // 13: memos.api.v1.ListMemosRequest.state:type_name -> memos.api.v1.State
|
||||
3, // 14: memos.api.v1.ListMemosResponse.memos:type_name -> memos.api.v1.Memo
|
||||
33, // 15: memos.api.v1.GetMemoRequest.read_mask:type_name -> google.protobuf.FieldMask
|
||||
36, // 15: memos.api.v1.GetMemoRequest.read_mask:type_name -> google.protobuf.FieldMask
|
||||
3, // 16: memos.api.v1.UpdateMemoRequest.memo:type_name -> memos.api.v1.Memo
|
||||
33, // 17: memos.api.v1.UpdateMemoRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
32, // 18: memos.api.v1.SetMemoAttachmentsRequest.attachments:type_name -> memos.api.v1.Attachment
|
||||
32, // 19: memos.api.v1.ListMemoAttachmentsResponse.attachments:type_name -> memos.api.v1.Attachment
|
||||
28, // 20: memos.api.v1.MemoRelation.memo:type_name -> memos.api.v1.MemoRelation.Memo
|
||||
28, // 21: memos.api.v1.MemoRelation.related_memo:type_name -> memos.api.v1.MemoRelation.Memo
|
||||
36, // 17: memos.api.v1.UpdateMemoRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
35, // 18: memos.api.v1.SetMemoAttachmentsRequest.attachments:type_name -> memos.api.v1.Attachment
|
||||
35, // 19: memos.api.v1.ListMemoAttachmentsResponse.attachments:type_name -> memos.api.v1.Attachment
|
||||
31, // 20: memos.api.v1.MemoRelation.memo:type_name -> memos.api.v1.MemoRelation.Memo
|
||||
31, // 21: memos.api.v1.MemoRelation.related_memo:type_name -> memos.api.v1.MemoRelation.Memo
|
||||
1, // 22: memos.api.v1.MemoRelation.type:type_name -> memos.api.v1.MemoRelation.Type
|
||||
16, // 23: memos.api.v1.SetMemoRelationsRequest.relations:type_name -> memos.api.v1.MemoRelation
|
||||
16, // 24: memos.api.v1.ListMemoRelationsResponse.relations:type_name -> memos.api.v1.MemoRelation
|
||||
|
|
@ -2279,43 +2444,46 @@ var file_api_v1_memo_service_proto_depIdxs = []int32{
|
|||
3, // 26: memos.api.v1.ListMemoCommentsResponse.memos:type_name -> memos.api.v1.Memo
|
||||
2, // 27: memos.api.v1.ListMemoReactionsResponse.reactions:type_name -> memos.api.v1.Reaction
|
||||
2, // 28: memos.api.v1.UpsertMemoReactionRequest.reaction:type_name -> memos.api.v1.Reaction
|
||||
5, // 29: memos.api.v1.MemoService.CreateMemo:input_type -> memos.api.v1.CreateMemoRequest
|
||||
6, // 30: memos.api.v1.MemoService.ListMemos:input_type -> memos.api.v1.ListMemosRequest
|
||||
8, // 31: memos.api.v1.MemoService.GetMemo:input_type -> memos.api.v1.GetMemoRequest
|
||||
9, // 32: memos.api.v1.MemoService.UpdateMemo:input_type -> memos.api.v1.UpdateMemoRequest
|
||||
10, // 33: memos.api.v1.MemoService.DeleteMemo:input_type -> memos.api.v1.DeleteMemoRequest
|
||||
11, // 34: memos.api.v1.MemoService.RenameMemoTag:input_type -> memos.api.v1.RenameMemoTagRequest
|
||||
12, // 35: memos.api.v1.MemoService.DeleteMemoTag:input_type -> memos.api.v1.DeleteMemoTagRequest
|
||||
13, // 36: memos.api.v1.MemoService.SetMemoAttachments:input_type -> memos.api.v1.SetMemoAttachmentsRequest
|
||||
14, // 37: memos.api.v1.MemoService.ListMemoAttachments:input_type -> memos.api.v1.ListMemoAttachmentsRequest
|
||||
17, // 38: memos.api.v1.MemoService.SetMemoRelations:input_type -> memos.api.v1.SetMemoRelationsRequest
|
||||
18, // 39: memos.api.v1.MemoService.ListMemoRelations:input_type -> memos.api.v1.ListMemoRelationsRequest
|
||||
20, // 40: memos.api.v1.MemoService.CreateMemoComment:input_type -> memos.api.v1.CreateMemoCommentRequest
|
||||
21, // 41: memos.api.v1.MemoService.ListMemoComments:input_type -> memos.api.v1.ListMemoCommentsRequest
|
||||
23, // 42: memos.api.v1.MemoService.ListMemoReactions:input_type -> memos.api.v1.ListMemoReactionsRequest
|
||||
25, // 43: memos.api.v1.MemoService.UpsertMemoReaction:input_type -> memos.api.v1.UpsertMemoReactionRequest
|
||||
26, // 44: memos.api.v1.MemoService.DeleteMemoReaction:input_type -> memos.api.v1.DeleteMemoReactionRequest
|
||||
3, // 45: memos.api.v1.MemoService.CreateMemo:output_type -> memos.api.v1.Memo
|
||||
7, // 46: memos.api.v1.MemoService.ListMemos:output_type -> memos.api.v1.ListMemosResponse
|
||||
3, // 47: memos.api.v1.MemoService.GetMemo:output_type -> memos.api.v1.Memo
|
||||
3, // 48: memos.api.v1.MemoService.UpdateMemo:output_type -> memos.api.v1.Memo
|
||||
34, // 49: memos.api.v1.MemoService.DeleteMemo:output_type -> google.protobuf.Empty
|
||||
34, // 50: memos.api.v1.MemoService.RenameMemoTag:output_type -> google.protobuf.Empty
|
||||
34, // 51: memos.api.v1.MemoService.DeleteMemoTag:output_type -> google.protobuf.Empty
|
||||
34, // 52: memos.api.v1.MemoService.SetMemoAttachments:output_type -> google.protobuf.Empty
|
||||
15, // 53: memos.api.v1.MemoService.ListMemoAttachments:output_type -> memos.api.v1.ListMemoAttachmentsResponse
|
||||
34, // 54: memos.api.v1.MemoService.SetMemoRelations:output_type -> google.protobuf.Empty
|
||||
19, // 55: memos.api.v1.MemoService.ListMemoRelations:output_type -> memos.api.v1.ListMemoRelationsResponse
|
||||
3, // 56: memos.api.v1.MemoService.CreateMemoComment:output_type -> memos.api.v1.Memo
|
||||
22, // 57: memos.api.v1.MemoService.ListMemoComments:output_type -> memos.api.v1.ListMemoCommentsResponse
|
||||
24, // 58: memos.api.v1.MemoService.ListMemoReactions:output_type -> memos.api.v1.ListMemoReactionsResponse
|
||||
2, // 59: memos.api.v1.MemoService.UpsertMemoReaction:output_type -> memos.api.v1.Reaction
|
||||
34, // 60: memos.api.v1.MemoService.DeleteMemoReaction:output_type -> google.protobuf.Empty
|
||||
45, // [45:61] is the sub-list for method output_type
|
||||
29, // [29:45] is the sub-list for method input_type
|
||||
29, // [29:29] is the sub-list for extension type_name
|
||||
29, // [29:29] is the sub-list for extension extendee
|
||||
0, // [0:29] is the sub-list for field type_name
|
||||
28, // 29: memos.api.v1.SuggestMemoTagsResponse.suggested_tags:type_name -> memos.api.v1.TagSuggestion
|
||||
5, // 30: memos.api.v1.MemoService.CreateMemo:input_type -> memos.api.v1.CreateMemoRequest
|
||||
6, // 31: memos.api.v1.MemoService.ListMemos:input_type -> memos.api.v1.ListMemosRequest
|
||||
8, // 32: memos.api.v1.MemoService.GetMemo:input_type -> memos.api.v1.GetMemoRequest
|
||||
9, // 33: memos.api.v1.MemoService.UpdateMemo:input_type -> memos.api.v1.UpdateMemoRequest
|
||||
10, // 34: memos.api.v1.MemoService.DeleteMemo:input_type -> memos.api.v1.DeleteMemoRequest
|
||||
11, // 35: memos.api.v1.MemoService.RenameMemoTag:input_type -> memos.api.v1.RenameMemoTagRequest
|
||||
12, // 36: memos.api.v1.MemoService.DeleteMemoTag:input_type -> memos.api.v1.DeleteMemoTagRequest
|
||||
13, // 37: memos.api.v1.MemoService.SetMemoAttachments:input_type -> memos.api.v1.SetMemoAttachmentsRequest
|
||||
14, // 38: memos.api.v1.MemoService.ListMemoAttachments:input_type -> memos.api.v1.ListMemoAttachmentsRequest
|
||||
17, // 39: memos.api.v1.MemoService.SetMemoRelations:input_type -> memos.api.v1.SetMemoRelationsRequest
|
||||
18, // 40: memos.api.v1.MemoService.ListMemoRelations:input_type -> memos.api.v1.ListMemoRelationsRequest
|
||||
20, // 41: memos.api.v1.MemoService.CreateMemoComment:input_type -> memos.api.v1.CreateMemoCommentRequest
|
||||
21, // 42: memos.api.v1.MemoService.ListMemoComments:input_type -> memos.api.v1.ListMemoCommentsRequest
|
||||
23, // 43: memos.api.v1.MemoService.ListMemoReactions:input_type -> memos.api.v1.ListMemoReactionsRequest
|
||||
25, // 44: memos.api.v1.MemoService.UpsertMemoReaction:input_type -> memos.api.v1.UpsertMemoReactionRequest
|
||||
26, // 45: memos.api.v1.MemoService.DeleteMemoReaction:input_type -> memos.api.v1.DeleteMemoReactionRequest
|
||||
27, // 46: memos.api.v1.MemoService.SuggestMemoTags:input_type -> memos.api.v1.SuggestMemoTagsRequest
|
||||
3, // 47: memos.api.v1.MemoService.CreateMemo:output_type -> memos.api.v1.Memo
|
||||
7, // 48: memos.api.v1.MemoService.ListMemos:output_type -> memos.api.v1.ListMemosResponse
|
||||
3, // 49: memos.api.v1.MemoService.GetMemo:output_type -> memos.api.v1.Memo
|
||||
3, // 50: memos.api.v1.MemoService.UpdateMemo:output_type -> memos.api.v1.Memo
|
||||
37, // 51: memos.api.v1.MemoService.DeleteMemo:output_type -> google.protobuf.Empty
|
||||
37, // 52: memos.api.v1.MemoService.RenameMemoTag:output_type -> google.protobuf.Empty
|
||||
37, // 53: memos.api.v1.MemoService.DeleteMemoTag:output_type -> google.protobuf.Empty
|
||||
37, // 54: memos.api.v1.MemoService.SetMemoAttachments:output_type -> google.protobuf.Empty
|
||||
15, // 55: memos.api.v1.MemoService.ListMemoAttachments:output_type -> memos.api.v1.ListMemoAttachmentsResponse
|
||||
37, // 56: memos.api.v1.MemoService.SetMemoRelations:output_type -> google.protobuf.Empty
|
||||
19, // 57: memos.api.v1.MemoService.ListMemoRelations:output_type -> memos.api.v1.ListMemoRelationsResponse
|
||||
3, // 58: memos.api.v1.MemoService.CreateMemoComment:output_type -> memos.api.v1.Memo
|
||||
22, // 59: memos.api.v1.MemoService.ListMemoComments:output_type -> memos.api.v1.ListMemoCommentsResponse
|
||||
24, // 60: memos.api.v1.MemoService.ListMemoReactions:output_type -> memos.api.v1.ListMemoReactionsResponse
|
||||
2, // 61: memos.api.v1.MemoService.UpsertMemoReaction:output_type -> memos.api.v1.Reaction
|
||||
37, // 62: memos.api.v1.MemoService.DeleteMemoReaction:output_type -> google.protobuf.Empty
|
||||
29, // 63: memos.api.v1.MemoService.SuggestMemoTags:output_type -> memos.api.v1.SuggestMemoTagsResponse
|
||||
47, // [47:64] is the sub-list for method output_type
|
||||
30, // [30:47] is the sub-list for method input_type
|
||||
30, // [30:30] is the sub-list for extension type_name
|
||||
30, // [30:30] is the sub-list for extension extendee
|
||||
0, // [0:30] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_v1_memo_service_proto_init() }
|
||||
|
|
@ -2333,7 +2501,7 @@ func file_api_v1_memo_service_proto_init() {
|
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_memo_service_proto_rawDesc), len(file_api_v1_memo_service_proto_rawDesc)),
|
||||
NumEnums: 2,
|
||||
NumMessages: 27,
|
||||
NumMessages: 30,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -833,6 +833,33 @@ func local_request_MemoService_DeleteMemoReaction_0(ctx context.Context, marshal
|
|||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func request_MemoService_SuggestMemoTags_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq SuggestMemoTagsRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
msg, err := client.SuggestMemoTags(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func local_request_MemoService_SuggestMemoTags_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq SuggestMemoTagsRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
msg, err := server.SuggestMemoTags(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
// RegisterMemoServiceHandlerServer registers the http handlers for service MemoService to "mux".
|
||||
// UnaryRPC :call MemoServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
|
|
@ -1159,6 +1186,26 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
|
|||
}
|
||||
forward_MemoService_DeleteMemoReaction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodPost, pattern_MemoService_SuggestMemoTags_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.MemoService/SuggestMemoTags", runtime.WithHTTPPathPattern("/api/v1/memos:suggest-tags"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_MemoService_SuggestMemoTags_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_MemoService_SuggestMemoTags_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1471,6 +1518,23 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
|
|||
}
|
||||
forward_MemoService_DeleteMemoReaction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodPost, pattern_MemoService_SuggestMemoTags_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.MemoService/SuggestMemoTags", runtime.WithHTTPPathPattern("/api/v1/memos:suggest-tags"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_MemoService_SuggestMemoTags_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_MemoService_SuggestMemoTags_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -1491,6 +1555,7 @@ var (
|
|||
pattern_MemoService_ListMemoReactions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v1", "memos", "name", "reactions"}, ""))
|
||||
pattern_MemoService_UpsertMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v1", "memos", "name", "reactions"}, ""))
|
||||
pattern_MemoService_DeleteMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "reactions", "name"}, ""))
|
||||
pattern_MemoService_SuggestMemoTags_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "memos"}, "suggest-tags"))
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -1510,4 +1575,5 @@ var (
|
|||
forward_MemoService_ListMemoReactions_0 = runtime.ForwardResponseMessage
|
||||
forward_MemoService_UpsertMemoReaction_0 = runtime.ForwardResponseMessage
|
||||
forward_MemoService_DeleteMemoReaction_0 = runtime.ForwardResponseMessage
|
||||
forward_MemoService_SuggestMemoTags_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ const (
|
|||
MemoService_ListMemoReactions_FullMethodName = "/memos.api.v1.MemoService/ListMemoReactions"
|
||||
MemoService_UpsertMemoReaction_FullMethodName = "/memos.api.v1.MemoService/UpsertMemoReaction"
|
||||
MemoService_DeleteMemoReaction_FullMethodName = "/memos.api.v1.MemoService/DeleteMemoReaction"
|
||||
MemoService_SuggestMemoTags_FullMethodName = "/memos.api.v1.MemoService/SuggestMemoTags"
|
||||
)
|
||||
|
||||
// MemoServiceClient is the client API for MemoService service.
|
||||
|
|
@ -74,6 +75,8 @@ type MemoServiceClient interface {
|
|||
UpsertMemoReaction(ctx context.Context, in *UpsertMemoReactionRequest, opts ...grpc.CallOption) (*Reaction, error)
|
||||
// DeleteMemoReaction deletes a reaction for a memo.
|
||||
DeleteMemoReaction(ctx context.Context, in *DeleteMemoReactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// SuggestMemoTags suggests tags for memo content.
|
||||
SuggestMemoTags(ctx context.Context, in *SuggestMemoTagsRequest, opts ...grpc.CallOption) (*SuggestMemoTagsResponse, error)
|
||||
}
|
||||
|
||||
type memoServiceClient struct {
|
||||
|
|
@ -244,6 +247,16 @@ func (c *memoServiceClient) DeleteMemoReaction(ctx context.Context, in *DeleteMe
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) SuggestMemoTags(ctx context.Context, in *SuggestMemoTagsRequest, opts ...grpc.CallOption) (*SuggestMemoTagsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SuggestMemoTagsResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_SuggestMemoTags_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MemoServiceServer is the server API for MemoService service.
|
||||
// All implementations must embed UnimplementedMemoServiceServer
|
||||
// for forward compatibility.
|
||||
|
|
@ -280,6 +293,8 @@ type MemoServiceServer interface {
|
|||
UpsertMemoReaction(context.Context, *UpsertMemoReactionRequest) (*Reaction, error)
|
||||
// DeleteMemoReaction deletes a reaction for a memo.
|
||||
DeleteMemoReaction(context.Context, *DeleteMemoReactionRequest) (*emptypb.Empty, error)
|
||||
// SuggestMemoTags suggests tags for memo content.
|
||||
SuggestMemoTags(context.Context, *SuggestMemoTagsRequest) (*SuggestMemoTagsResponse, error)
|
||||
mustEmbedUnimplementedMemoServiceServer()
|
||||
}
|
||||
|
||||
|
|
@ -338,6 +353,9 @@ func (UnimplementedMemoServiceServer) UpsertMemoReaction(context.Context, *Upser
|
|||
func (UnimplementedMemoServiceServer) DeleteMemoReaction(context.Context, *DeleteMemoReactionRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteMemoReaction not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) SuggestMemoTags(context.Context, *SuggestMemoTagsRequest) (*SuggestMemoTagsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SuggestMemoTags not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) mustEmbedUnimplementedMemoServiceServer() {}
|
||||
func (UnimplementedMemoServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
|
|
@ -647,6 +665,24 @@ func _MemoService_DeleteMemoReaction_Handler(srv interface{}, ctx context.Contex
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_SuggestMemoTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SuggestMemoTagsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).SuggestMemoTags(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_SuggestMemoTags_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).SuggestMemoTags(ctx, req.(*SuggestMemoTagsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// MemoService_ServiceDesc is the grpc.ServiceDesc for MemoService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
|
|
@ -718,6 +754,10 @@ var MemoService_ServiceDesc = grpc.ServiceDesc{
|
|||
MethodName: "DeleteMemoReaction",
|
||||
Handler: _MemoService_DeleteMemoReaction_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SuggestMemoTags",
|
||||
Handler: _MemoService_SuggestMemoTags_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/v1/memo_service.proto",
|
||||
|
|
|
|||
|
|
@ -477,6 +477,226 @@ func (x *UpdateWorkspaceSettingRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Request message for GetDefaultTagRecommendationPrompt method.
|
||||
type GetDefaultTagRecommendationPromptRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetDefaultTagRecommendationPromptRequest) Reset() {
|
||||
*x = GetDefaultTagRecommendationPromptRequest{}
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetDefaultTagRecommendationPromptRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetDefaultTagRecommendationPromptRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetDefaultTagRecommendationPromptRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetDefaultTagRecommendationPromptRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetDefaultTagRecommendationPromptRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
// Response message for GetDefaultTagRecommendationPrompt method.
|
||||
type GetDefaultTagRecommendationPromptResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// The default system prompt for tag recommendation.
|
||||
SystemPrompt string `protobuf:"bytes,1,opt,name=system_prompt,json=systemPrompt,proto3" json:"system_prompt,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetDefaultTagRecommendationPromptResponse) Reset() {
|
||||
*x = GetDefaultTagRecommendationPromptResponse{}
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetDefaultTagRecommendationPromptResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetDefaultTagRecommendationPromptResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetDefaultTagRecommendationPromptResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetDefaultTagRecommendationPromptResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetDefaultTagRecommendationPromptResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *GetDefaultTagRecommendationPromptResponse) GetSystemPrompt() string {
|
||||
if x != nil {
|
||||
return x.SystemPrompt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Request message for TestAiConnection method.
|
||||
type TestAiConnectionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// base_url is the base URL for AI API.
|
||||
BaseUrl string `protobuf:"bytes,1,opt,name=base_url,json=baseUrl,proto3" json:"base_url,omitempty"`
|
||||
// api_key is the API key for AI service.
|
||||
ApiKey string `protobuf:"bytes,2,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"`
|
||||
// model is the AI model to use.
|
||||
Model string `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"`
|
||||
// timeout_seconds is the timeout for AI requests in seconds.
|
||||
TimeoutSeconds int32 `protobuf:"varint,4,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TestAiConnectionRequest) Reset() {
|
||||
*x = TestAiConnectionRequest{}
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TestAiConnectionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TestAiConnectionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *TestAiConnectionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[7]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TestAiConnectionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*TestAiConnectionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *TestAiConnectionRequest) GetBaseUrl() string {
|
||||
if x != nil {
|
||||
return x.BaseUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TestAiConnectionRequest) GetApiKey() string {
|
||||
if x != nil {
|
||||
return x.ApiKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TestAiConnectionRequest) GetModel() string {
|
||||
if x != nil {
|
||||
return x.Model
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TestAiConnectionRequest) GetTimeoutSeconds() int32 {
|
||||
if x != nil {
|
||||
return x.TimeoutSeconds
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Response message for TestAiConnection method.
|
||||
type TestAiConnectionResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// success indicates whether the connection test was successful.
|
||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||
// message provides additional information about the test result.
|
||||
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
||||
// model_info contains information about the tested model (if successful).
|
||||
ModelInfo string `protobuf:"bytes,3,opt,name=model_info,json=modelInfo,proto3" json:"model_info,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TestAiConnectionResponse) Reset() {
|
||||
*x = TestAiConnectionResponse{}
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TestAiConnectionResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TestAiConnectionResponse) ProtoMessage() {}
|
||||
|
||||
func (x *TestAiConnectionResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TestAiConnectionResponse.ProtoReflect.Descriptor instead.
|
||||
func (*TestAiConnectionResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *TestAiConnectionResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *TestAiConnectionResponse) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TestAiConnectionResponse) GetModelInfo() string {
|
||||
if x != nil {
|
||||
return x.ModelInfo
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// General workspace settings configuration.
|
||||
type WorkspaceSetting_GeneralSetting struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
|
|
@ -507,7 +727,7 @@ type WorkspaceSetting_GeneralSetting struct {
|
|||
|
||||
func (x *WorkspaceSetting_GeneralSetting) Reset() {
|
||||
*x = WorkspaceSetting_GeneralSetting{}
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[5]
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
|
@ -519,7 +739,7 @@ func (x *WorkspaceSetting_GeneralSetting) String() string {
|
|||
func (*WorkspaceSetting_GeneralSetting) ProtoMessage() {}
|
||||
|
||||
func (x *WorkspaceSetting_GeneralSetting) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[5]
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[9]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
|
|
@ -616,7 +836,7 @@ type WorkspaceSetting_StorageSetting struct {
|
|||
|
||||
func (x *WorkspaceSetting_StorageSetting) Reset() {
|
||||
*x = WorkspaceSetting_StorageSetting{}
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[6]
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
|
@ -628,7 +848,7 @@ func (x *WorkspaceSetting_StorageSetting) String() string {
|
|||
func (*WorkspaceSetting_StorageSetting) ProtoMessage() {}
|
||||
|
||||
func (x *WorkspaceSetting_StorageSetting) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[6]
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[10]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
|
|
@ -699,7 +919,7 @@ type WorkspaceSetting_MemoRelatedSetting struct {
|
|||
|
||||
func (x *WorkspaceSetting_MemoRelatedSetting) Reset() {
|
||||
*x = WorkspaceSetting_MemoRelatedSetting{}
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[7]
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[11]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
|
@ -711,7 +931,7 @@ func (x *WorkspaceSetting_MemoRelatedSetting) String() string {
|
|||
func (*WorkspaceSetting_MemoRelatedSetting) ProtoMessage() {}
|
||||
|
||||
func (x *WorkspaceSetting_MemoRelatedSetting) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[7]
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[11]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
|
|
@ -803,13 +1023,15 @@ type WorkspaceSetting_AiSetting struct {
|
|||
Model string `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"`
|
||||
// timeout_seconds is the timeout for AI requests in seconds.
|
||||
TimeoutSeconds int32 `protobuf:"varint,5,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
// tag_recommendation contains tag recommendation specific settings.
|
||||
TagRecommendation *WorkspaceSetting_TagRecommendationConfig `protobuf:"bytes,6,opt,name=tag_recommendation,json=tagRecommendation,proto3" json:"tag_recommendation,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *WorkspaceSetting_AiSetting) Reset() {
|
||||
*x = WorkspaceSetting_AiSetting{}
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[8]
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[12]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
|
@ -821,7 +1043,7 @@ func (x *WorkspaceSetting_AiSetting) String() string {
|
|||
func (*WorkspaceSetting_AiSetting) ProtoMessage() {}
|
||||
|
||||
func (x *WorkspaceSetting_AiSetting) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[8]
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[12]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
|
|
@ -872,6 +1094,77 @@ func (x *WorkspaceSetting_AiSetting) GetTimeoutSeconds() int32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (x *WorkspaceSetting_AiSetting) GetTagRecommendation() *WorkspaceSetting_TagRecommendationConfig {
|
||||
if x != nil {
|
||||
return x.TagRecommendation
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Tag recommendation configuration.
|
||||
type WorkspaceSetting_TagRecommendationConfig struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// enabled controls whether tag recommendation is enabled.
|
||||
Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
// system_prompt is the custom system prompt for tag recommendation.
|
||||
SystemPrompt string `protobuf:"bytes,2,opt,name=system_prompt,json=systemPrompt,proto3" json:"system_prompt,omitempty"`
|
||||
// requests_per_minute is the rate limit for tag recommendation requests.
|
||||
RequestsPerMinute int32 `protobuf:"varint,3,opt,name=requests_per_minute,json=requestsPerMinute,proto3" json:"requests_per_minute,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *WorkspaceSetting_TagRecommendationConfig) Reset() {
|
||||
*x = WorkspaceSetting_TagRecommendationConfig{}
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[13]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *WorkspaceSetting_TagRecommendationConfig) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*WorkspaceSetting_TagRecommendationConfig) ProtoMessage() {}
|
||||
|
||||
func (x *WorkspaceSetting_TagRecommendationConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[13]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use WorkspaceSetting_TagRecommendationConfig.ProtoReflect.Descriptor instead.
|
||||
func (*WorkspaceSetting_TagRecommendationConfig) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{2, 4}
|
||||
}
|
||||
|
||||
func (x *WorkspaceSetting_TagRecommendationConfig) GetEnabled() bool {
|
||||
if x != nil {
|
||||
return x.Enabled
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *WorkspaceSetting_TagRecommendationConfig) GetSystemPrompt() string {
|
||||
if x != nil {
|
||||
return x.SystemPrompt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *WorkspaceSetting_TagRecommendationConfig) GetRequestsPerMinute() int32 {
|
||||
if x != nil {
|
||||
return x.RequestsPerMinute
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Custom profile configuration for workspace branding.
|
||||
type WorkspaceSetting_GeneralSetting_CustomProfile struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
|
|
@ -885,7 +1178,7 @@ type WorkspaceSetting_GeneralSetting_CustomProfile struct {
|
|||
|
||||
func (x *WorkspaceSetting_GeneralSetting_CustomProfile) Reset() {
|
||||
*x = WorkspaceSetting_GeneralSetting_CustomProfile{}
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[9]
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[14]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
|
@ -897,7 +1190,7 @@ func (x *WorkspaceSetting_GeneralSetting_CustomProfile) String() string {
|
|||
func (*WorkspaceSetting_GeneralSetting_CustomProfile) ProtoMessage() {}
|
||||
|
||||
func (x *WorkspaceSetting_GeneralSetting_CustomProfile) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[9]
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[14]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
|
|
@ -957,7 +1250,7 @@ type WorkspaceSetting_StorageSetting_S3Config struct {
|
|||
|
||||
func (x *WorkspaceSetting_StorageSetting_S3Config) Reset() {
|
||||
*x = WorkspaceSetting_StorageSetting_S3Config{}
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[10]
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[15]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
|
@ -969,7 +1262,7 @@ func (x *WorkspaceSetting_StorageSetting_S3Config) String() string {
|
|||
func (*WorkspaceSetting_StorageSetting_S3Config) ProtoMessage() {}
|
||||
|
||||
func (x *WorkspaceSetting_StorageSetting_S3Config) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[10]
|
||||
mi := &file_api_v1_workspace_service_proto_msgTypes[15]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
|
|
@ -1037,7 +1330,7 @@ const file_api_v1_workspace_service_proto_rawDesc = "" +
|
|||
"\aversion\x18\x02 \x01(\tR\aversion\x12\x12\n" +
|
||||
"\x04mode\x18\x03 \x01(\tR\x04mode\x12!\n" +
|
||||
"\finstance_url\x18\x06 \x01(\tR\vinstanceUrl\"\x1c\n" +
|
||||
"\x1aGetWorkspaceProfileRequest\"\x88\x13\n" +
|
||||
"\x1aGetWorkspaceProfileRequest\"\xfa\x14\n" +
|
||||
"\x10WorkspaceSetting\x12\x17\n" +
|
||||
"\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12X\n" +
|
||||
"\x0fgeneral_setting\x18\x02 \x01(\v2-.memos.api.v1.WorkspaceSetting.GeneralSettingH\x00R\x0egeneralSetting\x12X\n" +
|
||||
|
|
@ -1087,13 +1380,18 @@ const file_api_v1_workspace_service_proto_rawDesc = "" +
|
|||
"\x1adisable_markdown_shortcuts\x18\b \x01(\bR\x18disableMarkdownShortcuts\x127\n" +
|
||||
"\x18enable_blur_nsfw_content\x18\t \x01(\bR\x15enableBlurNsfwContent\x12\x1b\n" +
|
||||
"\tnsfw_tags\x18\n" +
|
||||
" \x03(\tR\bnsfwTags\x1a\x9b\x01\n" +
|
||||
" \x03(\tR\bnsfwTags\x1a\x82\x02\n" +
|
||||
"\tAiSetting\x12\x1b\n" +
|
||||
"\tenable_ai\x18\x01 \x01(\bR\benableAi\x12\x19\n" +
|
||||
"\bbase_url\x18\x02 \x01(\tR\abaseUrl\x12\x17\n" +
|
||||
"\aapi_key\x18\x03 \x01(\tR\x06apiKey\x12\x14\n" +
|
||||
"\x05model\x18\x04 \x01(\tR\x05model\x12'\n" +
|
||||
"\x0ftimeout_seconds\x18\x05 \x01(\x05R\x0etimeoutSeconds\"N\n" +
|
||||
"\x0ftimeout_seconds\x18\x05 \x01(\x05R\x0etimeoutSeconds\x12e\n" +
|
||||
"\x12tag_recommendation\x18\x06 \x01(\v26.memos.api.v1.WorkspaceSetting.TagRecommendationConfigR\x11tagRecommendation\x1a\x88\x01\n" +
|
||||
"\x17TagRecommendationConfig\x12\x18\n" +
|
||||
"\aenabled\x18\x01 \x01(\bR\aenabled\x12#\n" +
|
||||
"\rsystem_prompt\x18\x02 \x01(\tR\fsystemPrompt\x12.\n" +
|
||||
"\x13requests_per_minute\x18\x03 \x01(\x05R\x11requestsPerMinute\"N\n" +
|
||||
"\x03Key\x12\x13\n" +
|
||||
"\x0fKEY_UNSPECIFIED\x10\x00\x12\v\n" +
|
||||
"\aGENERAL\x10\x01\x12\v\n" +
|
||||
|
|
@ -1108,11 +1406,26 @@ const file_api_v1_workspace_service_proto_rawDesc = "" +
|
|||
"\x1dUpdateWorkspaceSettingRequest\x12=\n" +
|
||||
"\asetting\x18\x01 \x01(\v2\x1e.memos.api.v1.WorkspaceSettingB\x03\xe0A\x02R\asetting\x12@\n" +
|
||||
"\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskB\x03\xe0A\x01R\n" +
|
||||
"updateMask2\xe9\x03\n" +
|
||||
"updateMask\"*\n" +
|
||||
"(GetDefaultTagRecommendationPromptRequest\"P\n" +
|
||||
")GetDefaultTagRecommendationPromptResponse\x12#\n" +
|
||||
"\rsystem_prompt\x18\x01 \x01(\tR\fsystemPrompt\"\x8c\x01\n" +
|
||||
"\x17TestAiConnectionRequest\x12\x19\n" +
|
||||
"\bbase_url\x18\x01 \x01(\tR\abaseUrl\x12\x17\n" +
|
||||
"\aapi_key\x18\x02 \x01(\tR\x06apiKey\x12\x14\n" +
|
||||
"\x05model\x18\x03 \x01(\tR\x05model\x12'\n" +
|
||||
"\x0ftimeout_seconds\x18\x04 \x01(\x05R\x0etimeoutSeconds\"m\n" +
|
||||
"\x18TestAiConnectionResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage\x12\x1d\n" +
|
||||
"\n" +
|
||||
"model_info\x18\x03 \x01(\tR\tmodelInfo2\xd5\x06\n" +
|
||||
"\x10WorkspaceService\x12\x82\x01\n" +
|
||||
"\x13GetWorkspaceProfile\x12(.memos.api.v1.GetWorkspaceProfileRequest\x1a\x1e.memos.api.v1.WorkspaceProfile\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/api/v1/workspace/profile\x12\x93\x01\n" +
|
||||
"\x13GetWorkspaceSetting\x12(.memos.api.v1.GetWorkspaceSettingRequest\x1a\x1e.memos.api.v1.WorkspaceSetting\"2\xdaA\x04name\x82\xd3\xe4\x93\x02%\x12#/api/v1/{name=workspace/settings/*}\x12\xb9\x01\n" +
|
||||
"\x16UpdateWorkspaceSetting\x12+.memos.api.v1.UpdateWorkspaceSettingRequest\x1a\x1e.memos.api.v1.WorkspaceSetting\"R\xdaA\x13setting,update_mask\x82\xd3\xe4\x93\x026:\asetting2+/api/v1/{setting.name=workspace/settings/*}B\xad\x01\n" +
|
||||
"\x16UpdateWorkspaceSetting\x12+.memos.api.v1.UpdateWorkspaceSettingRequest\x1a\x1e.memos.api.v1.WorkspaceSetting\"R\xdaA\x13setting,update_mask\x82\xd3\xe4\x93\x026:\asetting2+/api/v1/{setting.name=workspace/settings/*}\x12\xd4\x01\n" +
|
||||
"!GetDefaultTagRecommendationPrompt\x126.memos.api.v1.GetDefaultTagRecommendationPromptRequest\x1a7.memos.api.v1.GetDefaultTagRecommendationPromptResponse\">\x82\xd3\xe4\x93\x028\x126/api/v1/workspace/ai/tag-recommendation/default-prompt\x12\x92\x01\n" +
|
||||
"\x10TestAiConnection\x12%.memos.api.v1.TestAiConnectionRequest\x1a&.memos.api.v1.TestAiConnectionResponse\"/\x82\xd3\xe4\x93\x02):\x01*\"$/api/v1/workspace/ai/test-connectionB\xad\x01\n" +
|
||||
"\x10com.memos.api.v1B\x15WorkspaceServiceProtoP\x01Z0github.com/usememos/memos/proto/gen/api/v1;apiv1\xa2\x02\x03MAX\xaa\x02\fMemos.Api.V1\xca\x02\fMemos\\Api\\V1\xe2\x02\x18Memos\\Api\\V1\\GPBMetadata\xea\x02\x0eMemos::Api::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
|
|
@ -1128,7 +1441,7 @@ func file_api_v1_workspace_service_proto_rawDescGZIP() []byte {
|
|||
}
|
||||
|
||||
var file_api_v1_workspace_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_api_v1_workspace_service_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_api_v1_workspace_service_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
|
||||
var file_api_v1_workspace_service_proto_goTypes = []any{
|
||||
(WorkspaceSetting_Key)(0), // 0: memos.api.v1.WorkspaceSetting.Key
|
||||
(WorkspaceSetting_StorageSetting_StorageType)(0), // 1: memos.api.v1.WorkspaceSetting.StorageSetting.StorageType
|
||||
|
|
@ -1137,35 +1450,45 @@ var file_api_v1_workspace_service_proto_goTypes = []any{
|
|||
(*WorkspaceSetting)(nil), // 4: memos.api.v1.WorkspaceSetting
|
||||
(*GetWorkspaceSettingRequest)(nil), // 5: memos.api.v1.GetWorkspaceSettingRequest
|
||||
(*UpdateWorkspaceSettingRequest)(nil), // 6: memos.api.v1.UpdateWorkspaceSettingRequest
|
||||
(*WorkspaceSetting_GeneralSetting)(nil), // 7: memos.api.v1.WorkspaceSetting.GeneralSetting
|
||||
(*WorkspaceSetting_StorageSetting)(nil), // 8: memos.api.v1.WorkspaceSetting.StorageSetting
|
||||
(*WorkspaceSetting_MemoRelatedSetting)(nil), // 9: memos.api.v1.WorkspaceSetting.MemoRelatedSetting
|
||||
(*WorkspaceSetting_AiSetting)(nil), // 10: memos.api.v1.WorkspaceSetting.AiSetting
|
||||
(*WorkspaceSetting_GeneralSetting_CustomProfile)(nil), // 11: memos.api.v1.WorkspaceSetting.GeneralSetting.CustomProfile
|
||||
(*WorkspaceSetting_StorageSetting_S3Config)(nil), // 12: memos.api.v1.WorkspaceSetting.StorageSetting.S3Config
|
||||
(*fieldmaskpb.FieldMask)(nil), // 13: google.protobuf.FieldMask
|
||||
(*GetDefaultTagRecommendationPromptRequest)(nil), // 7: memos.api.v1.GetDefaultTagRecommendationPromptRequest
|
||||
(*GetDefaultTagRecommendationPromptResponse)(nil), // 8: memos.api.v1.GetDefaultTagRecommendationPromptResponse
|
||||
(*TestAiConnectionRequest)(nil), // 9: memos.api.v1.TestAiConnectionRequest
|
||||
(*TestAiConnectionResponse)(nil), // 10: memos.api.v1.TestAiConnectionResponse
|
||||
(*WorkspaceSetting_GeneralSetting)(nil), // 11: memos.api.v1.WorkspaceSetting.GeneralSetting
|
||||
(*WorkspaceSetting_StorageSetting)(nil), // 12: memos.api.v1.WorkspaceSetting.StorageSetting
|
||||
(*WorkspaceSetting_MemoRelatedSetting)(nil), // 13: memos.api.v1.WorkspaceSetting.MemoRelatedSetting
|
||||
(*WorkspaceSetting_AiSetting)(nil), // 14: memos.api.v1.WorkspaceSetting.AiSetting
|
||||
(*WorkspaceSetting_TagRecommendationConfig)(nil), // 15: memos.api.v1.WorkspaceSetting.TagRecommendationConfig
|
||||
(*WorkspaceSetting_GeneralSetting_CustomProfile)(nil), // 16: memos.api.v1.WorkspaceSetting.GeneralSetting.CustomProfile
|
||||
(*WorkspaceSetting_StorageSetting_S3Config)(nil), // 17: memos.api.v1.WorkspaceSetting.StorageSetting.S3Config
|
||||
(*fieldmaskpb.FieldMask)(nil), // 18: google.protobuf.FieldMask
|
||||
}
|
||||
var file_api_v1_workspace_service_proto_depIdxs = []int32{
|
||||
7, // 0: memos.api.v1.WorkspaceSetting.general_setting:type_name -> memos.api.v1.WorkspaceSetting.GeneralSetting
|
||||
8, // 1: memos.api.v1.WorkspaceSetting.storage_setting:type_name -> memos.api.v1.WorkspaceSetting.StorageSetting
|
||||
9, // 2: memos.api.v1.WorkspaceSetting.memo_related_setting:type_name -> memos.api.v1.WorkspaceSetting.MemoRelatedSetting
|
||||
10, // 3: memos.api.v1.WorkspaceSetting.ai_setting:type_name -> memos.api.v1.WorkspaceSetting.AiSetting
|
||||
11, // 0: memos.api.v1.WorkspaceSetting.general_setting:type_name -> memos.api.v1.WorkspaceSetting.GeneralSetting
|
||||
12, // 1: memos.api.v1.WorkspaceSetting.storage_setting:type_name -> memos.api.v1.WorkspaceSetting.StorageSetting
|
||||
13, // 2: memos.api.v1.WorkspaceSetting.memo_related_setting:type_name -> memos.api.v1.WorkspaceSetting.MemoRelatedSetting
|
||||
14, // 3: memos.api.v1.WorkspaceSetting.ai_setting:type_name -> memos.api.v1.WorkspaceSetting.AiSetting
|
||||
4, // 4: memos.api.v1.UpdateWorkspaceSettingRequest.setting:type_name -> memos.api.v1.WorkspaceSetting
|
||||
13, // 5: memos.api.v1.UpdateWorkspaceSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
11, // 6: memos.api.v1.WorkspaceSetting.GeneralSetting.custom_profile:type_name -> memos.api.v1.WorkspaceSetting.GeneralSetting.CustomProfile
|
||||
18, // 5: memos.api.v1.UpdateWorkspaceSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
16, // 6: memos.api.v1.WorkspaceSetting.GeneralSetting.custom_profile:type_name -> memos.api.v1.WorkspaceSetting.GeneralSetting.CustomProfile
|
||||
1, // 7: memos.api.v1.WorkspaceSetting.StorageSetting.storage_type:type_name -> memos.api.v1.WorkspaceSetting.StorageSetting.StorageType
|
||||
12, // 8: memos.api.v1.WorkspaceSetting.StorageSetting.s3_config:type_name -> memos.api.v1.WorkspaceSetting.StorageSetting.S3Config
|
||||
3, // 9: memos.api.v1.WorkspaceService.GetWorkspaceProfile:input_type -> memos.api.v1.GetWorkspaceProfileRequest
|
||||
5, // 10: memos.api.v1.WorkspaceService.GetWorkspaceSetting:input_type -> memos.api.v1.GetWorkspaceSettingRequest
|
||||
6, // 11: memos.api.v1.WorkspaceService.UpdateWorkspaceSetting:input_type -> memos.api.v1.UpdateWorkspaceSettingRequest
|
||||
2, // 12: memos.api.v1.WorkspaceService.GetWorkspaceProfile:output_type -> memos.api.v1.WorkspaceProfile
|
||||
4, // 13: memos.api.v1.WorkspaceService.GetWorkspaceSetting:output_type -> memos.api.v1.WorkspaceSetting
|
||||
4, // 14: memos.api.v1.WorkspaceService.UpdateWorkspaceSetting:output_type -> memos.api.v1.WorkspaceSetting
|
||||
12, // [12:15] is the sub-list for method output_type
|
||||
9, // [9:12] is the sub-list for method input_type
|
||||
9, // [9:9] is the sub-list for extension type_name
|
||||
9, // [9:9] is the sub-list for extension extendee
|
||||
0, // [0:9] is the sub-list for field type_name
|
||||
17, // 8: memos.api.v1.WorkspaceSetting.StorageSetting.s3_config:type_name -> memos.api.v1.WorkspaceSetting.StorageSetting.S3Config
|
||||
15, // 9: memos.api.v1.WorkspaceSetting.AiSetting.tag_recommendation:type_name -> memos.api.v1.WorkspaceSetting.TagRecommendationConfig
|
||||
3, // 10: memos.api.v1.WorkspaceService.GetWorkspaceProfile:input_type -> memos.api.v1.GetWorkspaceProfileRequest
|
||||
5, // 11: memos.api.v1.WorkspaceService.GetWorkspaceSetting:input_type -> memos.api.v1.GetWorkspaceSettingRequest
|
||||
6, // 12: memos.api.v1.WorkspaceService.UpdateWorkspaceSetting:input_type -> memos.api.v1.UpdateWorkspaceSettingRequest
|
||||
7, // 13: memos.api.v1.WorkspaceService.GetDefaultTagRecommendationPrompt:input_type -> memos.api.v1.GetDefaultTagRecommendationPromptRequest
|
||||
9, // 14: memos.api.v1.WorkspaceService.TestAiConnection:input_type -> memos.api.v1.TestAiConnectionRequest
|
||||
2, // 15: memos.api.v1.WorkspaceService.GetWorkspaceProfile:output_type -> memos.api.v1.WorkspaceProfile
|
||||
4, // 16: memos.api.v1.WorkspaceService.GetWorkspaceSetting:output_type -> memos.api.v1.WorkspaceSetting
|
||||
4, // 17: memos.api.v1.WorkspaceService.UpdateWorkspaceSetting:output_type -> memos.api.v1.WorkspaceSetting
|
||||
8, // 18: memos.api.v1.WorkspaceService.GetDefaultTagRecommendationPrompt:output_type -> memos.api.v1.GetDefaultTagRecommendationPromptResponse
|
||||
10, // 19: memos.api.v1.WorkspaceService.TestAiConnection:output_type -> memos.api.v1.TestAiConnectionResponse
|
||||
15, // [15:20] is the sub-list for method output_type
|
||||
10, // [10:15] is the sub-list for method input_type
|
||||
10, // [10:10] is the sub-list for extension type_name
|
||||
10, // [10:10] is the sub-list for extension extendee
|
||||
0, // [0:10] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_v1_workspace_service_proto_init() }
|
||||
|
|
@ -1185,7 +1508,7 @@ func file_api_v1_workspace_service_proto_init() {
|
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_workspace_service_proto_rawDesc), len(file_api_v1_workspace_service_proto_rawDesc)),
|
||||
NumEnums: 2,
|
||||
NumMessages: 11,
|
||||
NumMessages: 16,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -176,6 +176,54 @@ func local_request_WorkspaceService_UpdateWorkspaceSetting_0(ctx context.Context
|
|||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func request_WorkspaceService_GetDefaultTagRecommendationPrompt_0(ctx context.Context, marshaler runtime.Marshaler, client WorkspaceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq GetDefaultTagRecommendationPromptRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
msg, err := client.GetDefaultTagRecommendationPrompt(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func local_request_WorkspaceService_GetDefaultTagRecommendationPrompt_0(ctx context.Context, marshaler runtime.Marshaler, server WorkspaceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq GetDefaultTagRecommendationPromptRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
msg, err := server.GetDefaultTagRecommendationPrompt(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func request_WorkspaceService_TestAiConnection_0(ctx context.Context, marshaler runtime.Marshaler, client WorkspaceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq TestAiConnectionRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
msg, err := client.TestAiConnection(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func local_request_WorkspaceService_TestAiConnection_0(ctx context.Context, marshaler runtime.Marshaler, server WorkspaceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq TestAiConnectionRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
msg, err := server.TestAiConnection(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
// RegisterWorkspaceServiceHandlerServer registers the http handlers for service WorkspaceService to "mux".
|
||||
// UnaryRPC :call WorkspaceServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
|
|
@ -242,6 +290,46 @@ func RegisterWorkspaceServiceHandlerServer(ctx context.Context, mux *runtime.Ser
|
|||
}
|
||||
forward_WorkspaceService_UpdateWorkspaceSetting_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodGet, pattern_WorkspaceService_GetDefaultTagRecommendationPrompt_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.WorkspaceService/GetDefaultTagRecommendationPrompt", runtime.WithHTTPPathPattern("/api/v1/workspace/ai/tag-recommendation/default-prompt"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_WorkspaceService_GetDefaultTagRecommendationPrompt_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_WorkspaceService_GetDefaultTagRecommendationPrompt_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodPost, pattern_WorkspaceService_TestAiConnection_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.WorkspaceService/TestAiConnection", runtime.WithHTTPPathPattern("/api/v1/workspace/ai/test-connection"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_WorkspaceService_TestAiConnection_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_WorkspaceService_TestAiConnection_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -333,17 +421,55 @@ func RegisterWorkspaceServiceHandlerClient(ctx context.Context, mux *runtime.Ser
|
|||
}
|
||||
forward_WorkspaceService_UpdateWorkspaceSetting_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodGet, pattern_WorkspaceService_GetDefaultTagRecommendationPrompt_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.WorkspaceService/GetDefaultTagRecommendationPrompt", runtime.WithHTTPPathPattern("/api/v1/workspace/ai/tag-recommendation/default-prompt"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_WorkspaceService_GetDefaultTagRecommendationPrompt_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_WorkspaceService_GetDefaultTagRecommendationPrompt_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodPost, pattern_WorkspaceService_TestAiConnection_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.WorkspaceService/TestAiConnection", runtime.WithHTTPPathPattern("/api/v1/workspace/ai/test-connection"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_WorkspaceService_TestAiConnection_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_WorkspaceService_TestAiConnection_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_WorkspaceService_GetWorkspaceProfile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "workspace", "profile"}, ""))
|
||||
pattern_WorkspaceService_GetWorkspaceSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 3, 5, 4}, []string{"api", "v1", "workspace", "settings", "name"}, ""))
|
||||
pattern_WorkspaceService_UpdateWorkspaceSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 3, 5, 4}, []string{"api", "v1", "workspace", "settings", "setting.name"}, ""))
|
||||
pattern_WorkspaceService_GetWorkspaceProfile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "workspace", "profile"}, ""))
|
||||
pattern_WorkspaceService_GetWorkspaceSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 3, 5, 4}, []string{"api", "v1", "workspace", "settings", "name"}, ""))
|
||||
pattern_WorkspaceService_UpdateWorkspaceSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 3, 5, 4}, []string{"api", "v1", "workspace", "settings", "setting.name"}, ""))
|
||||
pattern_WorkspaceService_GetDefaultTagRecommendationPrompt_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"api", "v1", "workspace", "ai", "tag-recommendation", "default-prompt"}, ""))
|
||||
pattern_WorkspaceService_TestAiConnection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "workspace", "ai", "test-connection"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_WorkspaceService_GetWorkspaceProfile_0 = runtime.ForwardResponseMessage
|
||||
forward_WorkspaceService_GetWorkspaceSetting_0 = runtime.ForwardResponseMessage
|
||||
forward_WorkspaceService_UpdateWorkspaceSetting_0 = runtime.ForwardResponseMessage
|
||||
forward_WorkspaceService_GetWorkspaceProfile_0 = runtime.ForwardResponseMessage
|
||||
forward_WorkspaceService_GetWorkspaceSetting_0 = runtime.ForwardResponseMessage
|
||||
forward_WorkspaceService_UpdateWorkspaceSetting_0 = runtime.ForwardResponseMessage
|
||||
forward_WorkspaceService_GetDefaultTagRecommendationPrompt_0 = runtime.ForwardResponseMessage
|
||||
forward_WorkspaceService_TestAiConnection_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
|
|
|||
|
|
@ -19,9 +19,11 @@ import (
|
|||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
WorkspaceService_GetWorkspaceProfile_FullMethodName = "/memos.api.v1.WorkspaceService/GetWorkspaceProfile"
|
||||
WorkspaceService_GetWorkspaceSetting_FullMethodName = "/memos.api.v1.WorkspaceService/GetWorkspaceSetting"
|
||||
WorkspaceService_UpdateWorkspaceSetting_FullMethodName = "/memos.api.v1.WorkspaceService/UpdateWorkspaceSetting"
|
||||
WorkspaceService_GetWorkspaceProfile_FullMethodName = "/memos.api.v1.WorkspaceService/GetWorkspaceProfile"
|
||||
WorkspaceService_GetWorkspaceSetting_FullMethodName = "/memos.api.v1.WorkspaceService/GetWorkspaceSetting"
|
||||
WorkspaceService_UpdateWorkspaceSetting_FullMethodName = "/memos.api.v1.WorkspaceService/UpdateWorkspaceSetting"
|
||||
WorkspaceService_GetDefaultTagRecommendationPrompt_FullMethodName = "/memos.api.v1.WorkspaceService/GetDefaultTagRecommendationPrompt"
|
||||
WorkspaceService_TestAiConnection_FullMethodName = "/memos.api.v1.WorkspaceService/TestAiConnection"
|
||||
)
|
||||
|
||||
// WorkspaceServiceClient is the client API for WorkspaceService service.
|
||||
|
|
@ -34,6 +36,10 @@ type WorkspaceServiceClient interface {
|
|||
GetWorkspaceSetting(ctx context.Context, in *GetWorkspaceSettingRequest, opts ...grpc.CallOption) (*WorkspaceSetting, error)
|
||||
// Updates a workspace setting.
|
||||
UpdateWorkspaceSetting(ctx context.Context, in *UpdateWorkspaceSettingRequest, opts ...grpc.CallOption) (*WorkspaceSetting, error)
|
||||
// Gets the default system prompt for AI tag recommendations.
|
||||
GetDefaultTagRecommendationPrompt(ctx context.Context, in *GetDefaultTagRecommendationPromptRequest, opts ...grpc.CallOption) (*GetDefaultTagRecommendationPromptResponse, error)
|
||||
// Tests AI API connection and configuration.
|
||||
TestAiConnection(ctx context.Context, in *TestAiConnectionRequest, opts ...grpc.CallOption) (*TestAiConnectionResponse, error)
|
||||
}
|
||||
|
||||
type workspaceServiceClient struct {
|
||||
|
|
@ -74,6 +80,26 @@ func (c *workspaceServiceClient) UpdateWorkspaceSetting(ctx context.Context, in
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *workspaceServiceClient) GetDefaultTagRecommendationPrompt(ctx context.Context, in *GetDefaultTagRecommendationPromptRequest, opts ...grpc.CallOption) (*GetDefaultTagRecommendationPromptResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetDefaultTagRecommendationPromptResponse)
|
||||
err := c.cc.Invoke(ctx, WorkspaceService_GetDefaultTagRecommendationPrompt_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *workspaceServiceClient) TestAiConnection(ctx context.Context, in *TestAiConnectionRequest, opts ...grpc.CallOption) (*TestAiConnectionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(TestAiConnectionResponse)
|
||||
err := c.cc.Invoke(ctx, WorkspaceService_TestAiConnection_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// WorkspaceServiceServer is the server API for WorkspaceService service.
|
||||
// All implementations must embed UnimplementedWorkspaceServiceServer
|
||||
// for forward compatibility.
|
||||
|
|
@ -84,6 +110,10 @@ type WorkspaceServiceServer interface {
|
|||
GetWorkspaceSetting(context.Context, *GetWorkspaceSettingRequest) (*WorkspaceSetting, error)
|
||||
// Updates a workspace setting.
|
||||
UpdateWorkspaceSetting(context.Context, *UpdateWorkspaceSettingRequest) (*WorkspaceSetting, error)
|
||||
// Gets the default system prompt for AI tag recommendations.
|
||||
GetDefaultTagRecommendationPrompt(context.Context, *GetDefaultTagRecommendationPromptRequest) (*GetDefaultTagRecommendationPromptResponse, error)
|
||||
// Tests AI API connection and configuration.
|
||||
TestAiConnection(context.Context, *TestAiConnectionRequest) (*TestAiConnectionResponse, error)
|
||||
mustEmbedUnimplementedWorkspaceServiceServer()
|
||||
}
|
||||
|
||||
|
|
@ -103,6 +133,12 @@ func (UnimplementedWorkspaceServiceServer) GetWorkspaceSetting(context.Context,
|
|||
func (UnimplementedWorkspaceServiceServer) UpdateWorkspaceSetting(context.Context, *UpdateWorkspaceSettingRequest) (*WorkspaceSetting, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkspaceSetting not implemented")
|
||||
}
|
||||
func (UnimplementedWorkspaceServiceServer) GetDefaultTagRecommendationPrompt(context.Context, *GetDefaultTagRecommendationPromptRequest) (*GetDefaultTagRecommendationPromptResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetDefaultTagRecommendationPrompt not implemented")
|
||||
}
|
||||
func (UnimplementedWorkspaceServiceServer) TestAiConnection(context.Context, *TestAiConnectionRequest) (*TestAiConnectionResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method TestAiConnection not implemented")
|
||||
}
|
||||
func (UnimplementedWorkspaceServiceServer) mustEmbedUnimplementedWorkspaceServiceServer() {}
|
||||
func (UnimplementedWorkspaceServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
|
|
@ -178,6 +214,42 @@ func _WorkspaceService_UpdateWorkspaceSetting_Handler(srv interface{}, ctx conte
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _WorkspaceService_GetDefaultTagRecommendationPrompt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetDefaultTagRecommendationPromptRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(WorkspaceServiceServer).GetDefaultTagRecommendationPrompt(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: WorkspaceService_GetDefaultTagRecommendationPrompt_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(WorkspaceServiceServer).GetDefaultTagRecommendationPrompt(ctx, req.(*GetDefaultTagRecommendationPromptRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _WorkspaceService_TestAiConnection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TestAiConnectionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(WorkspaceServiceServer).TestAiConnection(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: WorkspaceService_TestAiConnection_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(WorkspaceServiceServer).TestAiConnection(ctx, req.(*TestAiConnectionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// WorkspaceService_ServiceDesc is the grpc.ServiceDesc for WorkspaceService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
|
|
@ -197,6 +269,14 @@ var WorkspaceService_ServiceDesc = grpc.ServiceDesc{
|
|||
MethodName: "UpdateWorkspaceSetting",
|
||||
Handler: _WorkspaceService_UpdateWorkspaceSetting_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetDefaultTagRecommendationPrompt",
|
||||
Handler: _WorkspaceService_GetDefaultTagRecommendationPrompt_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "TestAiConnection",
|
||||
Handler: _WorkspaceService_TestAiConnection_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/v1/workspace_service.proto",
|
||||
|
|
|
|||
|
|
@ -1164,6 +1164,31 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Status'
|
||||
/api/v1/memos:suggest-tags:
|
||||
post:
|
||||
tags:
|
||||
- MemoService
|
||||
description: SuggestMemoTags suggests tags for memo content.
|
||||
operationId: MemoService_SuggestMemoTags
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SuggestMemoTagsRequest'
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SuggestMemoTagsResponse'
|
||||
default:
|
||||
description: Default error response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Status'
|
||||
/api/v1/reactions/{reaction}:
|
||||
delete:
|
||||
tags:
|
||||
|
|
@ -2083,6 +2108,50 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Status'
|
||||
/api/v1/workspace/ai/tag-recommendation/default-prompt:
|
||||
get:
|
||||
tags:
|
||||
- WorkspaceService
|
||||
description: Gets the default system prompt for AI tag recommendations.
|
||||
operationId: WorkspaceService_GetDefaultTagRecommendationPrompt
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/GetDefaultTagRecommendationPromptResponse'
|
||||
default:
|
||||
description: Default error response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Status'
|
||||
/api/v1/workspace/ai/test-connection:
|
||||
post:
|
||||
tags:
|
||||
- WorkspaceService
|
||||
description: Tests AI API connection and configuration.
|
||||
operationId: WorkspaceService_TestAiConnection
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/TestAiConnectionRequest'
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/TestAiConnectionResponse'
|
||||
default:
|
||||
description: Default error response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Status'
|
||||
/api/v1/workspace/profile:
|
||||
get:
|
||||
tags:
|
||||
|
|
@ -2478,6 +2547,13 @@ components:
|
|||
Last time the session was accessed.
|
||||
Used for sliding expiration calculation (last_accessed_time + 2 weeks).
|
||||
format: date-time
|
||||
GetDefaultTagRecommendationPromptResponse:
|
||||
type: object
|
||||
properties:
|
||||
systemPrompt:
|
||||
type: string
|
||||
description: The default system prompt for tag recommendation.
|
||||
description: Response message for GetDefaultTagRecommendationPrompt method.
|
||||
GoogleProtobufAny:
|
||||
type: object
|
||||
properties:
|
||||
|
|
@ -3390,6 +3466,27 @@ components:
|
|||
properties:
|
||||
content:
|
||||
type: string
|
||||
SuggestMemoTagsRequest:
|
||||
required:
|
||||
- content
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: string
|
||||
description: Required. The content of the memo for tag suggestion.
|
||||
existingTags:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Optional. The existing tags for the memo.
|
||||
SuggestMemoTagsResponse:
|
||||
type: object
|
||||
properties:
|
||||
suggestedTags:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/TagSuggestion'
|
||||
description: The suggested tags with reasons for the memo.
|
||||
SuperscriptNode:
|
||||
type: object
|
||||
properties:
|
||||
|
|
@ -3422,6 +3519,18 @@ components:
|
|||
properties:
|
||||
content:
|
||||
type: string
|
||||
TagSuggestion:
|
||||
required:
|
||||
- tag
|
||||
- reason
|
||||
type: object
|
||||
properties:
|
||||
tag:
|
||||
type: string
|
||||
description: The suggested tag name.
|
||||
reason:
|
||||
type: string
|
||||
description: The reason why this tag is recommended.
|
||||
TaskListItemNode:
|
||||
type: object
|
||||
properties:
|
||||
|
|
@ -3436,6 +3545,36 @@ components:
|
|||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Node'
|
||||
TestAiConnectionRequest:
|
||||
type: object
|
||||
properties:
|
||||
baseUrl:
|
||||
type: string
|
||||
description: base_url is the base URL for AI API.
|
||||
apiKey:
|
||||
type: string
|
||||
description: api_key is the API key for AI service.
|
||||
model:
|
||||
type: string
|
||||
description: model is the AI model to use.
|
||||
timeoutSeconds:
|
||||
type: integer
|
||||
description: timeout_seconds is the timeout for AI requests in seconds.
|
||||
format: int32
|
||||
description: Request message for TestAiConnection method.
|
||||
TestAiConnectionResponse:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: boolean
|
||||
description: success indicates whether the connection test was successful.
|
||||
message:
|
||||
type: string
|
||||
description: message provides additional information about the test result.
|
||||
modelInfo:
|
||||
type: string
|
||||
description: model_info contains information about the tested model (if successful).
|
||||
description: Response message for TestAiConnection method.
|
||||
TextNode:
|
||||
type: object
|
||||
properties:
|
||||
|
|
@ -3788,6 +3927,10 @@ components:
|
|||
type: integer
|
||||
description: timeout_seconds is the timeout for AI requests in seconds.
|
||||
format: int32
|
||||
tagRecommendation:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/WorkspaceSetting_TagRecommendationConfig'
|
||||
description: tag_recommendation contains tag recommendation specific settings.
|
||||
description: AI configuration settings for workspace AI features.
|
||||
WorkspaceSetting_GeneralSetting:
|
||||
type: object
|
||||
|
|
@ -3888,6 +4031,20 @@ components:
|
|||
- $ref: '#/components/schemas/StorageSetting_S3Config'
|
||||
description: The S3 config.
|
||||
description: Storage configuration settings for workspace attachments.
|
||||
WorkspaceSetting_TagRecommendationConfig:
|
||||
type: object
|
||||
properties:
|
||||
enabled:
|
||||
type: boolean
|
||||
description: enabled controls whether tag recommendation is enabled.
|
||||
systemPrompt:
|
||||
type: string
|
||||
description: system_prompt is the custom system prompt for tag recommendation.
|
||||
requestsPerMinute:
|
||||
type: integer
|
||||
description: requests_per_minute is the rate limit for tag recommendation requests.
|
||||
format: int32
|
||||
description: Tag recommendation configuration.
|
||||
tags:
|
||||
- name: ActivityService
|
||||
- name: AttachmentService
|
||||
|
|
|
|||
|
|
@ -806,8 +806,10 @@ type WorkspaceAISetting struct {
|
|||
Model string `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"`
|
||||
// timeout_seconds is the timeout for AI requests in seconds.
|
||||
TimeoutSeconds int32 `protobuf:"varint,5,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
// tag_recommendation contains tag recommendation specific settings.
|
||||
TagRecommendation *TagRecommendationConfig `protobuf:"bytes,6,opt,name=tag_recommendation,json=tagRecommendation,proto3" json:"tag_recommendation,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *WorkspaceAISetting) Reset() {
|
||||
|
|
@ -875,6 +877,76 @@ func (x *WorkspaceAISetting) GetTimeoutSeconds() int32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (x *WorkspaceAISetting) GetTagRecommendation() *TagRecommendationConfig {
|
||||
if x != nil {
|
||||
return x.TagRecommendation
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type TagRecommendationConfig struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// enabled controls whether tag recommendation is enabled.
|
||||
Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
// system_prompt is the custom system prompt for tag recommendation.
|
||||
SystemPrompt string `protobuf:"bytes,2,opt,name=system_prompt,json=systemPrompt,proto3" json:"system_prompt,omitempty"`
|
||||
// requests_per_minute is the rate limit for tag recommendation requests.
|
||||
RequestsPerMinute int32 `protobuf:"varint,3,opt,name=requests_per_minute,json=requestsPerMinute,proto3" json:"requests_per_minute,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TagRecommendationConfig) Reset() {
|
||||
*x = TagRecommendationConfig{}
|
||||
mi := &file_store_workspace_setting_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TagRecommendationConfig) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TagRecommendationConfig) ProtoMessage() {}
|
||||
|
||||
func (x *TagRecommendationConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_store_workspace_setting_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TagRecommendationConfig.ProtoReflect.Descriptor instead.
|
||||
func (*TagRecommendationConfig) Descriptor() ([]byte, []int) {
|
||||
return file_store_workspace_setting_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *TagRecommendationConfig) GetEnabled() bool {
|
||||
if x != nil {
|
||||
return x.Enabled
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *TagRecommendationConfig) GetSystemPrompt() string {
|
||||
if x != nil {
|
||||
return x.SystemPrompt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TagRecommendationConfig) GetRequestsPerMinute() int32 {
|
||||
if x != nil {
|
||||
return x.RequestsPerMinute
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_store_workspace_setting_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_store_workspace_setting_proto_rawDesc = "" +
|
||||
|
|
@ -935,13 +1007,18 @@ const file_store_workspace_setting_proto_rawDesc = "" +
|
|||
"\x1adisable_markdown_shortcuts\x18\b \x01(\bR\x18disableMarkdownShortcuts\x127\n" +
|
||||
"\x18enable_blur_nsfw_content\x18\t \x01(\bR\x15enableBlurNsfwContent\x12\x1b\n" +
|
||||
"\tnsfw_tags\x18\n" +
|
||||
" \x03(\tR\bnsfwTags\"\xa4\x01\n" +
|
||||
" \x03(\tR\bnsfwTags\"\xf9\x01\n" +
|
||||
"\x12WorkspaceAISetting\x12\x1b\n" +
|
||||
"\tenable_ai\x18\x01 \x01(\bR\benableAi\x12\x19\n" +
|
||||
"\bbase_url\x18\x02 \x01(\tR\abaseUrl\x12\x17\n" +
|
||||
"\aapi_key\x18\x03 \x01(\tR\x06apiKey\x12\x14\n" +
|
||||
"\x05model\x18\x04 \x01(\tR\x05model\x12'\n" +
|
||||
"\x0ftimeout_seconds\x18\x05 \x01(\x05R\x0etimeoutSeconds*{\n" +
|
||||
"\x0ftimeout_seconds\x18\x05 \x01(\x05R\x0etimeoutSeconds\x12S\n" +
|
||||
"\x12tag_recommendation\x18\x06 \x01(\v2$.memos.store.TagRecommendationConfigR\x11tagRecommendation\"\x88\x01\n" +
|
||||
"\x17TagRecommendationConfig\x12\x18\n" +
|
||||
"\aenabled\x18\x01 \x01(\bR\aenabled\x12#\n" +
|
||||
"\rsystem_prompt\x18\x02 \x01(\tR\fsystemPrompt\x12.\n" +
|
||||
"\x13requests_per_minute\x18\x03 \x01(\x05R\x11requestsPerMinute*{\n" +
|
||||
"\x13WorkspaceSettingKey\x12%\n" +
|
||||
"!WORKSPACE_SETTING_KEY_UNSPECIFIED\x10\x00\x12\t\n" +
|
||||
"\x05BASIC\x10\x01\x12\v\n" +
|
||||
|
|
@ -964,7 +1041,7 @@ func file_store_workspace_setting_proto_rawDescGZIP() []byte {
|
|||
}
|
||||
|
||||
var file_store_workspace_setting_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_store_workspace_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||
var file_store_workspace_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||
var file_store_workspace_setting_proto_goTypes = []any{
|
||||
(WorkspaceSettingKey)(0), // 0: memos.store.WorkspaceSettingKey
|
||||
(WorkspaceStorageSetting_StorageType)(0), // 1: memos.store.WorkspaceStorageSetting.StorageType
|
||||
|
|
@ -976,22 +1053,24 @@ var file_store_workspace_setting_proto_goTypes = []any{
|
|||
(*StorageS3Config)(nil), // 7: memos.store.StorageS3Config
|
||||
(*WorkspaceMemoRelatedSetting)(nil), // 8: memos.store.WorkspaceMemoRelatedSetting
|
||||
(*WorkspaceAISetting)(nil), // 9: memos.store.WorkspaceAISetting
|
||||
(*TagRecommendationConfig)(nil), // 10: memos.store.TagRecommendationConfig
|
||||
}
|
||||
var file_store_workspace_setting_proto_depIdxs = []int32{
|
||||
0, // 0: memos.store.WorkspaceSetting.key:type_name -> memos.store.WorkspaceSettingKey
|
||||
3, // 1: memos.store.WorkspaceSetting.basic_setting:type_name -> memos.store.WorkspaceBasicSetting
|
||||
4, // 2: memos.store.WorkspaceSetting.general_setting:type_name -> memos.store.WorkspaceGeneralSetting
|
||||
6, // 3: memos.store.WorkspaceSetting.storage_setting:type_name -> memos.store.WorkspaceStorageSetting
|
||||
8, // 4: memos.store.WorkspaceSetting.memo_related_setting:type_name -> memos.store.WorkspaceMemoRelatedSetting
|
||||
9, // 5: memos.store.WorkspaceSetting.ai_setting:type_name -> memos.store.WorkspaceAISetting
|
||||
5, // 6: memos.store.WorkspaceGeneralSetting.custom_profile:type_name -> memos.store.WorkspaceCustomProfile
|
||||
1, // 7: memos.store.WorkspaceStorageSetting.storage_type:type_name -> memos.store.WorkspaceStorageSetting.StorageType
|
||||
7, // 8: memos.store.WorkspaceStorageSetting.s3_config:type_name -> memos.store.StorageS3Config
|
||||
9, // [9:9] is the sub-list for method output_type
|
||||
9, // [9:9] is the sub-list for method input_type
|
||||
9, // [9:9] is the sub-list for extension type_name
|
||||
9, // [9:9] is the sub-list for extension extendee
|
||||
0, // [0:9] is the sub-list for field type_name
|
||||
0, // 0: memos.store.WorkspaceSetting.key:type_name -> memos.store.WorkspaceSettingKey
|
||||
3, // 1: memos.store.WorkspaceSetting.basic_setting:type_name -> memos.store.WorkspaceBasicSetting
|
||||
4, // 2: memos.store.WorkspaceSetting.general_setting:type_name -> memos.store.WorkspaceGeneralSetting
|
||||
6, // 3: memos.store.WorkspaceSetting.storage_setting:type_name -> memos.store.WorkspaceStorageSetting
|
||||
8, // 4: memos.store.WorkspaceSetting.memo_related_setting:type_name -> memos.store.WorkspaceMemoRelatedSetting
|
||||
9, // 5: memos.store.WorkspaceSetting.ai_setting:type_name -> memos.store.WorkspaceAISetting
|
||||
5, // 6: memos.store.WorkspaceGeneralSetting.custom_profile:type_name -> memos.store.WorkspaceCustomProfile
|
||||
1, // 7: memos.store.WorkspaceStorageSetting.storage_type:type_name -> memos.store.WorkspaceStorageSetting.StorageType
|
||||
7, // 8: memos.store.WorkspaceStorageSetting.s3_config:type_name -> memos.store.StorageS3Config
|
||||
10, // 9: memos.store.WorkspaceAISetting.tag_recommendation:type_name -> memos.store.TagRecommendationConfig
|
||||
10, // [10:10] is the sub-list for method output_type
|
||||
10, // [10:10] is the sub-list for method input_type
|
||||
10, // [10:10] is the sub-list for extension type_name
|
||||
10, // [10:10] is the sub-list for extension extendee
|
||||
0, // [0:10] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_store_workspace_setting_proto_init() }
|
||||
|
|
@ -1012,7 +1091,7 @@ func file_store_workspace_setting_proto_init() {
|
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_workspace_setting_proto_rawDesc), len(file_store_workspace_setting_proto_rawDesc)),
|
||||
NumEnums: 2,
|
||||
NumMessages: 8,
|
||||
NumMessages: 9,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -482,6 +482,25 @@ export interface DeleteMemoReactionRequest {
|
|||
name: string;
|
||||
}
|
||||
|
||||
export interface SuggestMemoTagsRequest {
|
||||
/** Required. The content of the memo for tag suggestion. */
|
||||
content: string;
|
||||
/** Optional. The existing tags for the memo. */
|
||||
existingTags: string[];
|
||||
}
|
||||
|
||||
export interface TagSuggestion {
|
||||
/** The suggested tag name. */
|
||||
tag: string;
|
||||
/** The reason why this tag is recommended. */
|
||||
reason: string;
|
||||
}
|
||||
|
||||
export interface SuggestMemoTagsResponse {
|
||||
/** The suggested tags with reasons for the memo. */
|
||||
suggestedTags: TagSuggestion[];
|
||||
}
|
||||
|
||||
function createBaseReaction(): Reaction {
|
||||
return { name: "", creator: "", contentId: "", reactionType: "", createTime: undefined };
|
||||
}
|
||||
|
|
@ -2583,6 +2602,168 @@ export const DeleteMemoReactionRequest: MessageFns<DeleteMemoReactionRequest> =
|
|||
},
|
||||
};
|
||||
|
||||
function createBaseSuggestMemoTagsRequest(): SuggestMemoTagsRequest {
|
||||
return { content: "", existingTags: [] };
|
||||
}
|
||||
|
||||
export const SuggestMemoTagsRequest: MessageFns<SuggestMemoTagsRequest> = {
|
||||
encode(message: SuggestMemoTagsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.content !== "") {
|
||||
writer.uint32(10).string(message.content);
|
||||
}
|
||||
for (const v of message.existingTags) {
|
||||
writer.uint32(18).string(v!);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): SuggestMemoTagsRequest {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseSuggestMemoTagsRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.content = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.existingTags.push(reader.string());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<SuggestMemoTagsRequest>): SuggestMemoTagsRequest {
|
||||
return SuggestMemoTagsRequest.fromPartial(base ?? {});
|
||||
},
|
||||
fromPartial(object: DeepPartial<SuggestMemoTagsRequest>): SuggestMemoTagsRequest {
|
||||
const message = createBaseSuggestMemoTagsRequest();
|
||||
message.content = object.content ?? "";
|
||||
message.existingTags = object.existingTags?.map((e) => e) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseTagSuggestion(): TagSuggestion {
|
||||
return { tag: "", reason: "" };
|
||||
}
|
||||
|
||||
export const TagSuggestion: MessageFns<TagSuggestion> = {
|
||||
encode(message: TagSuggestion, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.tag !== "") {
|
||||
writer.uint32(10).string(message.tag);
|
||||
}
|
||||
if (message.reason !== "") {
|
||||
writer.uint32(18).string(message.reason);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): TagSuggestion {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseTagSuggestion();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.tag = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.reason = reader.string();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<TagSuggestion>): TagSuggestion {
|
||||
return TagSuggestion.fromPartial(base ?? {});
|
||||
},
|
||||
fromPartial(object: DeepPartial<TagSuggestion>): TagSuggestion {
|
||||
const message = createBaseTagSuggestion();
|
||||
message.tag = object.tag ?? "";
|
||||
message.reason = object.reason ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseSuggestMemoTagsResponse(): SuggestMemoTagsResponse {
|
||||
return { suggestedTags: [] };
|
||||
}
|
||||
|
||||
export const SuggestMemoTagsResponse: MessageFns<SuggestMemoTagsResponse> = {
|
||||
encode(message: SuggestMemoTagsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
for (const v of message.suggestedTags) {
|
||||
TagSuggestion.encode(v!, writer.uint32(10).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): SuggestMemoTagsResponse {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseSuggestMemoTagsResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.suggestedTags.push(TagSuggestion.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<SuggestMemoTagsResponse>): SuggestMemoTagsResponse {
|
||||
return SuggestMemoTagsResponse.fromPartial(base ?? {});
|
||||
},
|
||||
fromPartial(object: DeepPartial<SuggestMemoTagsResponse>): SuggestMemoTagsResponse {
|
||||
const message = createBaseSuggestMemoTagsResponse();
|
||||
message.suggestedTags = object.suggestedTags?.map((e) => TagSuggestion.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
export type MemoServiceDefinition = typeof MemoServiceDefinition;
|
||||
export const MemoServiceDefinition = {
|
||||
name: "MemoService",
|
||||
|
|
@ -3404,6 +3585,54 @@ export const MemoServiceDefinition = {
|
|||
},
|
||||
},
|
||||
},
|
||||
/** SuggestMemoTags suggests tags for memo content. */
|
||||
suggestMemoTags: {
|
||||
name: "SuggestMemoTags",
|
||||
requestType: SuggestMemoTagsRequest,
|
||||
requestStream: false,
|
||||
responseType: SuggestMemoTagsResponse,
|
||||
responseStream: false,
|
||||
options: {
|
||||
_unknownFields: {
|
||||
578365826: [
|
||||
new Uint8Array([
|
||||
31,
|
||||
58,
|
||||
1,
|
||||
42,
|
||||
34,
|
||||
26,
|
||||
47,
|
||||
97,
|
||||
112,
|
||||
105,
|
||||
47,
|
||||
118,
|
||||
49,
|
||||
47,
|
||||
109,
|
||||
101,
|
||||
109,
|
||||
111,
|
||||
115,
|
||||
58,
|
||||
115,
|
||||
117,
|
||||
103,
|
||||
103,
|
||||
101,
|
||||
115,
|
||||
116,
|
||||
45,
|
||||
116,
|
||||
97,
|
||||
103,
|
||||
115,
|
||||
]),
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
|
|
|||
|
|
@ -252,6 +252,18 @@ export interface WorkspaceSetting_AiSetting {
|
|||
model: string;
|
||||
/** timeout_seconds is the timeout for AI requests in seconds. */
|
||||
timeoutSeconds: number;
|
||||
/** tag_recommendation contains tag recommendation specific settings. */
|
||||
tagRecommendation?: WorkspaceSetting_TagRecommendationConfig | undefined;
|
||||
}
|
||||
|
||||
/** Tag recommendation configuration. */
|
||||
export interface WorkspaceSetting_TagRecommendationConfig {
|
||||
/** enabled controls whether tag recommendation is enabled. */
|
||||
enabled: boolean;
|
||||
/** system_prompt is the custom system prompt for tag recommendation. */
|
||||
systemPrompt: string;
|
||||
/** requests_per_minute is the rate limit for tag recommendation requests. */
|
||||
requestsPerMinute: number;
|
||||
}
|
||||
|
||||
/** Request message for GetWorkspaceSetting method. */
|
||||
|
|
@ -273,6 +285,38 @@ export interface UpdateWorkspaceSettingRequest {
|
|||
updateMask?: string[] | undefined;
|
||||
}
|
||||
|
||||
/** Request message for GetDefaultTagRecommendationPrompt method. */
|
||||
export interface GetDefaultTagRecommendationPromptRequest {
|
||||
}
|
||||
|
||||
/** Response message for GetDefaultTagRecommendationPrompt method. */
|
||||
export interface GetDefaultTagRecommendationPromptResponse {
|
||||
/** The default system prompt for tag recommendation. */
|
||||
systemPrompt: string;
|
||||
}
|
||||
|
||||
/** Request message for TestAiConnection method. */
|
||||
export interface TestAiConnectionRequest {
|
||||
/** base_url is the base URL for AI API. */
|
||||
baseUrl: string;
|
||||
/** api_key is the API key for AI service. */
|
||||
apiKey: string;
|
||||
/** model is the AI model to use. */
|
||||
model: string;
|
||||
/** timeout_seconds is the timeout for AI requests in seconds. */
|
||||
timeoutSeconds: number;
|
||||
}
|
||||
|
||||
/** Response message for TestAiConnection method. */
|
||||
export interface TestAiConnectionResponse {
|
||||
/** success indicates whether the connection test was successful. */
|
||||
success: boolean;
|
||||
/** message provides additional information about the test result. */
|
||||
message: string;
|
||||
/** model_info contains information about the tested model (if successful). */
|
||||
modelInfo: string;
|
||||
}
|
||||
|
||||
function createBaseWorkspaceProfile(): WorkspaceProfile {
|
||||
return { owner: "", version: "", mode: "", instanceUrl: "" };
|
||||
}
|
||||
|
|
@ -1089,7 +1133,7 @@ export const WorkspaceSetting_MemoRelatedSetting: MessageFns<WorkspaceSetting_Me
|
|||
};
|
||||
|
||||
function createBaseWorkspaceSetting_AiSetting(): WorkspaceSetting_AiSetting {
|
||||
return { enableAi: false, baseUrl: "", apiKey: "", model: "", timeoutSeconds: 0 };
|
||||
return { enableAi: false, baseUrl: "", apiKey: "", model: "", timeoutSeconds: 0, tagRecommendation: undefined };
|
||||
}
|
||||
|
||||
export const WorkspaceSetting_AiSetting: MessageFns<WorkspaceSetting_AiSetting> = {
|
||||
|
|
@ -1109,6 +1153,9 @@ export const WorkspaceSetting_AiSetting: MessageFns<WorkspaceSetting_AiSetting>
|
|||
if (message.timeoutSeconds !== 0) {
|
||||
writer.uint32(40).int32(message.timeoutSeconds);
|
||||
}
|
||||
if (message.tagRecommendation !== undefined) {
|
||||
WorkspaceSetting_TagRecommendationConfig.encode(message.tagRecommendation, writer.uint32(50).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
|
|
@ -1159,6 +1206,14 @@ export const WorkspaceSetting_AiSetting: MessageFns<WorkspaceSetting_AiSetting>
|
|||
message.timeoutSeconds = reader.int32();
|
||||
continue;
|
||||
}
|
||||
case 6: {
|
||||
if (tag !== 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.tagRecommendation = WorkspaceSetting_TagRecommendationConfig.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
|
|
@ -1178,6 +1233,79 @@ export const WorkspaceSetting_AiSetting: MessageFns<WorkspaceSetting_AiSetting>
|
|||
message.apiKey = object.apiKey ?? "";
|
||||
message.model = object.model ?? "";
|
||||
message.timeoutSeconds = object.timeoutSeconds ?? 0;
|
||||
message.tagRecommendation = (object.tagRecommendation !== undefined && object.tagRecommendation !== null)
|
||||
? WorkspaceSetting_TagRecommendationConfig.fromPartial(object.tagRecommendation)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseWorkspaceSetting_TagRecommendationConfig(): WorkspaceSetting_TagRecommendationConfig {
|
||||
return { enabled: false, systemPrompt: "", requestsPerMinute: 0 };
|
||||
}
|
||||
|
||||
export const WorkspaceSetting_TagRecommendationConfig: MessageFns<WorkspaceSetting_TagRecommendationConfig> = {
|
||||
encode(message: WorkspaceSetting_TagRecommendationConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.enabled !== false) {
|
||||
writer.uint32(8).bool(message.enabled);
|
||||
}
|
||||
if (message.systemPrompt !== "") {
|
||||
writer.uint32(18).string(message.systemPrompt);
|
||||
}
|
||||
if (message.requestsPerMinute !== 0) {
|
||||
writer.uint32(24).int32(message.requestsPerMinute);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): WorkspaceSetting_TagRecommendationConfig {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseWorkspaceSetting_TagRecommendationConfig();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.enabled = reader.bool();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.systemPrompt = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 24) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.requestsPerMinute = reader.int32();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<WorkspaceSetting_TagRecommendationConfig>): WorkspaceSetting_TagRecommendationConfig {
|
||||
return WorkspaceSetting_TagRecommendationConfig.fromPartial(base ?? {});
|
||||
},
|
||||
fromPartial(object: DeepPartial<WorkspaceSetting_TagRecommendationConfig>): WorkspaceSetting_TagRecommendationConfig {
|
||||
const message = createBaseWorkspaceSetting_TagRecommendationConfig();
|
||||
message.enabled = object.enabled ?? false;
|
||||
message.systemPrompt = object.systemPrompt ?? "";
|
||||
message.requestsPerMinute = object.requestsPerMinute ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
|
@ -1288,6 +1416,240 @@ export const UpdateWorkspaceSettingRequest: MessageFns<UpdateWorkspaceSettingReq
|
|||
},
|
||||
};
|
||||
|
||||
function createBaseGetDefaultTagRecommendationPromptRequest(): GetDefaultTagRecommendationPromptRequest {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const GetDefaultTagRecommendationPromptRequest: MessageFns<GetDefaultTagRecommendationPromptRequest> = {
|
||||
encode(_: GetDefaultTagRecommendationPromptRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): GetDefaultTagRecommendationPromptRequest {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGetDefaultTagRecommendationPromptRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<GetDefaultTagRecommendationPromptRequest>): GetDefaultTagRecommendationPromptRequest {
|
||||
return GetDefaultTagRecommendationPromptRequest.fromPartial(base ?? {});
|
||||
},
|
||||
fromPartial(_: DeepPartial<GetDefaultTagRecommendationPromptRequest>): GetDefaultTagRecommendationPromptRequest {
|
||||
const message = createBaseGetDefaultTagRecommendationPromptRequest();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseGetDefaultTagRecommendationPromptResponse(): GetDefaultTagRecommendationPromptResponse {
|
||||
return { systemPrompt: "" };
|
||||
}
|
||||
|
||||
export const GetDefaultTagRecommendationPromptResponse: MessageFns<GetDefaultTagRecommendationPromptResponse> = {
|
||||
encode(message: GetDefaultTagRecommendationPromptResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.systemPrompt !== "") {
|
||||
writer.uint32(10).string(message.systemPrompt);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): GetDefaultTagRecommendationPromptResponse {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGetDefaultTagRecommendationPromptResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.systemPrompt = reader.string();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<GetDefaultTagRecommendationPromptResponse>): GetDefaultTagRecommendationPromptResponse {
|
||||
return GetDefaultTagRecommendationPromptResponse.fromPartial(base ?? {});
|
||||
},
|
||||
fromPartial(
|
||||
object: DeepPartial<GetDefaultTagRecommendationPromptResponse>,
|
||||
): GetDefaultTagRecommendationPromptResponse {
|
||||
const message = createBaseGetDefaultTagRecommendationPromptResponse();
|
||||
message.systemPrompt = object.systemPrompt ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseTestAiConnectionRequest(): TestAiConnectionRequest {
|
||||
return { baseUrl: "", apiKey: "", model: "", timeoutSeconds: 0 };
|
||||
}
|
||||
|
||||
export const TestAiConnectionRequest: MessageFns<TestAiConnectionRequest> = {
|
||||
encode(message: TestAiConnectionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.baseUrl !== "") {
|
||||
writer.uint32(10).string(message.baseUrl);
|
||||
}
|
||||
if (message.apiKey !== "") {
|
||||
writer.uint32(18).string(message.apiKey);
|
||||
}
|
||||
if (message.model !== "") {
|
||||
writer.uint32(26).string(message.model);
|
||||
}
|
||||
if (message.timeoutSeconds !== 0) {
|
||||
writer.uint32(32).int32(message.timeoutSeconds);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): TestAiConnectionRequest {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseTestAiConnectionRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.baseUrl = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.apiKey = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.model = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 4: {
|
||||
if (tag !== 32) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.timeoutSeconds = reader.int32();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<TestAiConnectionRequest>): TestAiConnectionRequest {
|
||||
return TestAiConnectionRequest.fromPartial(base ?? {});
|
||||
},
|
||||
fromPartial(object: DeepPartial<TestAiConnectionRequest>): TestAiConnectionRequest {
|
||||
const message = createBaseTestAiConnectionRequest();
|
||||
message.baseUrl = object.baseUrl ?? "";
|
||||
message.apiKey = object.apiKey ?? "";
|
||||
message.model = object.model ?? "";
|
||||
message.timeoutSeconds = object.timeoutSeconds ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseTestAiConnectionResponse(): TestAiConnectionResponse {
|
||||
return { success: false, message: "", modelInfo: "" };
|
||||
}
|
||||
|
||||
export const TestAiConnectionResponse: MessageFns<TestAiConnectionResponse> = {
|
||||
encode(message: TestAiConnectionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.success !== false) {
|
||||
writer.uint32(8).bool(message.success);
|
||||
}
|
||||
if (message.message !== "") {
|
||||
writer.uint32(18).string(message.message);
|
||||
}
|
||||
if (message.modelInfo !== "") {
|
||||
writer.uint32(26).string(message.modelInfo);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): TestAiConnectionResponse {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseTestAiConnectionResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.success = reader.bool();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.message = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.modelInfo = reader.string();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<TestAiConnectionResponse>): TestAiConnectionResponse {
|
||||
return TestAiConnectionResponse.fromPartial(base ?? {});
|
||||
},
|
||||
fromPartial(object: DeepPartial<TestAiConnectionResponse>): TestAiConnectionResponse {
|
||||
const message = createBaseTestAiConnectionResponse();
|
||||
message.success = object.success ?? false;
|
||||
message.message = object.message ?? "";
|
||||
message.modelInfo = object.modelInfo ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
export type WorkspaceServiceDefinition = typeof WorkspaceServiceDefinition;
|
||||
export const WorkspaceServiceDefinition = {
|
||||
name: "WorkspaceService",
|
||||
|
|
@ -1487,6 +1849,137 @@ export const WorkspaceServiceDefinition = {
|
|||
},
|
||||
},
|
||||
},
|
||||
/** Gets the default system prompt for AI tag recommendations. */
|
||||
getDefaultTagRecommendationPrompt: {
|
||||
name: "GetDefaultTagRecommendationPrompt",
|
||||
requestType: GetDefaultTagRecommendationPromptRequest,
|
||||
requestStream: false,
|
||||
responseType: GetDefaultTagRecommendationPromptResponse,
|
||||
responseStream: false,
|
||||
options: {
|
||||
_unknownFields: {
|
||||
578365826: [
|
||||
new Uint8Array([
|
||||
56,
|
||||
18,
|
||||
54,
|
||||
47,
|
||||
97,
|
||||
112,
|
||||
105,
|
||||
47,
|
||||
118,
|
||||
49,
|
||||
47,
|
||||
119,
|
||||
111,
|
||||
114,
|
||||
107,
|
||||
115,
|
||||
112,
|
||||
97,
|
||||
99,
|
||||
101,
|
||||
47,
|
||||
97,
|
||||
105,
|
||||
47,
|
||||
116,
|
||||
97,
|
||||
103,
|
||||
45,
|
||||
114,
|
||||
101,
|
||||
99,
|
||||
111,
|
||||
109,
|
||||
109,
|
||||
101,
|
||||
110,
|
||||
100,
|
||||
97,
|
||||
116,
|
||||
105,
|
||||
111,
|
||||
110,
|
||||
47,
|
||||
100,
|
||||
101,
|
||||
102,
|
||||
97,
|
||||
117,
|
||||
108,
|
||||
116,
|
||||
45,
|
||||
112,
|
||||
114,
|
||||
111,
|
||||
109,
|
||||
112,
|
||||
116,
|
||||
]),
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
/** Tests AI API connection and configuration. */
|
||||
testAiConnection: {
|
||||
name: "TestAiConnection",
|
||||
requestType: TestAiConnectionRequest,
|
||||
requestStream: false,
|
||||
responseType: TestAiConnectionResponse,
|
||||
responseStream: false,
|
||||
options: {
|
||||
_unknownFields: {
|
||||
578365826: [
|
||||
new Uint8Array([
|
||||
41,
|
||||
58,
|
||||
1,
|
||||
42,
|
||||
34,
|
||||
36,
|
||||
47,
|
||||
97,
|
||||
112,
|
||||
105,
|
||||
47,
|
||||
118,
|
||||
49,
|
||||
47,
|
||||
119,
|
||||
111,
|
||||
114,
|
||||
107,
|
||||
115,
|
||||
112,
|
||||
97,
|
||||
99,
|
||||
101,
|
||||
47,
|
||||
97,
|
||||
105,
|
||||
47,
|
||||
116,
|
||||
101,
|
||||
115,
|
||||
116,
|
||||
45,
|
||||
99,
|
||||
111,
|
||||
110,
|
||||
110,
|
||||
101,
|
||||
99,
|
||||
116,
|
||||
105,
|
||||
111,
|
||||
110,
|
||||
]),
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue