models

package
v1.65.5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Role    string       `json:"role"`           // O papel da mensagem, como "user" ou "assistant".
	Content string       `json:"content"`        // O conteúdo da mensagem.
	Meta    *MessageMeta `json:"meta,omitempty"` // Optional metadata for history compaction.
}

Message representa uma mensagem trocada com o modelo de linguagem.

func (*Message) IsValid

func (m *Message) IsValid() bool

IsValid valida se a mensagem tem um papel e conteúdo válidos.

type MessageMeta added in v1.65.2

type MessageMeta struct {
	IsSummary bool   `json:"is_summary,omitempty"` // true if this message is a compacted summary
	SummaryOf int    `json:"summary_of,omitempty"` // how many original messages were summarized
	Mode      string `json:"mode,omitempty"`       // "chat", "agent", "coder" — which mode produced this message
}

MessageMeta carries non-content metadata for history management.

type ResponseData

type ResponseData struct {
	Status   string `json:"status"`   // O status da resposta: "processing", "completed", ou "error".
	Response string `json:"response"` // A resposta da LLM, se o status for "completed".
	Message  string `json:"message"`  // Mensagem de erro, se o status for "error".
}

ResponseData representa os dados de resposta da LLM.

func (*ResponseData) IsValid

func (r *ResponseData) IsValid() bool

IsValid valida se o status da resposta é um dos valores esperados.

type SessionData added in v1.65.2

type SessionData struct {
	Version      int       `json:"version"` // 2 for the new format
	ChatHistory  []Message `json:"chat_history"`
	AgentHistory []Message `json:"agent_history,omitempty"`
	CoderHistory []Message `json:"coder_history,omitempty"`
	SharedMemory []Message `json:"shared_memory,omitempty"`
}

SessionData is the v2 session format that supports scoped histories. It is backward-compatible with the legacy format (plain []Message).

type UsageInfo added in v1.49.0

type UsageInfo struct {
	PromptTokens     int // Tokens usados no prompt
	CompletionTokens int // Tokens usados na resposta
	TotalTokens      int // Total de tokens usados
}

UsageInfo representa informações de uso de tokens retornadas pelas APIs

Jump to

Keyboard shortcuts

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