models

package
v1.16.63 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AIChatHistory added in v1.5.38

type AIChatHistory struct {
	Messages    []AIMessage `json:"messages"`
	ChatId      string      `json:"chat_id"`
	CreatedAt   time.Time   `json:"created_at"`
	Title       string      `json:"title"`
	Description string      `json:"description"`
	SystemMsg   string      `json:"system_msg"`
	Context     string      `json:"context"`
}

type AIChatResponse added in v1.5.38

type AIChatResponse struct {
	AIResponse   string     `json:"ai_response"`
	Tokens       int        `json:"tokens"`
	InputTokens  int        `json:"input_tokens"`
	OutputTokens int        `json:"output_tokens"`
	TimeTaken    int        `json:"time_taken"`
	ToolCalls    []ToolCall `json:"tool_calls,omitempty"`
}

type AIEmbeddingResponse added in v1.16.40

type AIEmbeddingResponse struct {
	Embeddings []float64 `json:"embeddings"`
	Usage      struct {
		PromptTokens int `json:"prompt_tokens"`
		TotalTokens  int `json:"total_tokens"`
	} `json:"usage"`
}

func (*AIEmbeddingResponse) GetEmbeddingsFloat32 added in v1.16.40

func (e *AIEmbeddingResponse) GetEmbeddingsFloat32() []float32

GetEmbeddingsFloat32 converts the embeddings to float32

type AIImageResponse added in v1.15.15

type AIImageResponse struct {
	ImageHostedUrl string `json:"image_hosted_url"`
	FilePath       string `json:"file_path"`
}

type AIMessage added in v1.5.38

type AIMessage struct {
	Images     []string         `json:"images"`          //Image URLs or Base64 image data URLs
	Files      []string         `json:"files"`           //File URLs or Base64 file data URLs
	ToolCalls  []OpenAIToolCall `json:"tools,omitempty"` // Tool calls based on OpenAI standards
	ToolCallId string           `json:"tool_call_id,omitempty"`
	Message    string           `json:"message"`
	Metadata   map[string]any   `json:"metadata"` //Store metadata related to the message, you can also store stringified JSON data
	Role       AIRoles          `json:"role"`
	Timestamp  time.Time        `json:"timestamp"`
	UniqueId   string           `json:"unique_id"`
}

type AIRoles added in v1.5.38

type AIRoles string
const (
	User      AIRoles = "user"
	Assistant AIRoles = "assistant"
	System    AIRoles = "system"
	Tool      AIRoles = "tool"
	Function  AIRoles = "function"
)

type Email added in v1.4.37

type Email struct {
	Subject string    `json:"subject"`
	Body    EmailBody `json:"body"`
}

type EmailBody added in v1.4.37

type EmailBody struct {
	Text string `json:"text"`
	HTML string `json:"html"`
}

type ErrorMessage added in v1.3.26

type ErrorMessage struct {
	ErrorCode   int    `json:"error_code"`
	Description string `json:"description"`
	ErrorMsg    string `json:"error_msg"`
	UserMsg     string `json:"user_msg"`
	ErrorLevel  string `json:"error_level"`
}

type GoogleCallbackData

type GoogleCallbackData struct {
	Email         string `json:"email"`
	Name          string `json:"name"`
	Picture       string `json:"picture"`
	VerifiedEmail bool   `json:"verified_email"`
	ID            string `json:"id"`
}

type GoogleConfig added in v1.6.57

type GoogleConfig struct {
	CookieExpiration time.Duration
	CookieDomain     string
	CookieHTTPSOnly  bool
	OAuthStateString string
	UseJWT           bool
	GetClaims        func(user *GoogleCallbackData) map[string]interface{}
}

type OpenAIFunctionDefinition added in v1.16.38

type OpenAIFunctionDefinition struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Parameters  any    `json:"parameters,omitempty"`
	Strict      bool   `json:"strict,omitempty"`
}

type OpenAIToolCall added in v1.16.38

type OpenAIToolCall struct {
	Index    *int   `json:"index,omitempty"`
	ID       string `json:"id,omitempty"`
	Type     string `json:"type,omitempty"`
	Function struct {
		Name      string `json:"name"`
		Arguments string `json:"arguments"`
	} `json:"function"`
}

type SingleEmailRequest added in v1.4.37

type SingleEmailRequest struct {
	Email
	To string `json:"to"`
}

type StreamedResponse added in v1.13.0

type StreamedResponse struct {
	AIResponse string     `json:"text"`
	TokenUsed  int        `json:"token_used"`
	TimeTaken  int        `json:"time_taken"`
	ToolCalls  []ToolCall `json:"tool_calls,omitempty"`
}

type ToolCall added in v1.16.35

type ToolCall struct {
	Index    *int             `json:"index,omitempty"`
	ID       string           `json:"id,omitempty"`
	Type     string           `json:"type,omitempty"`
	Function ToolCallFunction `json:"function"`
}

type ToolCallFunction added in v1.16.35

type ToolCallFunction struct {
	Name      string `json:"name"`
	Arguments string `json:"arguments"`
}

Jump to

Keyboard shortcuts

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