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.
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"`
}
SessionData is the v2 session format that supports scoped histories. It is backward-compatible with the legacy format (plain []Message).
Click to show internal directories.
Click to hide internal directories.