dto

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSuccess               = 0
	CodeInvalidParams         = 40001
	CodeUnauthorized          = 40101
	CodeForbidden             = 40301
	CodeNotFound              = 40401
	CodeInternalError         = 50001
	CodeValidationError       = 40002
	CodeClientUpgradeRequired = 42601
)

错误码常量

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

BaseResponse 基础响应格式

type CreateDigitalAssistantResponse

type CreateDigitalAssistantResponse struct {
	Code    int                        `json:"code"`
	Message string                     `json:"message"`
	Data    *contract.DigitalAssistant `json:"data"`
}

CreateDigitalAssistantResponse 创建数字助手响应

func NewCreateDigitalAssistantResponse

func NewCreateDigitalAssistantResponse(data *contract.DigitalAssistant) *CreateDigitalAssistantResponse

NewCreateDigitalAssistantResponse 创建成功响应

type ErrorDataResponse added in v0.1.13

type ErrorDataResponse struct {
	BaseResponse `json:",inline"`
	Data         interface{} `json:"data,omitempty"`
	Details      string      `json:"details,omitempty"`
}

ErrorDataResponse is an error response with structured machine-readable data.

func ErrorWithData added in v0.1.13

func ErrorWithData(code int, message string, data interface{}) *ErrorDataResponse

ErrorWithData returns an error response that carries structured remediation data.

type ErrorResponse

type ErrorResponse struct {
	BaseResponse `json:",inline"`
	Details      string `json:"details,omitempty"`
}

ErrorResponse 错误响应格式

func Error

func Error(code int, message string) *ErrorResponse

Error 错误响应

func ErrorWithDetails

func ErrorWithDetails(code int, message string, details string) *ErrorResponse

ErrorWithDetails 带详情的错误响应

type MessageDeltaPayload

type MessageDeltaPayload struct {
	MessageID string `json:"message_id,omitempty"`
	Role      string `json:"role,omitempty"`
	Content   string `json:"content"`
}

MessageDeltaPayload is the public message/reasoning delta payload.

type Response

type Response struct {
	BaseResponse `json:",inline"`
	Data         interface{} `json:"data,omitempty"`
}

Response 统一响应格式

func Success

func Success(data interface{}) *Response

Success 成功响应

type RunStartedPayload added in v0.1.23

type RunStartedPayload struct {
}

RunStartedPayload is the public projection of a run.started event.

type RunStatusPayload

type RunStatusPayload struct {
	Status  string `json:"status"`
	RunID   string `json:"run_id,omitempty"`
	Message string `json:"message,omitempty"`
}

RunStatusPayload is the public fallback payload for terminal events.

type RunTerminalPayload added in v0.1.17

type RunTerminalPayload struct {
	Status      string                        `json:"status"`
	Result      messaging.RunResultPayload    `json:"result"`
	Error       string                        `json:"error,omitempty"`
	Artifacts   []messaging.ArtifactPayload   `json:"artifacts,omitempty"`
	Usage       *messaging.UsagePayload       `json:"usage,omitempty"`
	Events      []messaging.RunEventRecord    `json:"events,omitempty"`
	StartedAt   string                        `json:"started_at,omitempty"`
	CompletedAt string                        `json:"completed_at,omitempty"`
	Metadata    *messaging.RunMetadataPayload `json:"metadata,omitempty"`
}

RunTerminalPayload is the public projection of a completed, failed, or cancelled run.

type RuntimeTodoItemPayload

type RuntimeTodoItemPayload struct {
	ID       string `json:"id"`
	Title    string `json:"title"`
	Status   string `json:"status"`
	Priority string `json:"priority,omitempty"`
}

RuntimeTodoItemPayload is the public runtime todo item.

type ToolCallDeltaPayload

type ToolCallDeltaPayload struct {
	ToolCallID string          `json:"tool_call_id"`
	Name       string          `json:"name"`
	Arguments  json.RawMessage `json:"arguments,omitempty"`
}

ToolCallDeltaPayload is the public tool-start payload.

type ToolCallResultPayload

type ToolCallResultPayload struct {
	ToolCallID string `json:"tool_call_id"`
	Name       string `json:"name"`
	Result     any    `json:"result"`
	Status     string `json:"status"` // success | error
}

ToolCallResultPayload is the public normalized tool result.

Jump to

Keyboard shortcuts

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