Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterTextGenerationAsyncServiceServer(s grpc.ServiceRegistrar, srv TextGenerationAsyncServiceServer)
- func RegisterTextGenerationServiceServer(s grpc.ServiceRegistrar, srv TextGenerationServiceServer)
- func RegisterTokenizerServiceServer(s grpc.ServiceRegistrar, srv TokenizerServiceServer)
- type CompletionRequest
- func (*CompletionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CompletionRequest) GetCompletionOptions() *v1.CompletionOptions
- func (x *CompletionRequest) GetMessages() []*v1.Message
- func (x *CompletionRequest) GetModelUri() string
- func (x *CompletionRequest) GetTools() []*v1.Tool
- func (*CompletionRequest) ProtoMessage()
- func (x *CompletionRequest) ProtoReflect() protoreflect.Message
- func (x *CompletionRequest) Reset()
- func (m *CompletionRequest) SetCompletionOptions(v *v1.CompletionOptions)
- func (m *CompletionRequest) SetMessages(v []*v1.Message)
- func (m *CompletionRequest) SetModelUri(v string)
- func (m *CompletionRequest) SetTools(v []*v1.Tool)
- func (x *CompletionRequest) String() string
- type CompletionResponse
- func (*CompletionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CompletionResponse) GetAlternatives() []*v1.Alternative
- func (x *CompletionResponse) GetModelVersion() string
- func (x *CompletionResponse) GetUsage() *v1.ContentUsage
- func (*CompletionResponse) ProtoMessage()
- func (x *CompletionResponse) ProtoReflect() protoreflect.Message
- func (x *CompletionResponse) Reset()
- func (m *CompletionResponse) SetAlternatives(v []*v1.Alternative)
- func (m *CompletionResponse) SetModelVersion(v string)
- func (m *CompletionResponse) SetUsage(v *v1.ContentUsage)
- func (x *CompletionResponse) String() string
- type TextGenerationAsyncServiceClient
- type TextGenerationAsyncServiceServer
- type TextGenerationServiceClient
- type TextGenerationServiceServer
- type TextGenerationService_CompletionClient
- type TextGenerationService_CompletionServer
- type TokenizeRequest
- func (*TokenizeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TokenizeRequest) GetModelUri() string
- func (x *TokenizeRequest) GetText() string
- func (*TokenizeRequest) ProtoMessage()
- func (x *TokenizeRequest) ProtoReflect() protoreflect.Message
- func (x *TokenizeRequest) Reset()
- func (m *TokenizeRequest) SetModelUri(v string)
- func (m *TokenizeRequest) SetText(v string)
- func (x *TokenizeRequest) String() string
- type TokenizeResponse
- func (*TokenizeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TokenizeResponse) GetModelVersion() string
- func (x *TokenizeResponse) GetTokens() []*v1.Token
- func (*TokenizeResponse) ProtoMessage()
- func (x *TokenizeResponse) ProtoReflect() protoreflect.Message
- func (x *TokenizeResponse) Reset()
- func (m *TokenizeResponse) SetModelVersion(v string)
- func (m *TokenizeResponse) SetTokens(v []*v1.Token)
- func (x *TokenizeResponse) String() string
- type TokenizerServiceClient
- type TokenizerServiceServer
- type UnimplementedTextGenerationAsyncServiceServer
- type UnimplementedTextGenerationServiceServer
- type UnimplementedTokenizerServiceServer
- type UnsafeTextGenerationAsyncServiceServer
- type UnsafeTextGenerationServiceServer
- type UnsafeTokenizerServiceServer
Constants ¶
const ( TokenizerService_Tokenize_FullMethodName = "/yandex.cloud.ai.foundation_models.v1.TokenizerService/Tokenize" TokenizerService_TokenizeCompletion_FullMethodName = "/yandex.cloud.ai.foundation_models.v1.TokenizerService/TokenizeCompletion" )
const (
TextGenerationAsyncService_Completion_FullMethodName = "/yandex.cloud.ai.foundation_models.v1.TextGenerationAsyncService/Completion"
)
const (
TextGenerationService_Completion_FullMethodName = "/yandex.cloud.ai.foundation_models.v1.TextGenerationService/Completion"
)
Variables ¶
var File_yandex_cloud_ai_foundation_models_v1_text_generation_text_generation_service_proto protoreflect.FileDescriptor
var TextGenerationAsyncService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "yandex.cloud.ai.foundation_models.v1.TextGenerationAsyncService", HandlerType: (*TextGenerationAsyncServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Completion", Handler: _TextGenerationAsyncService_Completion_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "yandex/cloud/ai/foundation_models/v1/text_generation/text_generation_service.proto", }
TextGenerationAsyncService_ServiceDesc is the grpc.ServiceDesc for TextGenerationAsyncService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var TextGenerationService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "yandex.cloud.ai.foundation_models.v1.TextGenerationService", HandlerType: (*TextGenerationServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Completion", Handler: _TextGenerationService_Completion_Handler, ServerStreams: true, }, }, Metadata: "yandex/cloud/ai/foundation_models/v1/text_generation/text_generation_service.proto", }
TextGenerationService_ServiceDesc is the grpc.ServiceDesc for TextGenerationService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var TokenizerService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "yandex.cloud.ai.foundation_models.v1.TokenizerService", HandlerType: (*TokenizerServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Tokenize", Handler: _TokenizerService_Tokenize_Handler, }, { MethodName: "TokenizeCompletion", Handler: _TokenizerService_TokenizeCompletion_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "yandex/cloud/ai/foundation_models/v1/text_generation/text_generation_service.proto", }
TokenizerService_ServiceDesc is the grpc.ServiceDesc for TokenizerService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTextGenerationAsyncServiceServer ¶
func RegisterTextGenerationAsyncServiceServer(s grpc.ServiceRegistrar, srv TextGenerationAsyncServiceServer)
func RegisterTextGenerationServiceServer ¶
func RegisterTextGenerationServiceServer(s grpc.ServiceRegistrar, srv TextGenerationServiceServer)
func RegisterTokenizerServiceServer ¶
func RegisterTokenizerServiceServer(s grpc.ServiceRegistrar, srv TokenizerServiceServer)
Types ¶
type CompletionRequest ¶
type CompletionRequest struct { // The [ID of the model](/docs/foundation-models/concepts/yandexgpt/models) to be used for completion generation. ModelUri string `protobuf:"bytes,1,opt,name=model_uri,json=modelUri,proto3" json:"model_uri,omitempty"` // Configuration options for completion generation. CompletionOptions *v1.CompletionOptions `protobuf:"bytes,2,opt,name=completion_options,json=completionOptions,proto3" json:"completion_options,omitempty"` // A list of messages representing the context for the completion model. Messages []*v1.Message `protobuf:"bytes,3,rep,name=messages,proto3" json:"messages,omitempty"` // List of tools that are available for the model to invoke during the completion generation. // Note: This parameter is not yet supported and will be ignored if provided. Tools []*v1.Tool `protobuf:"bytes,4,rep,name=tools,proto3" json:"tools,omitempty"` // contains filtered or unexported fields }
Request for the service to generate text completion.
func (*CompletionRequest) Descriptor
deprecated
func (*CompletionRequest) Descriptor() ([]byte, []int)
Deprecated: Use CompletionRequest.ProtoReflect.Descriptor instead.
func (*CompletionRequest) GetCompletionOptions ¶
func (x *CompletionRequest) GetCompletionOptions() *v1.CompletionOptions
func (*CompletionRequest) GetMessages ¶
func (x *CompletionRequest) GetMessages() []*v1.Message
func (*CompletionRequest) GetModelUri ¶
func (x *CompletionRequest) GetModelUri() string
func (*CompletionRequest) GetTools ¶
func (x *CompletionRequest) GetTools() []*v1.Tool
func (*CompletionRequest) ProtoMessage ¶
func (*CompletionRequest) ProtoMessage()
func (*CompletionRequest) ProtoReflect ¶
func (x *CompletionRequest) ProtoReflect() protoreflect.Message
func (*CompletionRequest) Reset ¶
func (x *CompletionRequest) Reset()
func (*CompletionRequest) SetCompletionOptions ¶
func (m *CompletionRequest) SetCompletionOptions(v *v1.CompletionOptions)
func (*CompletionRequest) SetMessages ¶
func (m *CompletionRequest) SetMessages(v []*v1.Message)
func (*CompletionRequest) SetModelUri ¶
func (m *CompletionRequest) SetModelUri(v string)
func (*CompletionRequest) SetTools ¶
func (m *CompletionRequest) SetTools(v []*v1.Tool)
func (*CompletionRequest) String ¶
func (x *CompletionRequest) String() string
type CompletionResponse ¶
type CompletionResponse struct { // A list of generated completion alternatives. Alternatives []*v1.Alternative `protobuf:"bytes,1,rep,name=alternatives,proto3" json:"alternatives,omitempty"` // A set of statistics describing the number of content tokens used by the completion model. Usage *v1.ContentUsage `protobuf:"bytes,2,opt,name=usage,proto3" json:"usage,omitempty"` // The model version changes with each new releases. ModelVersion string `protobuf:"bytes,3,opt,name=model_version,json=modelVersion,proto3" json:"model_version,omitempty"` // contains filtered or unexported fields }
Response containing generated text completions.
func (*CompletionResponse) Descriptor
deprecated
func (*CompletionResponse) Descriptor() ([]byte, []int)
Deprecated: Use CompletionResponse.ProtoReflect.Descriptor instead.
func (*CompletionResponse) GetAlternatives ¶
func (x *CompletionResponse) GetAlternatives() []*v1.Alternative
func (*CompletionResponse) GetModelVersion ¶
func (x *CompletionResponse) GetModelVersion() string
func (*CompletionResponse) GetUsage ¶
func (x *CompletionResponse) GetUsage() *v1.ContentUsage
func (*CompletionResponse) ProtoMessage ¶
func (*CompletionResponse) ProtoMessage()
func (*CompletionResponse) ProtoReflect ¶
func (x *CompletionResponse) ProtoReflect() protoreflect.Message
func (*CompletionResponse) Reset ¶
func (x *CompletionResponse) Reset()
func (*CompletionResponse) SetAlternatives ¶
func (m *CompletionResponse) SetAlternatives(v []*v1.Alternative)
func (*CompletionResponse) SetModelVersion ¶
func (m *CompletionResponse) SetModelVersion(v string)
func (*CompletionResponse) SetUsage ¶
func (m *CompletionResponse) SetUsage(v *v1.ContentUsage)
func (*CompletionResponse) String ¶
func (x *CompletionResponse) String() string
type TextGenerationAsyncServiceClient ¶
type TextGenerationAsyncServiceClient interface { // A method for generating text completions in [asynchronous mode](/docs/foundation-models/concepts/#working-mode). Completion(ctx context.Context, in *CompletionRequest, opts ...grpc.CallOption) (*operation.Operation, error) }
TextGenerationAsyncServiceClient is the client API for TextGenerationAsyncService 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.
Service for asynchronous text generation.
func NewTextGenerationAsyncServiceClient ¶
func NewTextGenerationAsyncServiceClient(cc grpc.ClientConnInterface) TextGenerationAsyncServiceClient
type TextGenerationAsyncServiceServer ¶
type TextGenerationAsyncServiceServer interface { // A method for generating text completions in [asynchronous mode](/docs/foundation-models/concepts/#working-mode). Completion(context.Context, *CompletionRequest) (*operation.Operation, error) }
TextGenerationAsyncServiceServer is the server API for TextGenerationAsyncService service. All implementations should embed UnimplementedTextGenerationAsyncServiceServer for forward compatibility.
Service for asynchronous text generation.
type TextGenerationServiceClient ¶
type TextGenerationServiceClient interface { // A method for generating text completions in [synchronous mode](/docs/foundation-models/concepts/#working-mode). Completion(ctx context.Context, in *CompletionRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CompletionResponse], error) }
TextGenerationServiceClient is the client API for TextGenerationService 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.
Service for text generation.
func NewTextGenerationServiceClient ¶
func NewTextGenerationServiceClient(cc grpc.ClientConnInterface) TextGenerationServiceClient
type TextGenerationServiceServer ¶
type TextGenerationServiceServer interface { // A method for generating text completions in [synchronous mode](/docs/foundation-models/concepts/#working-mode). Completion(*CompletionRequest, grpc.ServerStreamingServer[CompletionResponse]) error }
TextGenerationServiceServer is the server API for TextGenerationService service. All implementations should embed UnimplementedTextGenerationServiceServer for forward compatibility.
Service for text generation.
type TextGenerationService_CompletionClient ¶
type TextGenerationService_CompletionClient = grpc.ServerStreamingClient[CompletionResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type TextGenerationService_CompletionServer ¶
type TextGenerationService_CompletionServer = grpc.ServerStreamingServer[CompletionResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type TokenizeRequest ¶
type TokenizeRequest struct { // The identifier of the model to be used for tokenization. ModelUri string `protobuf:"bytes,1,opt,name=model_uri,json=modelUri,proto3" json:"model_uri,omitempty"` // Text to be tokenized. Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` // contains filtered or unexported fields }
Request for the service to tokenize input text.
func (*TokenizeRequest) Descriptor
deprecated
func (*TokenizeRequest) Descriptor() ([]byte, []int)
Deprecated: Use TokenizeRequest.ProtoReflect.Descriptor instead.
func (*TokenizeRequest) GetModelUri ¶
func (x *TokenizeRequest) GetModelUri() string
func (*TokenizeRequest) GetText ¶
func (x *TokenizeRequest) GetText() string
func (*TokenizeRequest) ProtoMessage ¶
func (*TokenizeRequest) ProtoMessage()
func (*TokenizeRequest) ProtoReflect ¶
func (x *TokenizeRequest) ProtoReflect() protoreflect.Message
func (*TokenizeRequest) Reset ¶
func (x *TokenizeRequest) Reset()
func (*TokenizeRequest) SetModelUri ¶
func (m *TokenizeRequest) SetModelUri(v string)
func (*TokenizeRequest) SetText ¶
func (m *TokenizeRequest) SetText(v string)
func (*TokenizeRequest) String ¶
func (x *TokenizeRequest) String() string
type TokenizeResponse ¶
type TokenizeResponse struct { // A list of tokens obtained from tokenization. Tokens []*v1.Token `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"` // Model version (changes with model releases). ModelVersion string `protobuf:"bytes,2,opt,name=model_version,json=modelVersion,proto3" json:"model_version,omitempty"` // contains filtered or unexported fields }
Response containing tokenized content from request.
func (*TokenizeResponse) Descriptor
deprecated
func (*TokenizeResponse) Descriptor() ([]byte, []int)
Deprecated: Use TokenizeResponse.ProtoReflect.Descriptor instead.
func (*TokenizeResponse) GetModelVersion ¶
func (x *TokenizeResponse) GetModelVersion() string
func (*TokenizeResponse) GetTokens ¶
func (x *TokenizeResponse) GetTokens() []*v1.Token
func (*TokenizeResponse) ProtoMessage ¶
func (*TokenizeResponse) ProtoMessage()
func (*TokenizeResponse) ProtoReflect ¶
func (x *TokenizeResponse) ProtoReflect() protoreflect.Message
func (*TokenizeResponse) Reset ¶
func (x *TokenizeResponse) Reset()
func (*TokenizeResponse) SetModelVersion ¶
func (m *TokenizeResponse) SetModelVersion(v string)
func (*TokenizeResponse) SetTokens ¶
func (m *TokenizeResponse) SetTokens(v []*v1.Token)
func (*TokenizeResponse) String ¶
func (x *TokenizeResponse) String() string
type TokenizerServiceClient ¶
type TokenizerServiceClient interface { // RPC method for tokenizing text. Tokenize(ctx context.Context, in *TokenizeRequest, opts ...grpc.CallOption) (*TokenizeResponse, error) // RPC method for tokenizing content of CompletionRequest TokenizeCompletion(ctx context.Context, in *CompletionRequest, opts ...grpc.CallOption) (*TokenizeResponse, error) }
TokenizerServiceClient is the client API for TokenizerService 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.
Service for tokenizing input content.
func NewTokenizerServiceClient ¶
func NewTokenizerServiceClient(cc grpc.ClientConnInterface) TokenizerServiceClient
type TokenizerServiceServer ¶
type TokenizerServiceServer interface { // RPC method for tokenizing text. Tokenize(context.Context, *TokenizeRequest) (*TokenizeResponse, error) // RPC method for tokenizing content of CompletionRequest TokenizeCompletion(context.Context, *CompletionRequest) (*TokenizeResponse, error) }
TokenizerServiceServer is the server API for TokenizerService service. All implementations should embed UnimplementedTokenizerServiceServer for forward compatibility.
Service for tokenizing input content.
type UnimplementedTextGenerationAsyncServiceServer ¶
type UnimplementedTextGenerationAsyncServiceServer struct{}
UnimplementedTextGenerationAsyncServiceServer should 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.
func (UnimplementedTextGenerationAsyncServiceServer) Completion ¶
func (UnimplementedTextGenerationAsyncServiceServer) Completion(context.Context, *CompletionRequest) (*operation.Operation, error)
type UnimplementedTextGenerationServiceServer ¶
type UnimplementedTextGenerationServiceServer struct{}
UnimplementedTextGenerationServiceServer should 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.
func (UnimplementedTextGenerationServiceServer) Completion ¶
func (UnimplementedTextGenerationServiceServer) Completion(*CompletionRequest, grpc.ServerStreamingServer[CompletionResponse]) error
type UnimplementedTokenizerServiceServer ¶
type UnimplementedTokenizerServiceServer struct{}
UnimplementedTokenizerServiceServer should 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.
func (UnimplementedTokenizerServiceServer) Tokenize ¶
func (UnimplementedTokenizerServiceServer) Tokenize(context.Context, *TokenizeRequest) (*TokenizeResponse, error)
func (UnimplementedTokenizerServiceServer) TokenizeCompletion ¶
func (UnimplementedTokenizerServiceServer) TokenizeCompletion(context.Context, *CompletionRequest) (*TokenizeResponse, error)
type UnsafeTextGenerationAsyncServiceServer ¶
type UnsafeTextGenerationAsyncServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTextGenerationAsyncServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TextGenerationAsyncServiceServer will result in compilation errors.
type UnsafeTextGenerationServiceServer ¶
type UnsafeTextGenerationServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTextGenerationServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TextGenerationServiceServer will result in compilation errors.
type UnsafeTokenizerServiceServer ¶
type UnsafeTokenizerServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTokenizerServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TokenizerServiceServer will result in compilation errors.