llm

package
v0.0.0-...-a04abcf Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TextGenerationService_Instruct_FullMethodName = "/yandex.cloud.ai.llm.v1alpha.TextGenerationService/Instruct"
	TextGenerationService_Chat_FullMethodName     = "/yandex.cloud.ai.llm.v1alpha.TextGenerationService/Chat"
)
View Source
const (
	EmbeddingsService_Embedding_FullMethodName = "/yandex.cloud.ai.llm.v1alpha.EmbeddingsService/Embedding"
)
View Source
const (
	TextGenerationAsyncService_Instruct_FullMethodName = "/yandex.cloud.ai.llm.v1alpha.TextGenerationAsyncService/Instruct"
)
View Source
const (
	TokenizerService_Tokenize_FullMethodName = "/yandex.cloud.ai.llm.v1alpha.TokenizerService/Tokenize"
)

Variables

View Source
var (
	EmbeddingRequest_EmbeddingType_name = map[int32]string{
		0: "EMBEDDING_TYPE_UNSPECIFIED",
		1: "EMBEDDING_TYPE_QUERY",
		2: "EMBEDDING_TYPE_DOCUMENT",
	}
	EmbeddingRequest_EmbeddingType_value = map[string]int32{
		"EMBEDDING_TYPE_UNSPECIFIED": 0,
		"EMBEDDING_TYPE_QUERY":       1,
		"EMBEDDING_TYPE_DOCUMENT":    2,
	}
)

Enum value maps for EmbeddingRequest_EmbeddingType.

View Source
var EmbeddingsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.ai.llm.v1alpha.EmbeddingsService",
	HandlerType: (*EmbeddingsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Embedding",
			Handler:    _EmbeddingsService_Embedding_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/ai/llm/v1alpha/llm_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_llm_v1alpha_llm_proto protoreflect.FileDescriptor
View Source
var File_yandex_cloud_ai_llm_v1alpha_llm_service_proto protoreflect.FileDescriptor
View Source
var TextGenerationAsyncService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.ai.llm.v1alpha.TextGenerationAsyncService",
	HandlerType: (*TextGenerationAsyncServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Instruct",
			Handler:    _TextGenerationAsyncService_Instruct_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/ai/llm/v1alpha/llm_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.llm.v1alpha.TextGenerationService",
	HandlerType: (*TextGenerationServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Instruct",
			Handler:       _TextGenerationService_Instruct_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Chat",
			Handler:       _TextGenerationService_Chat_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "yandex/cloud/ai/llm/v1alpha/llm_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.llm.v1alpha.TokenizerService",
	HandlerType: (*TokenizerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Tokenize",
			Handler:    _TokenizerService_Tokenize_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/ai/llm/v1alpha/llm_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 RegisterEmbeddingsServiceServer

func RegisterEmbeddingsServiceServer(s grpc.ServiceRegistrar, srv EmbeddingsServiceServer)

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 Alternative

type Alternative struct {

	// The generated text response.
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	// The score or confidence of the generated text.
	Score float64 `protobuf:"fixed64,2,opt,name=score,proto3" json:"score,omitempty"`
	// The number of tokens in the generated response.
	NumTokens int64 `protobuf:"varint,3,opt,name=num_tokens,json=numTokens,proto3" json:"num_tokens,omitempty"`
	// contains filtered or unexported fields
}

Represents an alternative generated response, including its score and token count.

func (*Alternative) Descriptor deprecated

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

Deprecated: Use Alternative.ProtoReflect.Descriptor instead.

func (*Alternative) GetNumTokens

func (x *Alternative) GetNumTokens() int64

func (*Alternative) GetScore

func (x *Alternative) GetScore() float64

func (*Alternative) GetText

func (x *Alternative) GetText() string

func (*Alternative) ProtoMessage

func (*Alternative) ProtoMessage()

func (*Alternative) ProtoReflect

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

func (*Alternative) Reset

func (x *Alternative) Reset()

func (*Alternative) SetNumTokens

func (m *Alternative) SetNumTokens(v int64)

func (*Alternative) SetScore

func (m *Alternative) SetScore(v float64)

func (*Alternative) SetText

func (m *Alternative) SetText(v string)

func (*Alternative) String

func (x *Alternative) String() string

type ChatRequest

type ChatRequest struct {

	// The name or identifier of the model to be used for the chat.
	// Possible value for now: `general`.
	Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
	// Configuration options for text generation.
	GenerationOptions *GenerationOptions `protobuf:"bytes,2,opt,name=generation_options,json=generationOptions,proto3" json:"generation_options,omitempty"`
	// Text precondition or context of the request.
	// For example, the instruction may be "You are a helpful assistant".
	//
	// Types that are assignable to Instruction:
	//
	//	*ChatRequest_InstructionText
	Instruction isChatRequest_Instruction `protobuf_oneof:"Instruction"`
	// A list of messages in the conversation.
	Messages []*Message `protobuf:"bytes,4,rep,name=messages,proto3" json:"messages,omitempty"`
	// contains filtered or unexported fields
}

Request to engage in a chat conversation with a text generation model.

func (*ChatRequest) Descriptor deprecated

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

Deprecated: Use ChatRequest.ProtoReflect.Descriptor instead.

func (*ChatRequest) GetGenerationOptions

func (x *ChatRequest) GetGenerationOptions() *GenerationOptions

func (*ChatRequest) GetInstruction

func (m *ChatRequest) GetInstruction() isChatRequest_Instruction

func (*ChatRequest) GetInstructionText

func (x *ChatRequest) GetInstructionText() string

func (*ChatRequest) GetMessages

func (x *ChatRequest) GetMessages() []*Message

func (*ChatRequest) GetModel

func (x *ChatRequest) GetModel() string

func (*ChatRequest) ProtoMessage

func (*ChatRequest) ProtoMessage()

func (*ChatRequest) ProtoReflect

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

func (*ChatRequest) Reset

func (x *ChatRequest) Reset()

func (*ChatRequest) SetGenerationOptions

func (m *ChatRequest) SetGenerationOptions(v *GenerationOptions)

func (*ChatRequest) SetInstruction

func (m *ChatRequest) SetInstruction(v ChatRequest_Instruction)

func (*ChatRequest) SetInstructionText

func (m *ChatRequest) SetInstructionText(v string)

func (*ChatRequest) SetMessages

func (m *ChatRequest) SetMessages(v []*Message)

func (*ChatRequest) SetModel

func (m *ChatRequest) SetModel(v string)

func (*ChatRequest) String

func (x *ChatRequest) String() string

type ChatRequest_Instruction

type ChatRequest_Instruction = isChatRequest_Instruction

type ChatRequest_InstructionText

type ChatRequest_InstructionText struct {
	// The text-based instruction for the conversation.
	InstructionText string `protobuf:"bytes,3,opt,name=instruction_text,json=instructionText,proto3,oneof"`
}

type ChatResponse

type ChatResponse struct {

	// The assistant's message in the chat conversation.
	Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// Total number of tokens used in both the chat request and chat response.
	NumTokens int64 `protobuf:"varint,2,opt,name=num_tokens,json=numTokens,proto3" json:"num_tokens,omitempty"`
	// contains filtered or unexported fields
}

Contains a model-generated response for a chat query.

func (*ChatResponse) Descriptor deprecated

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

Deprecated: Use ChatResponse.ProtoReflect.Descriptor instead.

func (*ChatResponse) GetMessage

func (x *ChatResponse) GetMessage() *Message

func (*ChatResponse) GetNumTokens

func (x *ChatResponse) GetNumTokens() int64

func (*ChatResponse) ProtoMessage

func (*ChatResponse) ProtoMessage()

func (*ChatResponse) ProtoReflect

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

func (*ChatResponse) Reset

func (x *ChatResponse) Reset()

func (*ChatResponse) SetMessage

func (m *ChatResponse) SetMessage(v *Message)

func (*ChatResponse) SetNumTokens

func (m *ChatResponse) SetNumTokens(v int64)

func (*ChatResponse) String

func (x *ChatResponse) String() string

type EmbeddingRequest

type EmbeddingRequest struct {

	// The type of embedding to be generated.
	EmbeddingType EmbeddingRequest_EmbeddingType `` /* 165-byte string literal not displayed */
	// The name or identifier of the model to be used for embedding. Possible value for now: `general:embedding`.
	Model string `protobuf:"bytes,2,opt,name=model,proto3" json:"model,omitempty"`
	// The input text for which the embedding is requested.
	Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

Represents a request to obtain embeddings for text data.

func (*EmbeddingRequest) Descriptor deprecated

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

Deprecated: Use EmbeddingRequest.ProtoReflect.Descriptor instead.

func (*EmbeddingRequest) GetEmbeddingType

func (x *EmbeddingRequest) GetEmbeddingType() EmbeddingRequest_EmbeddingType

func (*EmbeddingRequest) GetModel

func (x *EmbeddingRequest) GetModel() string

func (*EmbeddingRequest) GetText

func (x *EmbeddingRequest) GetText() string

func (*EmbeddingRequest) ProtoMessage

func (*EmbeddingRequest) ProtoMessage()

func (*EmbeddingRequest) ProtoReflect

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

func (*EmbeddingRequest) Reset

func (x *EmbeddingRequest) Reset()

func (*EmbeddingRequest) SetEmbeddingType

func (m *EmbeddingRequest) SetEmbeddingType(v EmbeddingRequest_EmbeddingType)

func (*EmbeddingRequest) SetModel

func (m *EmbeddingRequest) SetModel(v string)

func (*EmbeddingRequest) SetText

func (m *EmbeddingRequest) SetText(v string)

func (*EmbeddingRequest) String

func (x *EmbeddingRequest) String() string

type EmbeddingRequest_EmbeddingType

type EmbeddingRequest_EmbeddingType int32

Enum to specify the type of embedding to be generated.

const (
	// Unspecified embedding type.
	EmbeddingRequest_EMBEDDING_TYPE_UNSPECIFIED EmbeddingRequest_EmbeddingType = 0
	// Embedding for a query. Use this when you have a short query or search term
	// that you want to obtain an embedding for. Query embeddings are typically
	// used in information retrieval and search applications.
	EmbeddingRequest_EMBEDDING_TYPE_QUERY EmbeddingRequest_EmbeddingType = 1
	// Embedding for a document. Use this when you have a longer document or a piece
	// of text that you want to obtain an embedding for. Document embeddings are often
	// used in natural language understanding and document similarity tasks.
	EmbeddingRequest_EMBEDDING_TYPE_DOCUMENT EmbeddingRequest_EmbeddingType = 2
)

func (EmbeddingRequest_EmbeddingType) Descriptor

func (EmbeddingRequest_EmbeddingType) Enum

func (EmbeddingRequest_EmbeddingType) EnumDescriptor deprecated

func (EmbeddingRequest_EmbeddingType) EnumDescriptor() ([]byte, []int)

Deprecated: Use EmbeddingRequest_EmbeddingType.Descriptor instead.

func (EmbeddingRequest_EmbeddingType) Number

func (EmbeddingRequest_EmbeddingType) String

func (EmbeddingRequest_EmbeddingType) Type

type EmbeddingResponse

type EmbeddingResponse 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"`
	// contains filtered or unexported fields
}

Represents a response containing embeddings for input text data.

func (*EmbeddingResponse) Descriptor deprecated

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

Deprecated: Use EmbeddingResponse.ProtoReflect.Descriptor instead.

func (*EmbeddingResponse) GetEmbedding

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

func (*EmbeddingResponse) GetNumTokens

func (x *EmbeddingResponse) GetNumTokens() int64

func (*EmbeddingResponse) ProtoMessage

func (*EmbeddingResponse) ProtoMessage()

func (*EmbeddingResponse) ProtoReflect

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

func (*EmbeddingResponse) Reset

func (x *EmbeddingResponse) Reset()

func (*EmbeddingResponse) SetEmbedding

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

func (*EmbeddingResponse) SetNumTokens

func (m *EmbeddingResponse) SetNumTokens(v int64)

func (*EmbeddingResponse) String

func (x *EmbeddingResponse) String() string

type EmbeddingsServiceClient

type EmbeddingsServiceClient interface {
	// RPC method to obtain embeddings for input text data.
	Embedding(ctx context.Context, in *EmbeddingRequest, opts ...grpc.CallOption) (*EmbeddingResponse, 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 {
	// RPC method to obtain embeddings for input text data.
	Embedding(context.Context, *EmbeddingRequest) (*EmbeddingResponse, error)
}

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

type GenerationOptions

type GenerationOptions struct {

	// Enables streaming of partially generated text.
	PartialResults bool `protobuf:"varint,1,opt,name=partial_results,json=partialResults,proto3" json:"partial_results,omitempty"`
	// Affects creativity and randomness of responses. Should be a double number between 0 (inclusive) and 1 (inclusive).
	// Lower values produce more straightforward responses, while higher values lead to increased creativity and randomness.
	Temperature *wrapperspb.DoubleValue `protobuf:"bytes,2,opt,name=temperature,proto3" json:"temperature,omitempty"`
	// Sets the maximum limit on the total number of tokens used for both the input prompt and the generated response.
	// Must be greater than zero and not exceed 7400 tokens.
	MaxTokens *wrapperspb.Int64Value `protobuf:"bytes,3,opt,name=max_tokens,json=maxTokens,proto3" json:"max_tokens,omitempty"`
	// contains filtered or unexported fields
}

Defines the options for text generation.

func (*GenerationOptions) Descriptor deprecated

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

Deprecated: Use GenerationOptions.ProtoReflect.Descriptor instead.

func (*GenerationOptions) GetMaxTokens

func (x *GenerationOptions) GetMaxTokens() *wrapperspb.Int64Value

func (*GenerationOptions) GetPartialResults

func (x *GenerationOptions) GetPartialResults() bool

func (*GenerationOptions) GetTemperature

func (x *GenerationOptions) GetTemperature() *wrapperspb.DoubleValue

func (*GenerationOptions) ProtoMessage

func (*GenerationOptions) ProtoMessage()

func (*GenerationOptions) ProtoReflect

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

func (*GenerationOptions) Reset

func (x *GenerationOptions) Reset()

func (*GenerationOptions) SetMaxTokens

func (m *GenerationOptions) SetMaxTokens(v *wrapperspb.Int64Value)

func (*GenerationOptions) SetPartialResults

func (m *GenerationOptions) SetPartialResults(v bool)

func (*GenerationOptions) SetTemperature

func (m *GenerationOptions) SetTemperature(v *wrapperspb.DoubleValue)

func (*GenerationOptions) String

func (x *GenerationOptions) String() string

type InstructRequest

type InstructRequest struct {

	// The name or identifier of the model to be used for text generation.
	// Possible value for now: `general`.
	Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
	// Configuration options for text generation.
	GenerationOptions *GenerationOptions `protobuf:"bytes,2,opt,name=generation_options,json=generationOptions,proto3" json:"generation_options,omitempty"`
	// Text precondition or context of the request.
	// For example, if the instruction is "You are the youngest Nobel laureate",
	// the request text might be "Tell us about your daily routine".
	//
	// Types that are assignable to Instruction:
	//
	//	*InstructRequest_InstructionText
	//	*InstructRequest_InstructionUri
	Instruction isInstructRequest_Instruction `protobuf_oneof:"Instruction"`
	// Request for text generation.
	//
	// Types that are assignable to Request:
	//
	//	*InstructRequest_RequestText
	Request isInstructRequest_Request `protobuf_oneof:"Request"`
	// contains filtered or unexported fields
}

Request for instructing the model to generate text.

func (*InstructRequest) Descriptor deprecated

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

Deprecated: Use InstructRequest.ProtoReflect.Descriptor instead.

func (*InstructRequest) GetGenerationOptions

func (x *InstructRequest) GetGenerationOptions() *GenerationOptions

func (*InstructRequest) GetInstruction

func (m *InstructRequest) GetInstruction() isInstructRequest_Instruction

func (*InstructRequest) GetInstructionText

func (x *InstructRequest) GetInstructionText() string

func (*InstructRequest) GetInstructionUri

func (x *InstructRequest) GetInstructionUri() string

func (*InstructRequest) GetModel

func (x *InstructRequest) GetModel() string

func (*InstructRequest) GetRequest

func (m *InstructRequest) GetRequest() isInstructRequest_Request

func (*InstructRequest) GetRequestText

func (x *InstructRequest) GetRequestText() string

func (*InstructRequest) ProtoMessage

func (*InstructRequest) ProtoMessage()

func (*InstructRequest) ProtoReflect

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

func (*InstructRequest) Reset

func (x *InstructRequest) Reset()

func (*InstructRequest) SetGenerationOptions

func (m *InstructRequest) SetGenerationOptions(v *GenerationOptions)

func (*InstructRequest) SetInstruction

func (m *InstructRequest) SetInstruction(v InstructRequest_Instruction)

func (*InstructRequest) SetInstructionText

func (m *InstructRequest) SetInstructionText(v string)

func (*InstructRequest) SetInstructionUri

func (m *InstructRequest) SetInstructionUri(v string)

func (*InstructRequest) SetModel

func (m *InstructRequest) SetModel(v string)

func (*InstructRequest) SetRequest

func (m *InstructRequest) SetRequest(v InstructRequest_Request)

func (*InstructRequest) SetRequestText

func (m *InstructRequest) SetRequestText(v string)

func (*InstructRequest) String

func (x *InstructRequest) String() string

type InstructRequest_Instruction

type InstructRequest_Instruction = isInstructRequest_Instruction

type InstructRequest_InstructionText

type InstructRequest_InstructionText struct {
	// The text-based instruction for text generation.
	InstructionText string `protobuf:"bytes,3,opt,name=instruction_text,json=instructionText,proto3,oneof"`
}

type InstructRequest_InstructionUri

type InstructRequest_InstructionUri struct {
	// A URI containing instructions for text generation.
	InstructionUri string `protobuf:"bytes,5,opt,name=instruction_uri,json=instructionUri,proto3,oneof"`
}

type InstructRequest_Request

type InstructRequest_Request = isInstructRequest_Request

type InstructRequest_RequestText

type InstructRequest_RequestText struct {
	// The text-based request for text generation.
	RequestText string `protobuf:"bytes,4,opt,name=request_text,json=requestText,proto3,oneof"`
}

type InstructResponse

type InstructResponse struct {

	// A list of alternative text responses.
	Alternatives []*Alternative `protobuf:"bytes,1,rep,name=alternatives,proto3" json:"alternatives,omitempty"`
	// The number of tokens used in the prompt, including both the [instruction_text] and [request_text].
	NumPromptTokens int64 `protobuf:"varint,2,opt,name=num_prompt_tokens,json=numPromptTokens,proto3" json:"num_prompt_tokens,omitempty"`
	// contains filtered or unexported fields
}

Response containing generated text alternatives and token count.

func (*InstructResponse) Descriptor deprecated

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

Deprecated: Use InstructResponse.ProtoReflect.Descriptor instead.

func (*InstructResponse) GetAlternatives

func (x *InstructResponse) GetAlternatives() []*Alternative

func (*InstructResponse) GetNumPromptTokens

func (x *InstructResponse) GetNumPromptTokens() int64

func (*InstructResponse) ProtoMessage

func (*InstructResponse) ProtoMessage()

func (*InstructResponse) ProtoReflect

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

func (*InstructResponse) Reset

func (x *InstructResponse) Reset()

func (*InstructResponse) SetAlternatives

func (m *InstructResponse) SetAlternatives(v []*Alternative)

func (*InstructResponse) SetNumPromptTokens

func (m *InstructResponse) SetNumPromptTokens(v int64)

func (*InstructResponse) String

func (x *InstructResponse) String() string

type Message

type Message struct {

	// Identifies the sender of the message.
	Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
	// The text content of the message.
	Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

Represents a message within a chat.

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetRole

func (x *Message) GetRole() string

func (*Message) GetText

func (x *Message) GetText() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) SetRole

func (m *Message) SetRole(v string)

func (*Message) SetText

func (m *Message) SetText(v string)

func (*Message) String

func (x *Message) String() string

type TextGenerationAsyncServiceClient

type TextGenerationAsyncServiceClient interface {
	// RPC method for instructing the model to generate text.
	Instruct(ctx context.Context, in *InstructRequest, 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 {
	// RPC method for instructing the model to generate text.
	Instruct(context.Context, *InstructRequest) (*operation.Operation, error)
}

TextGenerationAsyncServiceServer is the server API for TextGenerationAsyncService service. All implementations should embed UnimplementedTextGenerationAsyncServiceServer for forward compatibility

type TextGenerationServiceClient

type TextGenerationServiceClient interface {
	// RPC method for instructing the model to generate text.
	Instruct(ctx context.Context, in *InstructRequest, opts ...grpc.CallOption) (TextGenerationService_InstructClient, error)
	// RPC method for engaging in a chat conversation with the model.
	Chat(ctx context.Context, in *ChatRequest, opts ...grpc.CallOption) (TextGenerationService_ChatClient, 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 {
	// RPC method for instructing the model to generate text.
	Instruct(*InstructRequest, TextGenerationService_InstructServer) error
	// RPC method for engaging in a chat conversation with the model.
	Chat(*ChatRequest, TextGenerationService_ChatServer) error
}

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

type TextGenerationService_ChatClient

type TextGenerationService_ChatClient interface {
	Recv() (*ChatResponse, error)
	grpc.ClientStream
}

type TextGenerationService_ChatServer

type TextGenerationService_ChatServer interface {
	Send(*ChatResponse) error
	grpc.ServerStream
}

type TextGenerationService_InstructClient

type TextGenerationService_InstructClient interface {
	Recv() (*InstructResponse, error)
	grpc.ClientStream
}

type TextGenerationService_InstructServer

type TextGenerationService_InstructServer interface {
	Send(*InstructResponse) error
	grpc.ServerStream
}

type Token

type Token struct {

	// An internal token identifier.
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// The textual representation of the token.
	Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// Indicates whether the token is special or not. Special tokens define the model's behavior and are not visible to users.
	Special bool `protobuf:"varint,3,opt,name=special,proto3" json:"special,omitempty"`
	// contains filtered or unexported fields
}

Represents a token, the basic unit of text, used by the LLM.

func (*Token) Descriptor deprecated

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

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetId

func (x *Token) GetId() int64

func (*Token) GetSpecial

func (x *Token) GetSpecial() bool

func (*Token) GetText

func (x *Token) GetText() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

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

func (*Token) Reset

func (x *Token) Reset()

func (*Token) SetId

func (m *Token) SetId(v int64)

func (*Token) SetSpecial

func (m *Token) SetSpecial(v bool)

func (*Token) SetText

func (m *Token) SetText(v string)

func (*Token) String

func (x *Token) String() string

type TokenizeRequest

type TokenizeRequest struct {

	// The name or identifier of the model to be used for tokenization.
	// Possible values for now: `general`, `general:embedding`.
	Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
	// The input text to tokenize.
	Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

Request to tokenize input text.

func (*TokenizeRequest) Descriptor deprecated

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

Deprecated: Use TokenizeRequest.ProtoReflect.Descriptor instead.

func (*TokenizeRequest) GetModel

func (x *TokenizeRequest) GetModel() 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) SetModel

func (m *TokenizeRequest) SetModel(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 []*Token `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"`
	// contains filtered or unexported fields
}

Tokenization response.

func (*TokenizeResponse) Descriptor deprecated

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

Deprecated: Use TokenizeResponse.ProtoReflect.Descriptor instead.

func (*TokenizeResponse) GetTokens

func (x *TokenizeResponse) GetTokens() []*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) SetTokens

func (m *TokenizeResponse) SetTokens(v []*Token)

func (*TokenizeResponse) String

func (x *TokenizeResponse) String() string

type TokenizerServiceClient

type TokenizerServiceClient interface {
	// RPC method for tokenizing input text.
	Tokenize(ctx context.Context, in *TokenizeRequest, 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 input text.
	Tokenize(context.Context, *TokenizeRequest) (*TokenizeResponse, error)
}

TokenizerServiceServer is the server API for TokenizerService service. All implementations should embed UnimplementedTokenizerServiceServer for forward compatibility

type UnimplementedEmbeddingsServiceServer

type UnimplementedEmbeddingsServiceServer struct {
}

UnimplementedEmbeddingsServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedEmbeddingsServiceServer) Embedding

type UnimplementedTextGenerationAsyncServiceServer

type UnimplementedTextGenerationAsyncServiceServer struct {
}

UnimplementedTextGenerationAsyncServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedTextGenerationAsyncServiceServer) Instruct

type UnimplementedTextGenerationServiceServer

type UnimplementedTextGenerationServiceServer struct {
}

UnimplementedTextGenerationServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedTextGenerationServiceServer) Chat

func (UnimplementedTextGenerationServiceServer) Instruct

type UnimplementedTokenizerServiceServer

type UnimplementedTokenizerServiceServer struct {
}

UnimplementedTokenizerServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedTokenizerServiceServer) Tokenize

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.

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