Documentation
¶
Overview ¶
Package schema defines the data structures used by the Dify Go SDK. This package contains all the request and response schema for the Dify API operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RunWorkflowRequest ¶
type RunWorkflowRequest struct {
Inputs json.RawMessage `json:"inputs"`
ResponseMode string `json:"response_mode"`
User string `json:"user"`
Files []RunWorkflowRequestFile `json:"files"`
}
RunWorkflowRequest represents the request body for running a workflow.
type RunWorkflowRequestFile ¶
type RunWorkflowRequestFile struct {
Type string `json:"type"`
TransferMethod string `json:"transfer_method"`
URL string `json:"url"`
UploadFileID string `json:"upload_file_id"`
}
RunWorkflowRequestFile represents a file included in a workflow run request.
type RunWorkflowResponse ¶
type RunWorkflowResponse struct {
Event string `json:"event"`
WorkflowRunID string `json:"workflow_run_id"`
TaskID string `json:"task_id"`
Data RunWorkflowResponseData `json:"data"`
}
RunWorkflowResponse represents the response from running a workflow.
type RunWorkflowResponseData ¶
type RunWorkflowResponseData struct {
ID string `json:"id"`
WorkflowID string `json:"workflow_id"`
Status string `json:"status"`
Outputs map[string]any `json:"outputs"`
Error string `json:"error"`
ElapsedTime float64 `json:"elapsed_time"`
TotalToken int `json:"total_token"`
TotalSteps int `json:"total_steps"`
CreatedAt int `json:"created_at"`
FinishedAt int `json:"finished_at"`
}
RunWorkflowResponseData contains the detailed data from a workflow run response.
type StreamEvent ¶
type StreamEvent[T any] struct { Err string `json:"err"` Data T `json:"data"` Type string `json:"event"` Done bool `json:"done"` }
StreamEvent represents an event in a streaming response. T is the type of data contained in the event.
type UploadFileBody ¶
type UploadFileBody struct {
User string `json:"user"`
}
UploadFileBody contains user information for file upload requests
type UploadFileRequest ¶
type UploadFileRequest struct {
File []byte `json:"file"`
RequestBody UploadFileBody `json:"user"`
}
UploadFileRequest upload file request
type UploadFileResponse ¶
type UploadFileResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Size int64 `json:"size"`
Extension string `json:"extension"`
MineType string `json:"mine_type"`
CreateBy string `json:"create_by"`
CreateAt int64 `json:"create_time"`
}
UploadFileResponse upload file response