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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmbeddingsService_TextEmbedding_FullMethodName = "/yandex.cloud.ai.foundation_models.v1.EmbeddingsService/TextEmbedding"
)

Variables

View Source
var EmbeddingsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.ai.foundation_models.v1.EmbeddingsService",
	HandlerType: (*EmbeddingsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "TextEmbedding",
			Handler:    _EmbeddingsService_TextEmbedding_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/ai/foundation_models/v1/embedding/embedding_service.proto",
}

EmbeddingsService_ServiceDesc is the grpc.ServiceDesc for EmbeddingsService 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 File_yandex_cloud_ai_foundation_models_v1_embedding_embedding_service_proto protoreflect.FileDescriptor

Functions

func RegisterEmbeddingsServiceServer

func RegisterEmbeddingsServiceServer(s grpc.ServiceRegistrar, srv EmbeddingsServiceServer)

Types

type EmbeddingsServiceClient

type EmbeddingsServiceClient interface {
	// A method for obtaining embeddings from text data.
	TextEmbedding(ctx context.Context, in *TextEmbeddingRequest, opts ...grpc.CallOption) (*TextEmbeddingResponse, error)
}

EmbeddingsServiceClient is the client API for EmbeddingsService 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 EmbeddingsServiceServer

type EmbeddingsServiceServer interface {
	// A method for obtaining embeddings from text data.
	TextEmbedding(context.Context, *TextEmbeddingRequest) (*TextEmbeddingResponse, error)
}

EmbeddingsServiceServer is the server API for EmbeddingsService service. All implementations should embed UnimplementedEmbeddingsServiceServer for forward compatibility

type TextEmbeddingRequest

type TextEmbeddingRequest struct {

	// The [ID of the model](/docs/foundation-models/concepts/embeddings) to be used for obtaining text embeddings.
	ModelUri string `protobuf:"bytes,1,opt,name=model_uri,json=modelUri,proto3" json:"model_uri,omitempty"`
	// The input text for which the embedding is requested.
	Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

Request for the service to obtain text embeddings.

func (*TextEmbeddingRequest) Descriptor deprecated

func (*TextEmbeddingRequest) Descriptor() ([]byte, []int)

Deprecated: Use TextEmbeddingRequest.ProtoReflect.Descriptor instead.

func (*TextEmbeddingRequest) GetModelUri

func (x *TextEmbeddingRequest) GetModelUri() string

func (*TextEmbeddingRequest) GetText

func (x *TextEmbeddingRequest) GetText() string

func (*TextEmbeddingRequest) ProtoMessage

func (*TextEmbeddingRequest) ProtoMessage()

func (*TextEmbeddingRequest) ProtoReflect

func (x *TextEmbeddingRequest) ProtoReflect() protoreflect.Message

func (*TextEmbeddingRequest) Reset

func (x *TextEmbeddingRequest) Reset()

func (*TextEmbeddingRequest) SetModelUri

func (m *TextEmbeddingRequest) SetModelUri(v string)

func (*TextEmbeddingRequest) SetText

func (m *TextEmbeddingRequest) SetText(v string)

func (*TextEmbeddingRequest) String

func (x *TextEmbeddingRequest) String() string

type TextEmbeddingResponse

type TextEmbeddingResponse struct {

	// A repeated list of double values representing the embedding.
	Embedding []float64 `protobuf:"fixed64,1,rep,packed,name=embedding,proto3" json:"embedding,omitempty"`
	// The number of tokens in the input text.
	NumTokens int64 `protobuf:"varint,2,opt,name=num_tokens,json=numTokens,proto3" json:"num_tokens,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 embedding.

func (*TextEmbeddingResponse) Descriptor deprecated

func (*TextEmbeddingResponse) Descriptor() ([]byte, []int)

Deprecated: Use TextEmbeddingResponse.ProtoReflect.Descriptor instead.

func (*TextEmbeddingResponse) GetEmbedding

func (x *TextEmbeddingResponse) GetEmbedding() []float64

func (*TextEmbeddingResponse) GetModelVersion

func (x *TextEmbeddingResponse) GetModelVersion() string

func (*TextEmbeddingResponse) GetNumTokens

func (x *TextEmbeddingResponse) GetNumTokens() int64

func (*TextEmbeddingResponse) ProtoMessage

func (*TextEmbeddingResponse) ProtoMessage()

func (*TextEmbeddingResponse) ProtoReflect

func (x *TextEmbeddingResponse) ProtoReflect() protoreflect.Message

func (*TextEmbeddingResponse) Reset

func (x *TextEmbeddingResponse) Reset()

func (*TextEmbeddingResponse) SetEmbedding

func (m *TextEmbeddingResponse) SetEmbedding(v []float64)

func (*TextEmbeddingResponse) SetModelVersion

func (m *TextEmbeddingResponse) SetModelVersion(v string)

func (*TextEmbeddingResponse) SetNumTokens

func (m *TextEmbeddingResponse) SetNumTokens(v int64)

func (*TextEmbeddingResponse) String

func (x *TextEmbeddingResponse) String() string

type UnimplementedEmbeddingsServiceServer

type UnimplementedEmbeddingsServiceServer struct {
}

UnimplementedEmbeddingsServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedEmbeddingsServiceServer) TextEmbedding

type UnsafeEmbeddingsServiceServer

type UnsafeEmbeddingsServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeEmbeddingsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EmbeddingsServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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