Documentation
¶
Index ¶
- Variables
- type BotConfig
- type ChatOptions
- func (*ChatOptions) Descriptor() ([]byte, []int)deprecated
- func (x *ChatOptions) GetMaxToken() int64
- func (x *ChatOptions) GetModel() string
- func (x *ChatOptions) GetStream() bool
- func (x *ChatOptions) GetTemperature() float32
- func (*ChatOptions) ProtoMessage()
- func (x *ChatOptions) ProtoReflect() protoreflect.Message
- func (x *ChatOptions) Reset()
- func (x *ChatOptions) String() string
- type ChatRequest
- func (*ChatRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ChatRequest) GetMessages() []*Message
- func (x *ChatRequest) GetOptions() *ChatOptions
- func (*ChatRequest) ProtoMessage()
- func (x *ChatRequest) ProtoReflect() protoreflect.Message
- func (x *ChatRequest) Reset()
- func (x *ChatRequest) String() string
- type ChatResponse
- func (*ChatResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ChatResponse) GetChoices() []*Choice
- func (x *ChatResponse) GetCreated() int64
- func (x *ChatResponse) GetId() string
- func (x *ChatResponse) GetModel() string
- func (*ChatResponse) ProtoMessage()
- func (x *ChatResponse) ProtoReflect() protoreflect.Message
- func (x *ChatResponse) Reset()
- func (x *ChatResponse) String() string
- type Choice
- func (*Choice) Descriptor() ([]byte, []int)deprecated
- func (x *Choice) GetFinishReason() string
- func (x *Choice) GetIndex() int64
- func (x *Choice) GetMessage() *Message
- func (*Choice) ProtoMessage()
- func (x *Choice) ProtoReflect() protoreflect.Message
- func (x *Choice) Reset()
- func (x *Choice) String() string
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetContent() isMessage_Content
- func (x *Message) GetRole() Message_Role
- func (x *Message) GetStringContent() string
- func (x *Message) GetTypeContent() *TypeMessage
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type Message_Role
- func (Message_Role) Descriptor() protoreflect.EnumDescriptor
- func (x Message_Role) Enum() *Message_Role
- func (Message_Role) EnumDescriptor() ([]byte, []int)deprecated
- func (x Message_Role) Number() protoreflect.EnumNumber
- func (x Message_Role) String() string
- func (Message_Role) Type() protoreflect.EnumType
- type Message_StringContent
- type Message_TypeContent
- type ProviderType
- func (ProviderType) Descriptor() protoreflect.EnumDescriptor
- func (x ProviderType) Enum() *ProviderType
- func (ProviderType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ProviderType) Number() protoreflect.EnumNumber
- func (x ProviderType) String() string
- func (ProviderType) Type() protoreflect.EnumType
- type StringMessage
- type TypeMessage
- func (*TypeMessage) Descriptor() ([]byte, []int)deprecated
- func (x *TypeMessage) GetImageUrl() *TypeMessage_ImageUrl
- func (x *TypeMessage) GetText() string
- func (x *TypeMessage) GetType() TypeMessage_Type
- func (*TypeMessage) ProtoMessage()
- func (x *TypeMessage) ProtoReflect() protoreflect.Message
- func (x *TypeMessage) Reset()
- func (x *TypeMessage) String() string
- type TypeMessage_ImageUrl
- func (*TypeMessage_ImageUrl) Descriptor() ([]byte, []int)deprecated
- func (x *TypeMessage_ImageUrl) GetUrl() string
- func (*TypeMessage_ImageUrl) ProtoMessage()
- func (x *TypeMessage_ImageUrl) ProtoReflect() protoreflect.Message
- func (x *TypeMessage_ImageUrl) Reset()
- func (x *TypeMessage_ImageUrl) String() string
- type TypeMessage_Type
- func (TypeMessage_Type) Descriptor() protoreflect.EnumDescriptor
- func (x TypeMessage_Type) Enum() *TypeMessage_Type
- func (TypeMessage_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x TypeMessage_Type) Number() protoreflect.EnumNumber
- func (x TypeMessage_Type) String() string
- func (TypeMessage_Type) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProviderType_name = map[int32]string{ 0: "Doubao", 1: "Openai", } ProviderType_value = map[string]int32{ "Doubao": 0, "Openai": 1, } )
Enum value maps for ProviderType.
View Source
var ( Message_Role_name = map[int32]string{ 0: "system", 1: "user", 2: "assistant", } Message_Role_value = map[string]int32{ "system": 0, "user": 1, "assistant": 2, } )
Enum value maps for Message_Role.
View Source
var ( TypeMessage_Type_name = map[int32]string{ 0: "string", 1: "image", } TypeMessage_Type_value = map[string]int32{ "string": 0, "image": 1, } )
Enum value maps for TypeMessage_Type.
View Source
var File_bot_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type BotConfig ¶
type BotConfig struct {
Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"`
ApiKey string `protobuf:"bytes,2,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"`
// contains filtered or unexported fields
}
func (*BotConfig) Descriptor
deprecated
func (*BotConfig) ProtoMessage ¶
func (*BotConfig) ProtoMessage()
func (*BotConfig) ProtoReflect ¶
func (x *BotConfig) ProtoReflect() protoreflect.Message
type ChatOptions ¶
type ChatOptions struct {
Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
MaxToken int64 `protobuf:"varint,2,opt,name=max_token,json=maxToken,proto3" json:"max_token,omitempty"`
Temperature float32 `protobuf:"fixed32,3,opt,name=temperature,proto3" json:"temperature,omitempty"`
Stream bool `protobuf:"varint,4,opt,name=stream,proto3" json:"stream,omitempty"`
// contains filtered or unexported fields
}
func (*ChatOptions) Descriptor
deprecated
func (*ChatOptions) Descriptor() ([]byte, []int)
Deprecated: Use ChatOptions.ProtoReflect.Descriptor instead.
func (*ChatOptions) GetMaxToken ¶
func (x *ChatOptions) GetMaxToken() int64
func (*ChatOptions) GetModel ¶
func (x *ChatOptions) GetModel() string
func (*ChatOptions) GetStream ¶
func (x *ChatOptions) GetStream() bool
func (*ChatOptions) GetTemperature ¶
func (x *ChatOptions) GetTemperature() float32
func (*ChatOptions) ProtoMessage ¶
func (*ChatOptions) ProtoMessage()
func (*ChatOptions) ProtoReflect ¶
func (x *ChatOptions) ProtoReflect() protoreflect.Message
func (*ChatOptions) Reset ¶
func (x *ChatOptions) Reset()
func (*ChatOptions) String ¶
func (x *ChatOptions) String() string
type ChatRequest ¶
type ChatRequest struct {
Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
Options *ChatOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
// contains filtered or unexported fields
}
func (*ChatRequest) Descriptor
deprecated
func (*ChatRequest) Descriptor() ([]byte, []int)
Deprecated: Use ChatRequest.ProtoReflect.Descriptor instead.
func (*ChatRequest) GetMessages ¶
func (x *ChatRequest) GetMessages() []*Message
func (*ChatRequest) GetOptions ¶
func (x *ChatRequest) GetOptions() *ChatOptions
func (*ChatRequest) ProtoMessage ¶
func (*ChatRequest) ProtoMessage()
func (*ChatRequest) ProtoReflect ¶
func (x *ChatRequest) ProtoReflect() protoreflect.Message
func (*ChatRequest) Reset ¶
func (x *ChatRequest) Reset()
func (*ChatRequest) String ¶
func (x *ChatRequest) String() string
type ChatResponse ¶
type ChatResponse struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Choices []*Choice `protobuf:"bytes,2,rep,name=choices,proto3" json:"choices,omitempty"`
Created int64 `protobuf:"varint,3,opt,name=created,proto3" json:"created,omitempty"`
Model string `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"`
// contains filtered or unexported fields
}
func (*ChatResponse) Descriptor
deprecated
func (*ChatResponse) Descriptor() ([]byte, []int)
Deprecated: Use ChatResponse.ProtoReflect.Descriptor instead.
func (*ChatResponse) GetChoices ¶
func (x *ChatResponse) GetChoices() []*Choice
func (*ChatResponse) GetCreated ¶
func (x *ChatResponse) GetCreated() int64
func (*ChatResponse) GetId ¶
func (x *ChatResponse) GetId() string
func (*ChatResponse) GetModel ¶
func (x *ChatResponse) GetModel() string
func (*ChatResponse) ProtoMessage ¶
func (*ChatResponse) ProtoMessage()
func (*ChatResponse) ProtoReflect ¶
func (x *ChatResponse) ProtoReflect() protoreflect.Message
func (*ChatResponse) Reset ¶
func (x *ChatResponse) Reset()
func (*ChatResponse) String ¶
func (x *ChatResponse) String() string
type Choice ¶
type Choice struct {
Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
Message *Message `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
FinishReason string `protobuf:"bytes,3,opt,name=finish_reason,json=finishReason,proto3" json:"finish_reason,omitempty"`
// contains filtered or unexported fields
}
func (*Choice) Descriptor
deprecated
func (*Choice) GetFinishReason ¶
func (*Choice) GetMessage ¶
func (*Choice) ProtoMessage ¶
func (*Choice) ProtoMessage()
func (*Choice) ProtoReflect ¶
func (x *Choice) ProtoReflect() protoreflect.Message
type Message ¶
type Message struct {
Role Message_Role `protobuf:"varint,1,opt,name=role,proto3,enum=botpb.Message_Role" json:"role,omitempty"`
// Types that are valid to be assigned to Content:
//
// *Message_StringContent
// *Message_TypeContent
Content isMessage_Content `protobuf_oneof:"content"`
// contains filtered or unexported fields
}
func (*Message) Descriptor
deprecated
func (*Message) GetContent ¶
func (x *Message) GetContent() isMessage_Content
func (*Message) GetRole ¶
func (x *Message) GetRole() Message_Role
func (*Message) GetStringContent ¶
func (*Message) GetTypeContent ¶
func (x *Message) GetTypeContent() *TypeMessage
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type Message_Role ¶
type Message_Role int32
const ( Message_system Message_Role = 0 Message_user Message_Role = 1 Message_assistant Message_Role = 2 )
func (Message_Role) Descriptor ¶
func (Message_Role) Descriptor() protoreflect.EnumDescriptor
func (Message_Role) Enum ¶
func (x Message_Role) Enum() *Message_Role
func (Message_Role) EnumDescriptor
deprecated
func (Message_Role) EnumDescriptor() ([]byte, []int)
Deprecated: Use Message_Role.Descriptor instead.
func (Message_Role) Number ¶
func (x Message_Role) Number() protoreflect.EnumNumber
func (Message_Role) String ¶
func (x Message_Role) String() string
func (Message_Role) Type ¶
func (Message_Role) Type() protoreflect.EnumType
type Message_StringContent ¶
type Message_StringContent struct {
StringContent string `protobuf:"bytes,2,opt,name=string_content,json=stringContent,proto3,oneof"`
}
type Message_TypeContent ¶
type Message_TypeContent struct {
TypeContent *TypeMessage `protobuf:"bytes,3,opt,name=type_content,json=typeContent,proto3,oneof"`
}
type ProviderType ¶
type ProviderType int32
const ( ProviderType_Doubao ProviderType = 0 ProviderType_Openai ProviderType = 1 )
func (ProviderType) Descriptor ¶
func (ProviderType) Descriptor() protoreflect.EnumDescriptor
func (ProviderType) Enum ¶
func (x ProviderType) Enum() *ProviderType
func (ProviderType) EnumDescriptor
deprecated
func (ProviderType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ProviderType.Descriptor instead.
func (ProviderType) Number ¶
func (x ProviderType) Number() protoreflect.EnumNumber
func (ProviderType) String ¶
func (x ProviderType) String() string
func (ProviderType) Type ¶
func (ProviderType) Type() protoreflect.EnumType
type StringMessage ¶
type StringMessage struct {
Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
// contains filtered or unexported fields
}
func (*StringMessage) Descriptor
deprecated
func (*StringMessage) Descriptor() ([]byte, []int)
Deprecated: Use StringMessage.ProtoReflect.Descriptor instead.
func (*StringMessage) GetContent ¶
func (x *StringMessage) GetContent() string
func (*StringMessage) ProtoMessage ¶
func (*StringMessage) ProtoMessage()
func (*StringMessage) ProtoReflect ¶
func (x *StringMessage) ProtoReflect() protoreflect.Message
func (*StringMessage) Reset ¶
func (x *StringMessage) Reset()
func (*StringMessage) String ¶
func (x *StringMessage) String() string
type TypeMessage ¶
type TypeMessage struct {
Type TypeMessage_Type `protobuf:"varint,1,opt,name=type,proto3,enum=botpb.TypeMessage_Type" json:"type,omitempty"`
Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
ImageUrl *TypeMessage_ImageUrl `protobuf:"bytes,3,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"`
// contains filtered or unexported fields
}
func (*TypeMessage) Descriptor
deprecated
func (*TypeMessage) Descriptor() ([]byte, []int)
Deprecated: Use TypeMessage.ProtoReflect.Descriptor instead.
func (*TypeMessage) GetImageUrl ¶
func (x *TypeMessage) GetImageUrl() *TypeMessage_ImageUrl
func (*TypeMessage) GetText ¶
func (x *TypeMessage) GetText() string
func (*TypeMessage) GetType ¶
func (x *TypeMessage) GetType() TypeMessage_Type
func (*TypeMessage) ProtoMessage ¶
func (*TypeMessage) ProtoMessage()
func (*TypeMessage) ProtoReflect ¶
func (x *TypeMessage) ProtoReflect() protoreflect.Message
func (*TypeMessage) Reset ¶
func (x *TypeMessage) Reset()
func (*TypeMessage) String ¶
func (x *TypeMessage) String() string
type TypeMessage_ImageUrl ¶
type TypeMessage_ImageUrl struct {
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
// contains filtered or unexported fields
}
func (*TypeMessage_ImageUrl) Descriptor
deprecated
func (*TypeMessage_ImageUrl) Descriptor() ([]byte, []int)
Deprecated: Use TypeMessage_ImageUrl.ProtoReflect.Descriptor instead.
func (*TypeMessage_ImageUrl) GetUrl ¶
func (x *TypeMessage_ImageUrl) GetUrl() string
func (*TypeMessage_ImageUrl) ProtoMessage ¶
func (*TypeMessage_ImageUrl) ProtoMessage()
func (*TypeMessage_ImageUrl) ProtoReflect ¶
func (x *TypeMessage_ImageUrl) ProtoReflect() protoreflect.Message
func (*TypeMessage_ImageUrl) Reset ¶
func (x *TypeMessage_ImageUrl) Reset()
func (*TypeMessage_ImageUrl) String ¶
func (x *TypeMessage_ImageUrl) String() string
type TypeMessage_Type ¶
type TypeMessage_Type int32
const ( TypeMessage_string TypeMessage_Type = 0 TypeMessage_image TypeMessage_Type = 1 )
func (TypeMessage_Type) Descriptor ¶
func (TypeMessage_Type) Descriptor() protoreflect.EnumDescriptor
func (TypeMessage_Type) Enum ¶
func (x TypeMessage_Type) Enum() *TypeMessage_Type
func (TypeMessage_Type) EnumDescriptor
deprecated
func (TypeMessage_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use TypeMessage_Type.Descriptor instead.
func (TypeMessage_Type) Number ¶
func (x TypeMessage_Type) Number() protoreflect.EnumNumber
func (TypeMessage_Type) String ¶
func (x TypeMessage_Type) String() string
func (TypeMessage_Type) Type ¶
func (TypeMessage_Type) Type() protoreflect.EnumType
Click to show internal directories.
Click to hide internal directories.