foundation_models

package
v0.0.0-...-204702d Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Alternative_AlternativeStatus_name = map[int32]string{
		0: "ALTERNATIVE_STATUS_UNSPECIFIED",
		1: "ALTERNATIVE_STATUS_PARTIAL",
		2: "ALTERNATIVE_STATUS_TRUNCATED_FINAL",
		3: "ALTERNATIVE_STATUS_FINAL",
		4: "ALTERNATIVE_STATUS_CONTENT_FILTER",
		5: "ALTERNATIVE_STATUS_TOOL_CALLS",
	}
	Alternative_AlternativeStatus_value = map[string]int32{
		"ALTERNATIVE_STATUS_UNSPECIFIED":     0,
		"ALTERNATIVE_STATUS_PARTIAL":         1,
		"ALTERNATIVE_STATUS_TRUNCATED_FINAL": 2,
		"ALTERNATIVE_STATUS_FINAL":           3,
		"ALTERNATIVE_STATUS_CONTENT_FILTER":  4,
		"ALTERNATIVE_STATUS_TOOL_CALLS":      5,
	}
)

Enum value maps for Alternative_AlternativeStatus.

View Source
var File_yandex_cloud_ai_foundation_models_v1_text_common_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Alternative

type Alternative struct {

	// A message with the content of the alternative.
	Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// The generation status of the alternative.
	Status Alternative_AlternativeStatus `` /* 138-byte string literal not displayed */
	// contains filtered or unexported fields
}

Represents a generated completion alternative, including its content and generation status.

func (*Alternative) Descriptor deprecated

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

Deprecated: Use Alternative.ProtoReflect.Descriptor instead.

func (*Alternative) GetMessage

func (x *Alternative) GetMessage() *Message

func (*Alternative) GetStatus

func (*Alternative) ProtoMessage

func (*Alternative) ProtoMessage()

func (*Alternative) ProtoReflect

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

func (*Alternative) Reset

func (x *Alternative) Reset()

func (*Alternative) SetMessage

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

func (*Alternative) SetStatus

func (*Alternative) String

func (x *Alternative) String() string

type Alternative_AlternativeStatus

type Alternative_AlternativeStatus int32

Enum representing the generation status of the alternative.

const (
	// Unspecified generation status.
	Alternative_ALTERNATIVE_STATUS_UNSPECIFIED Alternative_AlternativeStatus = 0
	// Partially generated alternative.
	Alternative_ALTERNATIVE_STATUS_PARTIAL Alternative_AlternativeStatus = 1
	// Incomplete final alternative resulting from reaching the maximum allowed number of tokens.
	Alternative_ALTERNATIVE_STATUS_TRUNCATED_FINAL Alternative_AlternativeStatus = 2
	// Final alternative generated without running into any limits.
	Alternative_ALTERNATIVE_STATUS_FINAL Alternative_AlternativeStatus = 3
	// Generation was stopped due to the discovery of potentially sensitive content in the prompt or generated response.
	// To fix, modify the prompt and restart generation.
	Alternative_ALTERNATIVE_STATUS_CONTENT_FILTER Alternative_AlternativeStatus = 4
	// Tools were invoked during the completion generation.
	Alternative_ALTERNATIVE_STATUS_TOOL_CALLS Alternative_AlternativeStatus = 5
)

func (Alternative_AlternativeStatus) Descriptor

func (Alternative_AlternativeStatus) Enum

func (Alternative_AlternativeStatus) EnumDescriptor deprecated

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

Deprecated: Use Alternative_AlternativeStatus.Descriptor instead.

func (Alternative_AlternativeStatus) Number

func (Alternative_AlternativeStatus) String

func (Alternative_AlternativeStatus) Type

type CompletionOptions

type CompletionOptions struct {

	// Enables streaming of partially generated text.
	Stream bool `protobuf:"varint,1,opt,name=stream,proto3" json:"stream,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.
	// Default temperature: 0.3
	Temperature *wrapperspb.DoubleValue `protobuf:"bytes,2,opt,name=temperature,proto3" json:"temperature,omitempty"`
	// The limit on the number of tokens used for single completion generation.
	// Must be greater than zero. This maximum allowed parameter value may depend on the model being used.
	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 completion generation.

func (*CompletionOptions) Descriptor deprecated

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

Deprecated: Use CompletionOptions.ProtoReflect.Descriptor instead.

func (*CompletionOptions) GetMaxTokens

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

func (*CompletionOptions) GetStream

func (x *CompletionOptions) GetStream() bool

func (*CompletionOptions) GetTemperature

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

func (*CompletionOptions) ProtoMessage

func (*CompletionOptions) ProtoMessage()

func (*CompletionOptions) ProtoReflect

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

func (*CompletionOptions) Reset

func (x *CompletionOptions) Reset()

func (*CompletionOptions) SetMaxTokens

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

func (*CompletionOptions) SetStream

func (m *CompletionOptions) SetStream(v bool)

func (*CompletionOptions) SetTemperature

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

func (*CompletionOptions) String

func (x *CompletionOptions) String() string

type ContentUsage

type ContentUsage struct {

	// The number of tokens in the textual part of the model input.
	InputTextTokens int64 `protobuf:"varint,1,opt,name=input_text_tokens,json=inputTextTokens,proto3" json:"input_text_tokens,omitempty"`
	// The number of tokens in the generated completion.
	CompletionTokens int64 `protobuf:"varint,2,opt,name=completion_tokens,json=completionTokens,proto3" json:"completion_tokens,omitempty"`
	// The total number of tokens, including all input tokens and all generated tokens.
	TotalTokens int64 `protobuf:"varint,3,opt,name=total_tokens,json=totalTokens,proto3" json:"total_tokens,omitempty"`
	// contains filtered or unexported fields
}

An object representing the number of content [tokens](/docs/foundation-models/concepts/yandexgpt/tokens) used by the completion model.

func (*ContentUsage) Descriptor deprecated

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

Deprecated: Use ContentUsage.ProtoReflect.Descriptor instead.

func (*ContentUsage) GetCompletionTokens

func (x *ContentUsage) GetCompletionTokens() int64

func (*ContentUsage) GetInputTextTokens

func (x *ContentUsage) GetInputTextTokens() int64

func (*ContentUsage) GetTotalTokens

func (x *ContentUsage) GetTotalTokens() int64

func (*ContentUsage) ProtoMessage

func (*ContentUsage) ProtoMessage()

func (*ContentUsage) ProtoReflect

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

func (*ContentUsage) Reset

func (x *ContentUsage) Reset()

func (*ContentUsage) SetCompletionTokens

func (m *ContentUsage) SetCompletionTokens(v int64)

func (*ContentUsage) SetInputTextTokens

func (m *ContentUsage) SetInputTextTokens(v int64)

func (*ContentUsage) SetTotalTokens

func (m *ContentUsage) SetTotalTokens(v int64)

func (*ContentUsage) String

func (x *ContentUsage) String() string

type FunctionCall

type FunctionCall struct {

	// The name of the function being called.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The structured arguments passed to the function.
	// These arguments must adhere to the JSON Schema defined in the corresponding function's parameters.
	Arguments *structpb.Struct `protobuf:"bytes,2,opt,name=arguments,proto3" json:"arguments,omitempty"`
	// contains filtered or unexported fields
}

Represents the invocation of a function with specific arguments.

func (*FunctionCall) Descriptor deprecated

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

Deprecated: Use FunctionCall.ProtoReflect.Descriptor instead.

func (*FunctionCall) GetArguments

func (x *FunctionCall) GetArguments() *structpb.Struct

func (*FunctionCall) GetName

func (x *FunctionCall) GetName() string

func (*FunctionCall) ProtoMessage

func (*FunctionCall) ProtoMessage()

func (*FunctionCall) ProtoReflect

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

func (*FunctionCall) Reset

func (x *FunctionCall) Reset()

func (*FunctionCall) SetArguments

func (m *FunctionCall) SetArguments(v *structpb.Struct)

func (*FunctionCall) SetName

func (m *FunctionCall) SetName(v string)

func (*FunctionCall) String

func (x *FunctionCall) String() string

type FunctionResult

type FunctionResult struct {

	// The name of the function that was executed.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Types that are assignable to ContentType:
	//
	//	*FunctionResult_Content
	ContentType isFunctionResult_ContentType `protobuf_oneof:"ContentType"`
	// contains filtered or unexported fields
}

Represents the result of a function call.

func (*FunctionResult) Descriptor deprecated

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

Deprecated: Use FunctionResult.ProtoReflect.Descriptor instead.

func (*FunctionResult) GetContent

func (x *FunctionResult) GetContent() string

func (*FunctionResult) GetContentType

func (m *FunctionResult) GetContentType() isFunctionResult_ContentType

func (*FunctionResult) GetName

func (x *FunctionResult) GetName() string

func (*FunctionResult) ProtoMessage

func (*FunctionResult) ProtoMessage()

func (*FunctionResult) ProtoReflect

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

func (*FunctionResult) Reset

func (x *FunctionResult) Reset()

func (*FunctionResult) SetContent

func (m *FunctionResult) SetContent(v string)

func (*FunctionResult) SetContentType

func (m *FunctionResult) SetContentType(v FunctionResult_ContentType)

func (*FunctionResult) SetName

func (m *FunctionResult) SetName(v string)

func (*FunctionResult) String

func (x *FunctionResult) String() string

type FunctionResult_Content

type FunctionResult_Content struct {
	// The result of the function call, represented as a string.
	// This field can be used to store the output of the function.
	Content string `protobuf:"bytes,2,opt,name=content,proto3,oneof"`
}

type FunctionResult_ContentType

type FunctionResult_ContentType = isFunctionResult_ContentType

type FunctionTool

type FunctionTool struct {

	// The name of the function.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// A description of the function's purpose or behavior.
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// A JSON Schema that defines the expected parameters for the function.
	// The schema should describe the required fields, their types, and any constraints or default values.
	Parameters *structpb.Struct `protobuf:"bytes,3,opt,name=parameters,proto3" json:"parameters,omitempty"`
	// contains filtered or unexported fields
}

Represents a function tool that can be invoked during completion generation.

func (*FunctionTool) Descriptor deprecated

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

Deprecated: Use FunctionTool.ProtoReflect.Descriptor instead.

func (*FunctionTool) GetDescription

func (x *FunctionTool) GetDescription() string

func (*FunctionTool) GetName

func (x *FunctionTool) GetName() string

func (*FunctionTool) GetParameters

func (x *FunctionTool) GetParameters() *structpb.Struct

func (*FunctionTool) ProtoMessage

func (*FunctionTool) ProtoMessage()

func (*FunctionTool) ProtoReflect

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

func (*FunctionTool) Reset

func (x *FunctionTool) Reset()

func (*FunctionTool) SetDescription

func (m *FunctionTool) SetDescription(v string)

func (*FunctionTool) SetName

func (m *FunctionTool) SetName(v string)

func (*FunctionTool) SetParameters

func (m *FunctionTool) SetParameters(v *structpb.Struct)

func (*FunctionTool) String

func (x *FunctionTool) String() string

type Message

type Message struct {

	// The ID of the message sender. Supported roles:
	// * `system`: Special role used to define the behaviour of the completion model.
	// * `assistant`: A role used by the model to generate responses.
	// * `user`: A role used by the user to describe requests to the model.
	Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
	// Message content.
	//
	// Types that are assignable to Content:
	//
	//	*Message_Text
	//	*Message_ToolCallList
	//	*Message_ToolResultList
	Content isMessage_Content `protobuf_oneof:"Content"`
	// contains filtered or unexported fields
}

A message object representing a wrapper over the inputs and outputs of the completion model.

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetContent

func (m *Message) GetContent() isMessage_Content

func (*Message) GetRole

func (x *Message) GetRole() string

func (*Message) GetText

func (x *Message) GetText() string

func (*Message) GetToolCallList

func (x *Message) GetToolCallList() *ToolCallList

func (*Message) GetToolResultList

func (x *Message) GetToolResultList() *ToolResultList

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) SetContent

func (m *Message) SetContent(v Message_Content)

func (*Message) SetRole

func (m *Message) SetRole(v string)

func (*Message) SetText

func (m *Message) SetText(v string)

func (*Message) SetToolCallList

func (m *Message) SetToolCallList(v *ToolCallList)

func (*Message) SetToolResultList

func (m *Message) SetToolResultList(v *ToolResultList)

func (*Message) String

func (x *Message) String() string

type Message_Content

type Message_Content = isMessage_Content

type Message_Text

type Message_Text struct {
	// Textual content of the message.
	Text string `protobuf:"bytes,2,opt,name=text,proto3,oneof"`
}

type Message_ToolCallList

type Message_ToolCallList struct {
	// List of tool calls made by the model as part of the response generation.
	ToolCallList *ToolCallList `protobuf:"bytes,3,opt,name=tool_call_list,json=toolCallList,proto3,oneof"`
}

type Message_ToolResultList

type Message_ToolResultList struct {
	// List of tool results returned from external tools that were invoked by the model.
	ToolResultList *ToolResultList `protobuf:"bytes,4,opt,name=tool_result_list,json=toolResultList,proto3,oneof"`
}

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 may 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 content, used by the foundation model.

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 Tool

type Tool struct {

	// Types that are assignable to ToolType:
	//
	//	*Tool_Function
	ToolType isTool_ToolType `protobuf_oneof:"ToolType"`
	// contains filtered or unexported fields
}

Represents a tool that can be invoked during completion generation.

func (*Tool) Descriptor deprecated

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

Deprecated: Use Tool.ProtoReflect.Descriptor instead.

func (*Tool) GetFunction

func (x *Tool) GetFunction() *FunctionTool

func (*Tool) GetToolType

func (m *Tool) GetToolType() isTool_ToolType

func (*Tool) ProtoMessage

func (*Tool) ProtoMessage()

func (*Tool) ProtoReflect

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

func (*Tool) Reset

func (x *Tool) Reset()

func (*Tool) SetFunction

func (m *Tool) SetFunction(v *FunctionTool)

func (*Tool) SetToolType

func (m *Tool) SetToolType(v Tool_ToolType)

func (*Tool) String

func (x *Tool) String() string

type ToolCall

type ToolCall struct {

	// Types that are assignable to ToolCallType:
	//
	//	*ToolCall_FunctionCall
	ToolCallType isToolCall_ToolCallType `protobuf_oneof:"ToolCallType"`
	// contains filtered or unexported fields
}

Represents a call to a tool.

func (*ToolCall) Descriptor deprecated

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

Deprecated: Use ToolCall.ProtoReflect.Descriptor instead.

func (*ToolCall) GetFunctionCall

func (x *ToolCall) GetFunctionCall() *FunctionCall

func (*ToolCall) GetToolCallType

func (m *ToolCall) GetToolCallType() isToolCall_ToolCallType

func (*ToolCall) ProtoMessage

func (*ToolCall) ProtoMessage()

func (*ToolCall) ProtoReflect

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

func (*ToolCall) Reset

func (x *ToolCall) Reset()

func (*ToolCall) SetFunctionCall

func (m *ToolCall) SetFunctionCall(v *FunctionCall)

func (*ToolCall) SetToolCallType

func (m *ToolCall) SetToolCallType(v ToolCall_ToolCallType)

func (*ToolCall) String

func (x *ToolCall) String() string

type ToolCallList

type ToolCallList struct {

	// A list of tool calls to be executed.
	ToolCalls []*ToolCall `protobuf:"bytes,1,rep,name=tool_calls,json=toolCalls,proto3" json:"tool_calls,omitempty"`
	// contains filtered or unexported fields
}

Represents a list of tool calls.

func (*ToolCallList) Descriptor deprecated

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

Deprecated: Use ToolCallList.ProtoReflect.Descriptor instead.

func (*ToolCallList) GetToolCalls

func (x *ToolCallList) GetToolCalls() []*ToolCall

func (*ToolCallList) ProtoMessage

func (*ToolCallList) ProtoMessage()

func (*ToolCallList) ProtoReflect

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

func (*ToolCallList) Reset

func (x *ToolCallList) Reset()

func (*ToolCallList) SetToolCalls

func (m *ToolCallList) SetToolCalls(v []*ToolCall)

func (*ToolCallList) String

func (x *ToolCallList) String() string

type ToolCall_FunctionCall

type ToolCall_FunctionCall struct {
	// Represents a call to a function.
	FunctionCall *FunctionCall `protobuf:"bytes,1,opt,name=function_call,json=functionCall,proto3,oneof"`
}

type ToolCall_ToolCallType

type ToolCall_ToolCallType = isToolCall_ToolCallType

type ToolResult

type ToolResult struct {

	// Types that are assignable to ToolResultType:
	//
	//	*ToolResult_FunctionResult
	ToolResultType isToolResult_ToolResultType `protobuf_oneof:"ToolResultType"`
	// contains filtered or unexported fields
}

Represents the result of a tool call.

func (*ToolResult) Descriptor deprecated

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

Deprecated: Use ToolResult.ProtoReflect.Descriptor instead.

func (*ToolResult) GetFunctionResult

func (x *ToolResult) GetFunctionResult() *FunctionResult

func (*ToolResult) GetToolResultType

func (m *ToolResult) GetToolResultType() isToolResult_ToolResultType

func (*ToolResult) ProtoMessage

func (*ToolResult) ProtoMessage()

func (*ToolResult) ProtoReflect

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

func (*ToolResult) Reset

func (x *ToolResult) Reset()

func (*ToolResult) SetFunctionResult

func (m *ToolResult) SetFunctionResult(v *FunctionResult)

func (*ToolResult) SetToolResultType

func (m *ToolResult) SetToolResultType(v ToolResult_ToolResultType)

func (*ToolResult) String

func (x *ToolResult) String() string

type ToolResultList

type ToolResultList struct {

	// A list of tool results.
	ToolResults []*ToolResult `protobuf:"bytes,1,rep,name=tool_results,json=toolResults,proto3" json:"tool_results,omitempty"`
	// contains filtered or unexported fields
}

Represents a list of tool results.

func (*ToolResultList) Descriptor deprecated

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

Deprecated: Use ToolResultList.ProtoReflect.Descriptor instead.

func (*ToolResultList) GetToolResults

func (x *ToolResultList) GetToolResults() []*ToolResult

func (*ToolResultList) ProtoMessage

func (*ToolResultList) ProtoMessage()

func (*ToolResultList) ProtoReflect

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

func (*ToolResultList) Reset

func (x *ToolResultList) Reset()

func (*ToolResultList) SetToolResults

func (m *ToolResultList) SetToolResults(v []*ToolResult)

func (*ToolResultList) String

func (x *ToolResultList) String() string

type ToolResult_FunctionResult

type ToolResult_FunctionResult struct {
	// Represents the result of a function call.
	FunctionResult *FunctionResult `protobuf:"bytes,1,opt,name=function_result,json=functionResult,proto3,oneof"`
}

type ToolResult_ToolResultType

type ToolResult_ToolResultType = isToolResult_ToolResultType

type Tool_Function

type Tool_Function struct {
	// Represents a function that can be called.
	Function *FunctionTool `protobuf:"bytes,1,opt,name=function,proto3,oneof"`
}

type Tool_ToolType

type Tool_ToolType = isTool_ToolType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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