Documentation ¶
Index ¶
- Variables
- type ChatReq
- func (*ChatReq) Descriptor() ([]byte, []int)
- func (m *ChatReq) GetMessages() []*Message
- func (m *ChatReq) GetModel() *Model
- func (m *ChatReq) GetParameters() *Parameters
- func (m *ChatReq) GetReqId() string
- func (m *ChatReq) GetStream() bool
- func (m *ChatReq) Marshal() (dAtA []byte, err error)
- func (m *ChatReq) MarshalTo(dAtA []byte) (int, error)
- func (m *ChatReq) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ChatReq) ProtoMessage()
- func (m *ChatReq) Reset()
- func (m *ChatReq) Size() (n int)
- func (m *ChatReq) String() string
- func (m *ChatReq) Unmarshal(dAtA []byte) error
- func (m *ChatReq) XXX_DiscardUnknown()
- func (m *ChatReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ChatReq) XXX_Merge(src proto.Message)
- func (m *ChatReq) XXX_Size() int
- func (m *ChatReq) XXX_Unmarshal(b []byte) error
- type ChatResp
- func (*ChatResp) Descriptor() ([]byte, []int)
- func (m *ChatResp) GetChoice() *Choice
- func (m *ChatResp) GetError() *Error
- func (m *ChatResp) GetReqId() string
- func (m *ChatResp) GetUsage() *Usage
- func (m *ChatResp) Marshal() (dAtA []byte, err error)
- func (m *ChatResp) MarshalTo(dAtA []byte) (int, error)
- func (m *ChatResp) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ChatResp) ProtoMessage()
- func (m *ChatResp) Reset()
- func (m *ChatResp) Size() (n int)
- func (m *ChatResp) String() string
- func (m *ChatResp) Unmarshal(dAtA []byte) error
- func (m *ChatResp) XXX_DiscardUnknown()
- func (m *ChatResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ChatResp) XXX_Merge(src proto.Message)
- func (m *ChatResp) XXX_Size() int
- func (m *ChatResp) XXX_Unmarshal(b []byte) error
- type Choice
- func (*Choice) Descriptor() ([]byte, []int)
- func (m *Choice) GetFinishReason() string
- func (m *Choice) GetIndex() int32
- func (m *Choice) GetLogprobs() float32
- func (m *Choice) GetMessage() *Message
- func (m *Choice) Marshal() (dAtA []byte, err error)
- func (m *Choice) MarshalTo(dAtA []byte) (int, error)
- func (m *Choice) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Choice) ProtoMessage()
- func (m *Choice) Reset()
- func (m *Choice) Size() (n int)
- func (m *Choice) String() string
- func (m *Choice) Unmarshal(dAtA []byte) error
- func (m *Choice) XXX_DiscardUnknown()
- func (m *Choice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Choice) XXX_Merge(src proto.Message)
- func (m *Choice) XXX_Size() int
- func (m *Choice) XXX_Unmarshal(b []byte) error
- type Error
- func (*Error) Descriptor() ([]byte, []int)
- func (m *Error) Error() string
- func (m *Error) GetCode() string
- func (m *Error) GetCodeN() int32
- func (m *Error) GetMessage() string
- func (m *Error) Marshal() (dAtA []byte, err error)
- func (m *Error) MarshalTo(dAtA []byte) (int, error)
- func (m *Error) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Error) ProtoMessage()
- func (m *Error) Reset()
- func (m *Error) Size() (n int)
- func (m *Error) String() string
- func (m *Error) Unmarshal(dAtA []byte) error
- func (m *Error) XXX_DiscardUnknown()
- func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Error) XXX_Merge(src proto.Message)
- func (m *Error) XXX_Size() int
- func (m *Error) XXX_Unmarshal(b []byte) error
- type ErrorResp
- func (*ErrorResp) Descriptor() ([]byte, []int)
- func (m *ErrorResp) GetError() *Error
- func (m *ErrorResp) GetReqId() string
- func (m *ErrorResp) Marshal() (dAtA []byte, err error)
- func (m *ErrorResp) MarshalTo(dAtA []byte) (int, error)
- func (m *ErrorResp) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ErrorResp) ProtoMessage()
- func (m *ErrorResp) Reset()
- func (m *ErrorResp) Size() (n int)
- func (m *ErrorResp) String() string
- func (m *ErrorResp) Unmarshal(dAtA []byte) error
- func (m *ErrorResp) XXX_DiscardUnknown()
- func (m *ErrorResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ErrorResp) XXX_Merge(src proto.Message)
- func (m *ErrorResp) XXX_Size() int
- func (m *ErrorResp) XXX_Unmarshal(b []byte) error
- type Message
- func (*Message) Descriptor() ([]byte, []int)
- func (m *Message) GetContent() string
- func (m *Message) GetRole() string
- func (m *Message) Marshal() (dAtA []byte, err error)
- func (m *Message) MarshalTo(dAtA []byte) (int, error)
- func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) Size() (n int)
- func (m *Message) String() string
- func (m *Message) Unmarshal(dAtA []byte) error
- func (m *Message) XXX_DiscardUnknown()
- func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Message) XXX_Merge(src proto.Message)
- func (m *Message) XXX_Size() int
- func (m *Message) XXX_Unmarshal(b []byte) error
- type Model
- func (*Model) Descriptor() ([]byte, []int)
- func (m *Model) GetEndpointId() string
- func (m *Model) GetName() string
- func (m *Model) Marshal() (dAtA []byte, err error)
- func (m *Model) MarshalTo(dAtA []byte) (int, error)
- func (m *Model) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Model) ProtoMessage()
- func (m *Model) Reset()
- func (m *Model) Size() (n int)
- func (m *Model) String() string
- func (m *Model) Unmarshal(dAtA []byte) error
- func (m *Model) XXX_DiscardUnknown()
- func (m *Model) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Model) XXX_Merge(src proto.Message)
- func (m *Model) XXX_Size() int
- func (m *Model) XXX_Unmarshal(b []byte) error
- type Parameters
- func (*Parameters) Descriptor() ([]byte, []int)
- func (m *Parameters) GetDoSample() bool
- func (m *Parameters) GetFrequencyPenalty() float32
- func (m *Parameters) GetMaxNewTokens() int64
- func (m *Parameters) GetMaxTokens() int64
- func (m *Parameters) GetPresencePenalty() float32
- func (m *Parameters) GetRepetitionPenalty() float32
- func (m *Parameters) GetTemperature() float32
- func (m *Parameters) GetTopK() int64
- func (m *Parameters) GetTopP() float32
- func (m *Parameters) Marshal() (dAtA []byte, err error)
- func (m *Parameters) MarshalTo(dAtA []byte) (int, error)
- func (m *Parameters) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Parameters) ProtoMessage()
- func (m *Parameters) Reset()
- func (m *Parameters) Size() (n int)
- func (m *Parameters) String() string
- func (m *Parameters) Unmarshal(dAtA []byte) error
- func (m *Parameters) XXX_DiscardUnknown()
- func (m *Parameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Parameters) XXX_Merge(src proto.Message)
- func (m *Parameters) XXX_Size() int
- func (m *Parameters) XXX_Unmarshal(b []byte) error
- type Usage
- func (*Usage) Descriptor() ([]byte, []int)
- func (m *Usage) GetCompletionTokens() int64
- func (m *Usage) GetPromptTokens() int64
- func (m *Usage) GetTotalTokens() int64
- func (m *Usage) Marshal() (dAtA []byte, err error)
- func (m *Usage) MarshalTo(dAtA []byte) (int, error)
- func (m *Usage) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Usage) ProtoMessage()
- func (m *Usage) Reset()
- func (m *Usage) Size() (n int)
- func (m *Usage) String() string
- func (m *Usage) Unmarshal(dAtA []byte) error
- func (m *Usage) XXX_DiscardUnknown()
- func (m *Usage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Usage) XXX_Merge(src proto.Message)
- func (m *Usage) XXX_Size() int
- func (m *Usage) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ChatReq ¶
type ChatReq struct { // Used model for inference Model *Model `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"` // User inputed prompt Messages []*Message `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` // API specific parameters Parameters *Parameters `protobuf:"bytes,3,opt,name=parameters,proto3" json:"parameters,omitempty"` // Whether use stream mode, if set, partial message deltas will be sent as // data-only server-sent events as they become available // The stream will be terminated by a data: [DONE] Stream bool `protobuf:"varint,4,opt,name=stream,proto3" json:"stream,omitempty"` // Unified request id ReqId string `protobuf:"bytes,5,opt,name=req_id,json=reqId,proto3" json:"req_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ChatReq) Descriptor ¶
func (*ChatReq) GetMessages ¶
func (*ChatReq) GetParameters ¶
func (m *ChatReq) GetParameters() *Parameters
func (*ChatReq) MarshalToSizedBuffer ¶
func (*ChatReq) ProtoMessage ¶
func (*ChatReq) ProtoMessage()
func (*ChatReq) XXX_DiscardUnknown ¶
func (m *ChatReq) XXX_DiscardUnknown()
func (*ChatReq) XXX_Marshal ¶
func (*ChatReq) XXX_Unmarshal ¶
type ChatResp ¶
type ChatResp struct { // Unified request id ReqId string `protobuf:"bytes,1,opt,name=req_id,json=reqId,proto3" json:"req_id,omitempty"` // Error if exists for the req Error *Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // The generated result Choice *Choice `protobuf:"bytes,3,opt,name=choice,proto3" json:"choice,omitempty"` // The tokens usage Usage *Usage `protobuf:"bytes,4,opt,name=usage,proto3" json:"usage,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ChatResp) Descriptor ¶
func (*ChatResp) MarshalToSizedBuffer ¶
func (*ChatResp) ProtoMessage ¶
func (*ChatResp) ProtoMessage()
func (*ChatResp) XXX_DiscardUnknown ¶
func (m *ChatResp) XXX_DiscardUnknown()
func (*ChatResp) XXX_Marshal ¶
func (*ChatResp) XXX_Unmarshal ¶
type Choice ¶
type Choice struct { Index int32 `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"` Logprobs float32 `protobuf:"fixed32,4,opt,name=logprobs,proto3" json:"logprobs,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Choice) Descriptor ¶
func (*Choice) GetFinishReason ¶
func (*Choice) GetLogprobs ¶
func (*Choice) GetMessage ¶
func (*Choice) MarshalToSizedBuffer ¶
func (*Choice) ProtoMessage ¶
func (*Choice) ProtoMessage()
func (*Choice) XXX_DiscardUnknown ¶
func (m *Choice) XXX_DiscardUnknown()
func (*Choice) XXX_Marshal ¶
func (*Choice) XXX_Unmarshal ¶
type Error ¶
type Error struct { Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` CodeN int32 `protobuf:"varint,2,opt,name=code_n,json=codeN,proto3" json:"code_n,omitempty"` Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewClientSDKRequestError ¶
NOTE: the returned value cannot be `nil`
func (*Error) Descriptor ¶
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) XXX_DiscardUnknown ¶
func (m *Error) XXX_DiscardUnknown()
func (*Error) XXX_Marshal ¶
func (*Error) XXX_Unmarshal ¶
type ErrorResp ¶
type ErrorResp struct { Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` ReqId string `protobuf:"bytes,2,opt,name=req_id,json=reqId,proto3" json:"req_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ErrorResp) Descriptor ¶
func (*ErrorResp) MarshalToSizedBuffer ¶
func (*ErrorResp) ProtoMessage ¶
func (*ErrorResp) ProtoMessage()
func (*ErrorResp) XXX_DiscardUnknown ¶
func (m *ErrorResp) XXX_DiscardUnknown()
func (*ErrorResp) XXX_Marshal ¶
func (*ErrorResp) XXX_Unmarshal ¶
type Message ¶
type Message struct { // The role of the author of this message. One of system, user, or assistant. Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` // The real context of the message Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Message) Descriptor ¶
func (*Message) GetContent ¶
func (*Message) MarshalToSizedBuffer ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) XXX_DiscardUnknown ¶
func (m *Message) XXX_DiscardUnknown()
func (*Message) XXX_Marshal ¶
func (*Message) XXX_Unmarshal ¶
type Model ¶
type Model struct { // Unified model name in model db Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Use specific endpoint id for inference, must set either name or id by now EndpointId string `protobuf:"bytes,2,opt,name=endpoint_id,json=endpointId,proto3" json:"endpoint_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Model) Descriptor ¶
func (*Model) GetEndpointId ¶
func (*Model) ProtoMessage ¶
func (*Model) ProtoMessage()
func (*Model) XXX_DiscardUnknown ¶
func (m *Model) XXX_DiscardUnknown()
func (*Model) XXX_Marshal ¶
func (*Model) XXX_Unmarshal ¶
type Parameters ¶
type Parameters struct { // Exponential scaling output probability distribution Temperature float32 `protobuf:"fixed32,1,opt,name=temperature,proto3" json:"temperature,omitempty"` // The maximum number of tokens to generate in the char completion. MaxTokens int64 `protobuf:"varint,2,opt,name=max_tokens,json=maxTokens,proto3" json:"max_tokens,omitempty"` // An alternative to sampling with temperature, called nucleus sampling, // where the model considers the results of the tokens with top_p probability // mass TopP float32 `protobuf:"fixed32,3,opt,name=top_p,json=topP,proto3" json:"top_p,omitempty"` // Number between -2.0 and 2.0. Positive values penalize new tokens based // on whether they appear in the text so far, increasing the model's // likelihood to talk about new topics. PresencePenalty float32 `protobuf:"fixed32,4,opt,name=presence_penalty,json=presencePenalty,proto3" json:"presence_penalty,omitempty"` // Number between -2.0 and 2.0. Positive values penalize new tokens based on // their existing frequency in the text so far, decreasing the model's // likelihood to repeat the same line verbatim. FrequencyPenalty float32 `protobuf:"fixed32,5,opt,name=frequency_penalty,json=frequencyPenalty,proto3" json:"frequency_penalty,omitempty"` // The maximum number of tokens to generate, ignoring the number of tokens in // the prompt MaxNewTokens int64 `protobuf:"varint,6,opt,name=max_new_tokens,json=maxNewTokens,proto3" json:"max_new_tokens,omitempty"` // The parameter for repetition penalty, from [1.0, 2.0] RepetitionPenalty float32 `protobuf:"fixed32,7,opt,name=repetition_penalty,json=repetitionPenalty,proto3" json:"repetition_penalty,omitempty"` // Whether or not to use sampling, use greedy decoding otherwise. Default to // false DoSample bool `protobuf:"varint,8,opt,name=do_sample,json=doSample,proto3" json:"do_sample,omitempty"` // The number of highest probability vocabulary tokens to keep for // top-k-filtering. TopK int64 `protobuf:"varint,9,opt,name=top_k,json=topK,proto3" json:"top_k,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Parameters) Descriptor ¶
func (*Parameters) Descriptor() ([]byte, []int)
func (*Parameters) GetDoSample ¶
func (m *Parameters) GetDoSample() bool
func (*Parameters) GetFrequencyPenalty ¶
func (m *Parameters) GetFrequencyPenalty() float32
func (*Parameters) GetMaxNewTokens ¶
func (m *Parameters) GetMaxNewTokens() int64
func (*Parameters) GetMaxTokens ¶
func (m *Parameters) GetMaxTokens() int64
func (*Parameters) GetPresencePenalty ¶
func (m *Parameters) GetPresencePenalty() float32
func (*Parameters) GetRepetitionPenalty ¶
func (m *Parameters) GetRepetitionPenalty() float32
func (*Parameters) GetTemperature ¶
func (m *Parameters) GetTemperature() float32
func (*Parameters) GetTopK ¶
func (m *Parameters) GetTopK() int64
func (*Parameters) GetTopP ¶
func (m *Parameters) GetTopP() float32
func (*Parameters) Marshal ¶
func (m *Parameters) Marshal() (dAtA []byte, err error)
func (*Parameters) MarshalToSizedBuffer ¶
func (m *Parameters) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Parameters) ProtoMessage ¶
func (*Parameters) ProtoMessage()
func (*Parameters) Reset ¶
func (m *Parameters) Reset()
func (*Parameters) Size ¶
func (m *Parameters) Size() (n int)
func (*Parameters) String ¶
func (m *Parameters) String() string
func (*Parameters) Unmarshal ¶
func (m *Parameters) Unmarshal(dAtA []byte) error
func (*Parameters) XXX_DiscardUnknown ¶
func (m *Parameters) XXX_DiscardUnknown()
func (*Parameters) XXX_Marshal ¶
func (m *Parameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Parameters) XXX_Merge ¶
func (m *Parameters) XXX_Merge(src proto.Message)
func (*Parameters) XXX_Size ¶
func (m *Parameters) XXX_Size() int
func (*Parameters) XXX_Unmarshal ¶
func (m *Parameters) XXX_Unmarshal(b []byte) error
type Usage ¶
type Usage struct { // The number of prompt tokens PromptTokens int64 `protobuf:"varint,1,opt,name=prompt_tokens,json=promptTokens,proto3" json:"prompt_tokens,omitempty"` // The number of generated tokens CompletionTokens int64 `protobuf:"varint,2,opt,name=completion_tokens,json=completionTokens,proto3" json:"completion_tokens,omitempty"` // The number of all: prompt_tokens + completion_tokens TotalTokens int64 `protobuf:"varint,3,opt,name=total_tokens,json=totalTokens,proto3" json:"total_tokens,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Usage) Descriptor ¶
func (*Usage) GetCompletionTokens ¶
func (*Usage) GetPromptTokens ¶
func (*Usage) GetTotalTokens ¶
func (*Usage) ProtoMessage ¶
func (*Usage) ProtoMessage()
func (*Usage) XXX_DiscardUnknown ¶
func (m *Usage) XXX_DiscardUnknown()
func (*Usage) XXX_Marshal ¶
func (*Usage) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.