added compiled files
This commit is contained in:
parent
da8d12f60f
commit
cba3ba96d4
8
go.mod
Normal file
8
go.mod
Normal file
@ -0,0 +1,8 @@
|
||||
module git.be.kaien.ru/l-ai/l-ai-memories-proto
|
||||
|
||||
go 1.23.0
|
||||
|
||||
require (
|
||||
google.golang.org/grpc v1.70.0
|
||||
google.golang.org/protobuf v1.36.8
|
||||
)
|
||||
28
go.sum
Normal file
28
go.sum
Normal file
@ -0,0 +1,28 @@
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjct50S05LHfA9rX5+Zxpt0o0NriR7NvWL9jHs=
|
||||
go.opentelemetry.io/otel v1.32.0/go.mod h1:00qWKQJiB+6JF3vJhVh07yvJbMj0msMDs8p7D2ePpR8=
|
||||
go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Cx5bS1JVpZC04jHWH2Qs=
|
||||
go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:j+8fMOE0iDhF2i2mJskh+R0rJhSY+Lg6JtWZsxqC8Kk=
|
||||
go.opentelemetry.io/otel/sdk v1.32.0 h1:Y5+/x71s0OjN8f0Q9lqWkS9+gX5t4cCLb9X2W4k5j3A=
|
||||
go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:0S2tWOA56v2HfVPbTlPZ7xk3x3T5jJ7hF5lR14S8nNY=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:qQlFjZ50T3q7QJj30P+gN9hPfJyQ4rC5dPc5gXJv1ks=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:0S0k8pZNh5fK5vG5WmZxJxgNqzT5k3YvM5q70hF0+J0=
|
||||
go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9K7rYkIb7wUqsxD7T5s+Gve2S1MS8BQ5hTbU/4XE=
|
||||
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:00qWKQJiB+6JF3vJhVh07yvJbMj0msMDs8p7D2ePpR8=
|
||||
golang.org/x/net v0.43.0 h1:lat02VYK2D4cWo2FyMjT+jWkKYl6xjyMQdyJyL5wZ7Y=
|
||||
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7q9L8e1H9LQgd9+wvs=
|
||||
golang.org/x/sys v0.35.0 h1:vzNhUv6h+b2P9YJXP4p4hRkcMWMWoVdarsTqvi8dU50=
|
||||
golang.org/x/sys v0.35.0/go.mod h1:BJPd2odD/Ob2WBhK37b2DkrczRCDUrn9XKPGj9T52qA=
|
||||
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
|
||||
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuYpsuPzDRCtZrB3ePQr8OSBpK3+KjwZ4G4gA=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:qQ0YXyHHx3xkPhytL7Gw7KBJn1yABzn5MvPMh2zFBZ0=
|
||||
google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdJ7jQ=
|
||||
google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr9IG4Qqb9k8s1bZBXP/GKOFQwY0=
|
||||
google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEcLUtSCT9Gv2R3zWNXwlNi2GGNpSISs=
|
||||
google.golang.org/protobuf v1.36.8/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YlXBfFM=
|
||||
808
memory.pb.go
Normal file
808
memory.pb.go
Normal file
@ -0,0 +1,808 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v7.34.0
|
||||
// source: memory.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Memory представляет воспоминание о пользователе
|
||||
type Memory struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
|
||||
Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"` // Уникальный ключ факта
|
||||
Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` // Значение факта
|
||||
Category string `protobuf:"bytes,6,opt,name=category,proto3" json:"category,omitempty"` // preference, fact, personality, relationship
|
||||
Priority string `protobuf:"bytes,7,opt,name=priority,proto3" json:"priority,omitempty"` // core, normal
|
||||
Confidence float64 `protobuf:"fixed64,8,opt,name=confidence,proto3" json:"confidence,omitempty"` // 0.0 - 1.0
|
||||
Tags []string `protobuf:"bytes,9,rep,name=tags,proto3" json:"tags,omitempty"`
|
||||
Source string `protobuf:"bytes,10,opt,name=source,proto3" json:"source,omitempty"`
|
||||
CreatedAt int64 `protobuf:"varint,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt int64 `protobuf:"varint,12,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Memory) Reset() {
|
||||
*x = Memory{}
|
||||
mi := &file_memory_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Memory) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Memory) ProtoMessage() {}
|
||||
|
||||
func (x *Memory) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_memory_proto_msgTypes[0]
|
||||
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 Memory.ProtoReflect.Descriptor instead.
|
||||
func (*Memory) Descriptor() ([]byte, []int) {
|
||||
return file_memory_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Memory) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Memory) GetUserId() int64 {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Memory) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Memory) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Memory) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Memory) GetCategory() string {
|
||||
if x != nil {
|
||||
return x.Category
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Memory) GetPriority() string {
|
||||
if x != nil {
|
||||
return x.Priority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Memory) GetConfidence() float64 {
|
||||
if x != nil {
|
||||
return x.Confidence
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Memory) GetTags() []string {
|
||||
if x != nil {
|
||||
return x.Tags
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Memory) GetSource() string {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Memory) GetCreatedAt() int64 {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Memory) GetUpdatedAt() int64 {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// StoreMemoryRequest запрос на сохранение воспоминания
|
||||
type StoreMemoryRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
|
||||
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
|
||||
Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"`
|
||||
Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"`
|
||||
Category string `protobuf:"bytes,6,opt,name=category,proto3" json:"category,omitempty"`
|
||||
Priority string `protobuf:"bytes,7,opt,name=priority,proto3" json:"priority,omitempty"`
|
||||
Confidence float64 `protobuf:"fixed64,8,opt,name=confidence,proto3" json:"confidence,omitempty"`
|
||||
Tags []string `protobuf:"bytes,9,rep,name=tags,proto3" json:"tags,omitempty"`
|
||||
Source string `protobuf:"bytes,10,opt,name=source,proto3" json:"source,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StoreMemoryRequest) Reset() {
|
||||
*x = StoreMemoryRequest{}
|
||||
mi := &file_memory_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StoreMemoryRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StoreMemoryRequest) ProtoMessage() {}
|
||||
|
||||
func (x *StoreMemoryRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_memory_proto_msgTypes[1]
|
||||
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 StoreMemoryRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StoreMemoryRequest) Descriptor() ([]byte, []int) {
|
||||
return file_memory_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *StoreMemoryRequest) GetUserId() int64 {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *StoreMemoryRequest) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StoreMemoryRequest) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StoreMemoryRequest) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StoreMemoryRequest) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StoreMemoryRequest) GetCategory() string {
|
||||
if x != nil {
|
||||
return x.Category
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StoreMemoryRequest) GetPriority() string {
|
||||
if x != nil {
|
||||
return x.Priority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StoreMemoryRequest) GetConfidence() float64 {
|
||||
if x != nil {
|
||||
return x.Confidence
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *StoreMemoryRequest) GetTags() []string {
|
||||
if x != nil {
|
||||
return x.Tags
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *StoreMemoryRequest) GetSource() string {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// StoreMemoryResponse ответ на сохранение воспоминания
|
||||
type StoreMemoryResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
|
||||
MemoryId int64 `protobuf:"varint,3,opt,name=memory_id,json=memoryId,proto3" json:"memory_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StoreMemoryResponse) Reset() {
|
||||
*x = StoreMemoryResponse{}
|
||||
mi := &file_memory_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StoreMemoryResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StoreMemoryResponse) ProtoMessage() {}
|
||||
|
||||
func (x *StoreMemoryResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_memory_proto_msgTypes[2]
|
||||
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 StoreMemoryResponse.ProtoReflect.Descriptor instead.
|
||||
func (*StoreMemoryResponse) Descriptor() ([]byte, []int) {
|
||||
return file_memory_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *StoreMemoryResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *StoreMemoryResponse) GetError() string {
|
||||
if x != nil {
|
||||
return x.Error
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StoreMemoryResponse) GetMemoryId() int64 {
|
||||
if x != nil {
|
||||
return x.MemoryId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetMemoriesRequest запрос на получение воспоминаний
|
||||
type GetMemoriesRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
|
||||
Tags []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"`
|
||||
SearchQuery string `protobuf:"bytes,4,opt,name=search_query,json=searchQuery,proto3" json:"search_query,omitempty"`
|
||||
Limit int32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetMemoriesRequest) Reset() {
|
||||
*x = GetMemoriesRequest{}
|
||||
mi := &file_memory_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetMemoriesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetMemoriesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetMemoriesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_memory_proto_msgTypes[3]
|
||||
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 GetMemoriesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetMemoriesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_memory_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *GetMemoriesRequest) GetUserId() int64 {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetMemoriesRequest) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetMemoriesRequest) GetTags() []string {
|
||||
if x != nil {
|
||||
return x.Tags
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetMemoriesRequest) GetSearchQuery() string {
|
||||
if x != nil {
|
||||
return x.SearchQuery
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetMemoriesRequest) GetLimit() int32 {
|
||||
if x != nil {
|
||||
return x.Limit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetMemoriesResponse ответ с воспоминаниями
|
||||
type GetMemoriesResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Memories []*Memory `protobuf:"bytes,1,rep,name=memories,proto3" json:"memories,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetMemoriesResponse) Reset() {
|
||||
*x = GetMemoriesResponse{}
|
||||
mi := &file_memory_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetMemoriesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetMemoriesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetMemoriesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_memory_proto_msgTypes[4]
|
||||
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 GetMemoriesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetMemoriesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_memory_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *GetMemoriesResponse) GetMemories() []*Memory {
|
||||
if x != nil {
|
||||
return x.Memories
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ProcessMessageRequest запрос на обработку сообщения для извлечения фактов
|
||||
type ProcessMessageRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
|
||||
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
|
||||
Context string `protobuf:"bytes,4,opt,name=context,proto3" json:"context,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ProcessMessageRequest) Reset() {
|
||||
*x = ProcessMessageRequest{}
|
||||
mi := &file_memory_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ProcessMessageRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ProcessMessageRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ProcessMessageRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_memory_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 ProcessMessageRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ProcessMessageRequest) Descriptor() ([]byte, []int) {
|
||||
return file_memory_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ProcessMessageRequest) GetUserId() int64 {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ProcessMessageRequest) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ProcessMessageRequest) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ProcessMessageRequest) GetContext() string {
|
||||
if x != nil {
|
||||
return x.Context
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// ProcessMessageResponse ответ с извлечёнными фактами
|
||||
type ProcessMessageResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
|
||||
FactsExtracted int32 `protobuf:"varint,3,opt,name=facts_extracted,json=factsExtracted,proto3" json:"facts_extracted,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ProcessMessageResponse) Reset() {
|
||||
*x = ProcessMessageResponse{}
|
||||
mi := &file_memory_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ProcessMessageResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ProcessMessageResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ProcessMessageResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_memory_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 ProcessMessageResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ProcessMessageResponse) Descriptor() ([]byte, []int) {
|
||||
return file_memory_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *ProcessMessageResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ProcessMessageResponse) GetError() string {
|
||||
if x != nil {
|
||||
return x.Error
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ProcessMessageResponse) GetFactsExtracted() int32 {
|
||||
if x != nil {
|
||||
return x.FactsExtracted
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// HealthCheckRequest для проверки здоровья сервиса
|
||||
type HealthCheckRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *HealthCheckRequest) Reset() {
|
||||
*x = HealthCheckRequest{}
|
||||
mi := &file_memory_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *HealthCheckRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HealthCheckRequest) ProtoMessage() {}
|
||||
|
||||
func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_memory_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 HealthCheckRequest.ProtoReflect.Descriptor instead.
|
||||
func (*HealthCheckRequest) Descriptor() ([]byte, []int) {
|
||||
return file_memory_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
// HealthCheckResponse для ответа на проверку здоровья
|
||||
type HealthCheckResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Serving bool `protobuf:"varint,1,opt,name=serving,proto3" json:"serving,omitempty"`
|
||||
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *HealthCheckResponse) Reset() {
|
||||
*x = HealthCheckResponse{}
|
||||
mi := &file_memory_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *HealthCheckResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HealthCheckResponse) ProtoMessage() {}
|
||||
|
||||
func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_memory_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 HealthCheckResponse.ProtoReflect.Descriptor instead.
|
||||
func (*HealthCheckResponse) Descriptor() ([]byte, []int) {
|
||||
return file_memory_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *HealthCheckResponse) GetServing() bool {
|
||||
if x != nil {
|
||||
return x.Serving
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *HealthCheckResponse) GetVersion() string {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_memory_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_memory_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\fmemory.proto\x12\x06memory\"\xb7\x02\n" +
|
||||
"\x06Memory\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x17\n" +
|
||||
"\auser_id\x18\x02 \x01(\x03R\x06userId\x12\x1a\n" +
|
||||
"\busername\x18\x03 \x01(\tR\busername\x12\x10\n" +
|
||||
"\x03key\x18\x04 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05value\x18\x05 \x01(\tR\x05value\x12\x1a\n" +
|
||||
"\bcategory\x18\x06 \x01(\tR\bcategory\x12\x1a\n" +
|
||||
"\bpriority\x18\a \x01(\tR\bpriority\x12\x1e\n" +
|
||||
"\n" +
|
||||
"confidence\x18\b \x01(\x01R\n" +
|
||||
"confidence\x12\x12\n" +
|
||||
"\x04tags\x18\t \x03(\tR\x04tags\x12\x16\n" +
|
||||
"\x06source\x18\n" +
|
||||
" \x01(\tR\x06source\x12\x1d\n" +
|
||||
"\n" +
|
||||
"created_at\x18\v \x01(\x03R\tcreatedAt\x12\x1d\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\f \x01(\x03R\tupdatedAt\"\x8f\x02\n" +
|
||||
"\x12StoreMemoryRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\x03R\x06userId\x12\x1a\n" +
|
||||
"\busername\x18\x02 \x01(\tR\busername\x12\x18\n" +
|
||||
"\amessage\x18\x03 \x01(\tR\amessage\x12\x10\n" +
|
||||
"\x03key\x18\x04 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05value\x18\x05 \x01(\tR\x05value\x12\x1a\n" +
|
||||
"\bcategory\x18\x06 \x01(\tR\bcategory\x12\x1a\n" +
|
||||
"\bpriority\x18\a \x01(\tR\bpriority\x12\x1e\n" +
|
||||
"\n" +
|
||||
"confidence\x18\b \x01(\x01R\n" +
|
||||
"confidence\x12\x12\n" +
|
||||
"\x04tags\x18\t \x03(\tR\x04tags\x12\x16\n" +
|
||||
"\x06source\x18\n" +
|
||||
" \x01(\tR\x06source\"b\n" +
|
||||
"\x13StoreMemoryResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x14\n" +
|
||||
"\x05error\x18\x02 \x01(\tR\x05error\x12\x1b\n" +
|
||||
"\tmemory_id\x18\x03 \x01(\x03R\bmemoryId\"\x96\x01\n" +
|
||||
"\x12GetMemoriesRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\x03R\x06userId\x12\x1a\n" +
|
||||
"\busername\x18\x02 \x01(\tR\busername\x12\x12\n" +
|
||||
"\x04tags\x18\x03 \x03(\tR\x04tags\x12!\n" +
|
||||
"\fsearch_query\x18\x04 \x01(\tR\vsearchQuery\x12\x14\n" +
|
||||
"\x05limit\x18\x05 \x01(\x05R\x05limit\"A\n" +
|
||||
"\x13GetMemoriesResponse\x12*\n" +
|
||||
"\bmemories\x18\x01 \x03(\v2\x0e.memory.MemoryR\bmemories\"\x80\x01\n" +
|
||||
"\x15ProcessMessageRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\x03R\x06userId\x12\x1a\n" +
|
||||
"\busername\x18\x02 \x01(\tR\busername\x12\x18\n" +
|
||||
"\amessage\x18\x03 \x01(\tR\amessage\x12\x18\n" +
|
||||
"\acontext\x18\x04 \x01(\tR\acontext\"q\n" +
|
||||
"\x16ProcessMessageResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x14\n" +
|
||||
"\x05error\x18\x02 \x01(\tR\x05error\x12'\n" +
|
||||
"\x0ffacts_extracted\x18\x03 \x01(\x05R\x0efactsExtracted\"\x14\n" +
|
||||
"\x12HealthCheckRequest\"I\n" +
|
||||
"\x13HealthCheckResponse\x12\x18\n" +
|
||||
"\aserving\x18\x01 \x01(\bR\aserving\x12\x18\n" +
|
||||
"\aversion\x18\x02 \x01(\tR\aversion2\xb8\x02\n" +
|
||||
"\rMemoryService\x12F\n" +
|
||||
"\vStoreMemory\x12\x1a.memory.StoreMemoryRequest\x1a\x1b.memory.StoreMemoryResponse\x12F\n" +
|
||||
"\vGetMemories\x12\x1a.memory.GetMemoriesRequest\x1a\x1b.memory.GetMemoriesResponse\x12O\n" +
|
||||
"\x0eProcessMessage\x12\x1d.memory.ProcessMessageRequest\x1a\x1e.memory.ProcessMessageResponse\x12F\n" +
|
||||
"\vHealthCheck\x12\x1a.memory.HealthCheckRequest\x1a\x1b.memory.HealthCheckResponseB*Z(git.be.kaien.ru/l-ai/l-ai-memories/protob\x06proto3"
|
||||
|
||||
var (
|
||||
file_memory_proto_rawDescOnce sync.Once
|
||||
file_memory_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_memory_proto_rawDescGZIP() []byte {
|
||||
file_memory_proto_rawDescOnce.Do(func() {
|
||||
file_memory_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_memory_proto_rawDesc), len(file_memory_proto_rawDesc)))
|
||||
})
|
||||
return file_memory_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_memory_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||
var file_memory_proto_goTypes = []any{
|
||||
(*Memory)(nil), // 0: memory.Memory
|
||||
(*StoreMemoryRequest)(nil), // 1: memory.StoreMemoryRequest
|
||||
(*StoreMemoryResponse)(nil), // 2: memory.StoreMemoryResponse
|
||||
(*GetMemoriesRequest)(nil), // 3: memory.GetMemoriesRequest
|
||||
(*GetMemoriesResponse)(nil), // 4: memory.GetMemoriesResponse
|
||||
(*ProcessMessageRequest)(nil), // 5: memory.ProcessMessageRequest
|
||||
(*ProcessMessageResponse)(nil), // 6: memory.ProcessMessageResponse
|
||||
(*HealthCheckRequest)(nil), // 7: memory.HealthCheckRequest
|
||||
(*HealthCheckResponse)(nil), // 8: memory.HealthCheckResponse
|
||||
}
|
||||
var file_memory_proto_depIdxs = []int32{
|
||||
0, // 0: memory.GetMemoriesResponse.memories:type_name -> memory.Memory
|
||||
1, // 1: memory.MemoryService.StoreMemory:input_type -> memory.StoreMemoryRequest
|
||||
3, // 2: memory.MemoryService.GetMemories:input_type -> memory.GetMemoriesRequest
|
||||
5, // 3: memory.MemoryService.ProcessMessage:input_type -> memory.ProcessMessageRequest
|
||||
7, // 4: memory.MemoryService.HealthCheck:input_type -> memory.HealthCheckRequest
|
||||
2, // 5: memory.MemoryService.StoreMemory:output_type -> memory.StoreMemoryResponse
|
||||
4, // 6: memory.MemoryService.GetMemories:output_type -> memory.GetMemoriesResponse
|
||||
6, // 7: memory.MemoryService.ProcessMessage:output_type -> memory.ProcessMessageResponse
|
||||
8, // 8: memory.MemoryService.HealthCheck:output_type -> memory.HealthCheckResponse
|
||||
5, // [5:9] is the sub-list for method output_type
|
||||
1, // [1:5] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_memory_proto_init() }
|
||||
func file_memory_proto_init() {
|
||||
if File_memory_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_memory_proto_rawDesc), len(file_memory_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 9,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_memory_proto_goTypes,
|
||||
DependencyIndexes: file_memory_proto_depIdxs,
|
||||
MessageInfos: file_memory_proto_msgTypes,
|
||||
}.Build()
|
||||
File_memory_proto = out.File
|
||||
file_memory_proto_goTypes = nil
|
||||
file_memory_proto_depIdxs = nil
|
||||
}
|
||||
247
memory_grpc.pb.go
Normal file
247
memory_grpc.pb.go
Normal file
@ -0,0 +1,247 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v7.34.0
|
||||
// source: memory.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
MemoryService_StoreMemory_FullMethodName = "/memory.MemoryService/StoreMemory"
|
||||
MemoryService_GetMemories_FullMethodName = "/memory.MemoryService/GetMemories"
|
||||
MemoryService_ProcessMessage_FullMethodName = "/memory.MemoryService/ProcessMessage"
|
||||
MemoryService_HealthCheck_FullMethodName = "/memory.MemoryService/HealthCheck"
|
||||
)
|
||||
|
||||
// MemoryServiceClient is the client API for MemoryService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// MemoryService - сервис для работы с памятью
|
||||
type MemoryServiceClient interface {
|
||||
// StoreMemory сохраняет воспоминание
|
||||
StoreMemory(ctx context.Context, in *StoreMemoryRequest, opts ...grpc.CallOption) (*StoreMemoryResponse, error)
|
||||
// GetMemories получает воспоминания пользователя
|
||||
GetMemories(ctx context.Context, in *GetMemoriesRequest, opts ...grpc.CallOption) (*GetMemoriesResponse, error)
|
||||
// ProcessMessage обрабатывает сообщение и извлекает факты
|
||||
ProcessMessage(ctx context.Context, in *ProcessMessageRequest, opts ...grpc.CallOption) (*ProcessMessageResponse, error)
|
||||
// HealthCheck проверяет здоровье сервиса
|
||||
HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
|
||||
}
|
||||
|
||||
type memoryServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewMemoryServiceClient(cc grpc.ClientConnInterface) MemoryServiceClient {
|
||||
return &memoryServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *memoryServiceClient) StoreMemory(ctx context.Context, in *StoreMemoryRequest, opts ...grpc.CallOption) (*StoreMemoryResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StoreMemoryResponse)
|
||||
err := c.cc.Invoke(ctx, MemoryService_StoreMemory_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoryServiceClient) GetMemories(ctx context.Context, in *GetMemoriesRequest, opts ...grpc.CallOption) (*GetMemoriesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetMemoriesResponse)
|
||||
err := c.cc.Invoke(ctx, MemoryService_GetMemories_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoryServiceClient) ProcessMessage(ctx context.Context, in *ProcessMessageRequest, opts ...grpc.CallOption) (*ProcessMessageResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ProcessMessageResponse)
|
||||
err := c.cc.Invoke(ctx, MemoryService_ProcessMessage_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoryServiceClient) HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(HealthCheckResponse)
|
||||
err := c.cc.Invoke(ctx, MemoryService_HealthCheck_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MemoryServiceServer is the server API for MemoryService service.
|
||||
// All implementations must embed UnimplementedMemoryServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// MemoryService - сервис для работы с памятью
|
||||
type MemoryServiceServer interface {
|
||||
// StoreMemory сохраняет воспоминание
|
||||
StoreMemory(context.Context, *StoreMemoryRequest) (*StoreMemoryResponse, error)
|
||||
// GetMemories получает воспоминания пользователя
|
||||
GetMemories(context.Context, *GetMemoriesRequest) (*GetMemoriesResponse, error)
|
||||
// ProcessMessage обрабатывает сообщение и извлекает факты
|
||||
ProcessMessage(context.Context, *ProcessMessageRequest) (*ProcessMessageResponse, error)
|
||||
// HealthCheck проверяет здоровье сервиса
|
||||
HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
|
||||
mustEmbedUnimplementedMemoryServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedMemoryServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedMemoryServiceServer struct{}
|
||||
|
||||
func (UnimplementedMemoryServiceServer) StoreMemory(context.Context, *StoreMemoryRequest) (*StoreMemoryResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method StoreMemory not implemented")
|
||||
}
|
||||
func (UnimplementedMemoryServiceServer) GetMemories(context.Context, *GetMemoriesRequest) (*GetMemoriesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetMemories not implemented")
|
||||
}
|
||||
func (UnimplementedMemoryServiceServer) ProcessMessage(context.Context, *ProcessMessageRequest) (*ProcessMessageResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ProcessMessage not implemented")
|
||||
}
|
||||
func (UnimplementedMemoryServiceServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method HealthCheck not implemented")
|
||||
}
|
||||
func (UnimplementedMemoryServiceServer) mustEmbedUnimplementedMemoryServiceServer() {}
|
||||
func (UnimplementedMemoryServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeMemoryServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to MemoryServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeMemoryServiceServer interface {
|
||||
mustEmbedUnimplementedMemoryServiceServer()
|
||||
}
|
||||
|
||||
func RegisterMemoryServiceServer(s grpc.ServiceRegistrar, srv MemoryServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedMemoryServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&MemoryService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _MemoryService_StoreMemory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StoreMemoryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoryServiceServer).StoreMemory(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoryService_StoreMemory_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoryServiceServer).StoreMemory(ctx, req.(*StoreMemoryRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoryService_GetMemories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetMemoriesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoryServiceServer).GetMemories(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoryService_GetMemories_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoryServiceServer).GetMemories(ctx, req.(*GetMemoriesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoryService_ProcessMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ProcessMessageRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoryServiceServer).ProcessMessage(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoryService_ProcessMessage_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoryServiceServer).ProcessMessage(ctx, req.(*ProcessMessageRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoryService_HealthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(HealthCheckRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoryServiceServer).HealthCheck(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoryService_HealthCheck_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoryServiceServer).HealthCheck(ctx, req.(*HealthCheckRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// MemoryService_ServiceDesc is the grpc.ServiceDesc for MemoryService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var MemoryService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "memory.MemoryService",
|
||||
HandlerType: (*MemoryServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "StoreMemory",
|
||||
Handler: _MemoryService_StoreMemory_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetMemories",
|
||||
Handler: _MemoryService_GetMemories_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ProcessMessage",
|
||||
Handler: _MemoryService_ProcessMessage_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "HealthCheck",
|
||||
Handler: _MemoryService_HealthCheck_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "memory.proto",
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user