foundation_models

package
v0.0.0-...-5fa7aab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenizerService_Tokenize_FullMethodName           = "/yandex.cloud.ai.foundation_models.v1.TokenizerService/Tokenize"
	TokenizerService_TokenizeCompletion_FullMethodName = "/yandex.cloud.ai.foundation_models.v1.TokenizerService/TokenizeCompletion"
)
View Source
const (
	TextGenerationAsyncService_Completion_FullMethodName = "/yandex.cloud.ai.foundation_models.v1.TextGenerationAsyncService/Completion"
)
View Source
const (
	TextGenerationService_Completion_FullMethodName = "/yandex.cloud.ai.foundation_models.v1.TextGenerationService/Completion"
)

Variables

View Source
var File_yandex_cloud_ai_foundation_models_v1_text_generation_text_generation_service_proto protoreflect.FileDescriptor
View Source
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)

View Source
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)

View Source
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"`
	// 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) 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) 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.

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

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) (TextGenerationService_CompletionClient, 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.

type TextGenerationServiceServer

type TextGenerationServiceServer interface {
	// A method for generating text completions in [synchronous mode](/docs/foundation-models/concepts/#working-mode).
	Completion(*CompletionRequest, TextGenerationService_CompletionServer) error
}

TextGenerationServiceServer is the server API for TextGenerationService service. All implementations should embed UnimplementedTextGenerationServiceServer for forward compatibility

type TextGenerationService_CompletionClient

type TextGenerationService_CompletionClient interface {
	Recv() (*CompletionResponse, error)
	grpc.ClientStream
}

type TextGenerationService_CompletionServer

type TextGenerationService_CompletionServer interface {
	Send(*CompletionResponse) error
	grpc.ServerStream
}

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.

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

type UnimplementedTextGenerationAsyncServiceServer

type UnimplementedTextGenerationAsyncServiceServer struct {
}

UnimplementedTextGenerationAsyncServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedTextGenerationAsyncServiceServer) Completion

type UnimplementedTextGenerationServiceServer

type UnimplementedTextGenerationServiceServer struct {
}

UnimplementedTextGenerationServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedTextGenerationServiceServer) Completion

type UnimplementedTokenizerServiceServer

type UnimplementedTokenizerServiceServer struct {
}

UnimplementedTokenizerServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedTokenizerServiceServer) Tokenize

func (UnimplementedTokenizerServiceServer) TokenizeCompletion

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL