Documentation
¶
Index ¶
- Constants
- type ArtifactPayload
- type BaseResponse
- type CreateDigitalAssistantResponse
- type ErrorDataResponse
- type ErrorResponse
- type MessageDeltaPayload
- type Response
- type RunStatusPayload
- type RunTerminalPayload
- type RuntimeTodoItemPayload
- type SessionEvent
- type ToolCallDeltaPayload
- type ToolCallResultPayload
Constants ¶
View Source
const ( CodeSuccess = 0 CodeInvalidParams = 40001 CodeNotFound = 40401 CodeInternalError = 50001 CodeValidationError = 40002 CodeClientUpgradeRequired = 42601 )
错误码常量
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtifactPayload ¶
type ArtifactPayload = events.ArtifactPayload
type BaseResponse ¶
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 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 统一响应格式
type RunStatusPayload ¶
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 []assistantdomain.ArtifactRecord `json:"artifacts,omitempty"`
Usage *agent.Usage `json:"usage,omitempty"`
Events []assistantdomain.TerminalEventRecord `json:"events,omitempty"`
StartedAt string `json:"started_at,omitempty"`
CompletedAt string `json:"completed_at,omitempty"`
Metadata *assistantdomain.RunMetadata `json:"metadata,omitempty"`
}
RunTerminalPayload is the public projection of a completed, failed, or cancelled run.
type RuntimeTodoItemPayload ¶
type RuntimeTodoItemPayload = events.RuntimeTodoItem
type SessionEvent ¶
type ToolCallDeltaPayload ¶
type ToolCallDeltaPayload = events.ToolCallPayload
type ToolCallResultPayload ¶
Click to show internal directories.
Click to hide internal directories.