response

package
v0.0.0-...-4fe83b5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ParamError = gin.H{"code": 10001, "message": "param error"}

	InternalError = gin.H{"code": 10002, "message": "internal error"}

	SuccessWithData = func(data interface{}) gin.H {
		return gin.H{"code": 0, "data": data}
	}
)

Functions

This section is empty.

Types

type ChatCompletion

type ChatCompletion struct {
	Id      string `json:"id"`
	Object  string `json:"object"`
	Created int    `json:"created"`
	Model   string `json:"model"`
	Choices []struct {
		Index   int `json:"index"`
		Message struct {
			Role    string `json:"role"`
			Content string `json:"content"`
		} `json:"message"`
		FinishReason string `json:"finish_reason"`
	} `json:"choices"`
	Usage struct {
		PromptTokens        int `json:"prompt_tokens"`
		CompletionTokens    int `json:"completion_tokens"`
		TotalTokens         int `json:"total_tokens"`
		PromptTokensDetails struct {
			TextTokens int `json:"text_tokens"`
		} `json:"prompt_tokens_details"`
		CompletionTokensDetails struct {
			ContentTokens   int `json:"content_tokens"`
			ReasoningTokens int `json:"reasoning_tokens"`
		} `json:"completion_tokens_details"`
	} `json:"usage"`
}

type GetImage

type GetImage struct {
	Path string `json:"path"`
	URL  string `json:"url"`
}

func UnmarshalGetImage

func UnmarshalGetImage(data string) (*GetImage, error)

func (*GetImage) Marsh

func (g *GetImage) Marsh() (string, error)

Jump to

Keyboard shortcuts

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