Documentation
¶
Index ¶
- Constants
- type ClientEvent
- type ModelTokenLimits
- type Service
- func (s *Service) BaseURL() string
- func (s *Service) ChatModelTokenLimits(modelID string) (ModelTokenLimits, bool)
- func (s *Service) InvalidateChatModels()
- func (s *Service) ListChatModels(ctx context.Context) ([]api.ModelInfo, error)
- func (s *Service) RefreshChatModels(ctx context.Context) ([]api.ModelInfo, error)
- func (s *Service) ReportClientEvents(ctx context.Context, events []ClientEvent) error
- func (s *Service) SetAccessToken(token string)
- func (s *Service) SetBaseURL(baseURL string)
Constants ¶
View Source
const ( DefaultBaseURL = "https://ai.space.opencsg.com" DefaultLoginURL = "" /* 181-byte string literal not displayed */ DefaultAccessTokenURL = "https://opencsg.com/settings/access-token" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientEvent ¶ added in v0.9.5
type ClientEvent struct {
Module string `json:"m"`
ID string `json:"id"`
Value string `json:"v"`
ClientID string `json:"c_id,omitempty"`
ClientIP string `json:"c_ip,omitempty"`
Extension string `json:"ext,omitempty"`
}
ClientEvent mirrors the OpenCSG /events payload shape.
type ModelTokenLimits ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) ChatModelTokenLimits ¶
func (s *Service) ChatModelTokenLimits(modelID string) (ModelTokenLimits, bool)
func (*Service) InvalidateChatModels ¶
func (s *Service) InvalidateChatModels()
func (*Service) ListChatModels ¶
func (*Service) RefreshChatModels ¶
func (*Service) ReportClientEvents ¶ added in v0.9.5
func (s *Service) ReportClientEvents(ctx context.Context, events []ClientEvent) error
func (*Service) SetAccessToken ¶
func (*Service) SetBaseURL ¶
Click to show internal directories.
Click to hide internal directories.