dto

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSuccess         = 0
	CodeInvalidParams   = 40001
	CodeNotFound        = 40401
	CodeInternalError   = 50001
	CodeValidationError = 40002
)

错误码常量

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactPayload

type ArtifactPayload = events.ArtifactPayload

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 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 = events.MessageDeltaPayload

type Response

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

Response 统一响应格式

func Success

func Success(data interface{}) *Response

Success 成功响应

type RunStatusPayload

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

type RuntimeTodoItemPayload

type RuntimeTodoItemPayload = events.RuntimeTodoItem

type SessionEvent

type SessionEvent struct {
	Type      events.EventType `json:"type"`
	SessionID string           `json:"session_id"`
	Payload   interface{}      `json:"payload"`
	Sequence  int64            `json:"sequence"`
	Timestamp int64            `json:"timestamp"` // Unix timestamp in milliseconds
}

type ToolCallDeltaPayload

type ToolCallDeltaPayload = events.ToolCallPayload

type ToolCallResultPayload

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

Jump to

Keyboard shortcuts

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