Documentation
¶
Index ¶
- Constants
- type BaseResponse
- type CreateDigitalAssistantResponse
- type ErrorDataResponse
- type ErrorResponse
- type GlobalConfigData
- type MessageDeltaPayload
- type Response
- type RunStartedPayload
- type RunStatusPayload
- type RunTerminalPayload
- type RuntimeTodoItemPayload
- type ToolCallDeltaPayload
- type ToolCallResultPayload
Constants ¶
const ( CodeSuccess = 0 CodeInvalidParams = 40001 CodeForbidden = 40301 CodeNotFound = 40401 CodeConflict = 40901 CodeInternalError = 50001 CodeNotImplemented = 50101 CodeValidationError = 40002 CodeClientUpgradeRequired = 42601 )
错误码常量
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseResponse ¶
type BaseResponse struct {
Code int `json:"code"`
ReqID string `json:"req_id,omitempty"`
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 ErrorWithDetails ¶
func ErrorWithDetails(code int, message string, details string) *ErrorResponse
ErrorWithDetails 带详情的错误响应
type GlobalConfigData ¶ added in v0.3.3
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 统一响应格式
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.