yao/openapi/chat/types.go
Max 279ae161c6 Enhance chat storage design with HTTP API documentation
- Added comprehensive documentation for the new RESTful HTTP APIs for managing chat sessions and messages, including endpoints for listing, retrieving, updating, and deleting chat sessions.
- Included detailed request and response examples for each endpoint, along with query parameters and permission filtering guidelines.
- Updated the `CHAT_STORAGE_DESIGN.md` to reflect these changes, ensuring clarity on the API's functionality and usage.
2025-12-09 16:03:17 +08:00

25 lines
1.1 KiB
Go

package chat
import "github.com/yaoapp/yao/agent/context"
// =============================================================================
// Completion Types
// =============================================================================
// AppendMessagesRequest represents the request body for appending messages to running completion
type AppendMessagesRequest struct {
Type context.InterruptType `json:"type" binding:"required"` // Interrupt type: "graceful" or "force"
Messages []context.Message `json:"messages" binding:"required"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
// =============================================================================
// Chat Session Types
// =============================================================================
// UpdateChatRequest represents the request for updating a chat session
type UpdateChatRequest struct {
Title *string `json:"title,omitempty"` // Chat title
Status *string `json:"status,omitempty"` // Status: "active" or "archived"
Metadata map[string]interface{} `json:"metadata,omitempty"` // Additional metadata
}