dto

package
v0.0.0-...-b37c17f Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrOk            = 2000
	ErrUnknown       = 5000
	ErrInput         = 4000
	ErrUnauthorized  = 4010
	ErrAuthFailed    = 4011
	ErrRefreshFailed = 4012
)
View Source
const (
	OpenAiMessageEnding = "[DONE]"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizeReqFromClient

type AuthorizeReqFromClient struct {
	AuthorizationCode string `json:"authorizationCode"`
	CodeVerifier      string `json:"codeVerifier"`
}

type AuthorizeReqToOAuth

type AuthorizeReqToOAuth struct {
	ClientInfo
	AuthorizeReqFromClient
}

type ChatReqFromClient

type ChatReqFromClient struct {
	ModelId   int    `json:"modelId"`
	SessionId string `json:"sessionId"`
	Messages  any    `json:"messages"`
}

type ClientInfo

type ClientInfo struct {
	ClientId     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
}

type CommonResp

type CommonResp struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

type OpenAiChoice

type OpenAiChoice struct {
	Index        int            `json:"index"`
	Delta        *OpenAiMessage `json:"delta"`
	Logprobs     interface{}    `json:"logprobs"`
	FinishReason string         `json:"finish_reason"`
}

type OpenAiMessage

type OpenAiMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type OpenAiReqFromClient

type OpenAiReqFromClient struct {
	ModelId   int
	SessionId string
	Messages  []OpenAiMessage
}

type OpenAiReqToOpenAi

type OpenAiReqToOpenAi struct {
	Model    string          `json:"model"`
	Messages []OpenAiMessage `json:"messages"`
	Stream   bool            `json:"stream"`
}

type OpenAiResp

type OpenAiResp struct {
	Id                string          `json:"id"`
	Object            string          `json:"object"`
	Created           int64           `json:"created"`
	Model             string          `json:"model"`
	SystemFingerprint string          `json:"system_fingerprint"`
	Choices           []*OpenAiChoice `json:"choices"`
}

type QuickRefreshReq

type QuickRefreshReq struct {
	Action string `json:"action"`
}

type RefreshReqToOAuth

type RefreshReqToOAuth struct {
	ClientInfo
	RefreshToken string `json:"refreshToken"`
}

type RespFromOAuth

type RespFromOAuth struct {
	AccessToken  string `json:"accessToken"`
	RefreshToken string `json:"refreshToken"`
}

type VerifyResp

type VerifyResp struct {
	CommonResp
	Models []*dal.Model `json:"models"`
}

Jump to

Keyboard shortcuts

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