types

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatResponse

type ChatResponse struct {
	Content   string     `json:"content"`
	ToolCalls []ToolCall `json:"tool_calls,omitempty"`
}

type ContentPart

type ContentPart struct {
	Type     string    `json:"type"` // "text", "image_url", "video_url", "audio_url", "file"
	Text     string    `json:"text,omitempty"`
	ImageURL *MediaURL `json:"image_url,omitempty"`
	VideoURL *MediaURL `json:"video_url,omitempty"`
	AudioURL *MediaURL `json:"audio_url,omitempty"`
	File     *FileInfo `json:"file,omitempty"`
}

ContentPart represents a part of a multimodal message content

type FileInfo

type FileInfo struct {
	Name     string `json:"name,omitempty"`
	MimeType string `json:"mime_type,omitempty"`
	URL      string `json:"url,omitempty"`
	Size     int64  `json:"size,omitempty"`
}

FileInfo represents file metadata

type Function

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

type MediaURL

type MediaURL struct {
	URL    string `json:"url"`
	Detail string `json:"detail,omitempty"` // "auto", "low", "high" (for images)
}

MediaURL represents a URL with optional detail level (for images)

type Message

type Message struct {
	ID      string `json:"id,omitempty"`
	Role    string `json:"role"`
	Content string `json:"content"`
	// 多模态内容,非空时优先于 Content
	ContentParts []ContentPart `json:"content_parts,omitempty"`
	ChannelID    string        `json:"channel_id,omitempty"`
	From         string        `json:"from,omitempty"`
	ToolCalls    []ToolCall    `json:"tool_calls,omitempty"`
	ToolCallID   string        `json:"tool_call_id,omitempty"` // Required for tool role messages
}

type ToolCall

type ToolCall struct {
	ID        string                 `json:"id"`
	Name      string                 `json:"name"`
	Arguments map[string]interface{} `json:"arguments"`
	// 兼容旧代码
	Type     string   `json:"type,omitempty"`
	Function Function `json:"function,omitempty"`
}

Jump to

Keyboard shortcuts

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