Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages the connection to the Tiktoken gRPC service and provides the main interface for sending requests and receiving responses to/from the service.
func NewClient ¶
NewClient initializes a new connection to the grpc service using the provided options.
type InvalidEncodingNameErr ¶
type InvalidEncodingNameErr TiktokenEncodingName
InvalidEncodingNameErr is returned if the given TiktokenEncodingName is not recognized by the library.
func (InvalidEncodingNameErr) Error ¶
func (e InvalidEncodingNameErr) Error() string
type TiktokenEncodingName ¶
type TiktokenEncodingName string
TiktokenEncodingName is an enum for valid encoding names accepted by the tiktoken service.
const ( CL100kBase TiktokenEncodingName = "cl100k_base" P50kBase TiktokenEncodingName = "p50k_base" R50kBase TiktokenEncodingName = "r50k_base" GPT2Encoding TiktokenEncodingName = "gpt2" )
func (TiktokenEncodingName) IsValid ¶
func (n TiktokenEncodingName) IsValid() bool
IsValid returns whether the given tiktoken encoding name fits one of the enum values, since go enums can be casted with bogus values easily.
Click to show internal directories.
Click to hide internal directories.