resp

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrResponse

type ErrResponse struct {
	// Error details
	Detail string `json:"detail"`
	// Reason for the error
	Reason string `json:"reason"`
}

@brief Error response returned by the Conversational AI engine API

@since v0.7.0

type HistoryContent added in v0.9.0

type HistoryContent struct {
	// The role of sending messages:
	//
	//  - user: User.
	//
	//  - assistant: Agent.
	Role string `json:"role"`
	// The content of the message
	Content string `json:"content"`
}

@brief Agent short-term memory content

@since v0.9.0

type HistoryResp added in v0.9.0

type HistoryResp struct {
	// Response returned by the Conversational AI engine API, see Response for details
	Response
	// Success response, see HistorySuccessResp for details
	SuccessRes HistorySuccessResp
}

@brief HistoryResp returned by the Conversational AI engine History API

@since v0.9.0

type HistorySuccessResp added in v0.9.0

type HistorySuccessResp struct {
	// The agent creation timestamp
	StartTs int64 `json:"start_ts"`
	// Unique identifier of the agent
	AgentId string `json:"agent_id"`
	// Only returns the running status of the agent
	Status string `json:"status"`
	// Agent short-term memory content
	Contents []HistoryContent `json:"contents"`
}

@brief Successful response returned by the Conversational AI engine History API

@since v0.9.0

type InterruptResp added in v0.9.0

type InterruptResp struct {
	// Response returned by the Conversational AI engine API, see Response for details
	Response
	// Successful response, see InterruptSuccessResp for details
	SuccessRes InterruptSuccessResp
}

@brief InterruptResp returned by the Conversational AI engine Interrupt API

@since v0.9.0

type InterruptSuccessResp added in v0.9.0

type InterruptSuccessResp struct {
	// The channel name of the agent
	Channel string `json:"channel"`
	// Unique identifier of the agent
	AgentId string `json:"agent_id"`
	// The start timestamp of the agent
	StartTs int64 `json:"start_ts"`
}

@brief Successful response returned by the Conversational AI engine Interrupt API

@since v0.9.0

type JoinResp

type JoinResp struct {
	// Response returned by the Conversational AI engine API, see Response for details
	Response
	// Successful response, see JoinSuccessResp for details
	SuccessResp JoinSuccessResp
}

@brief JoinResp returned by the Conversational AI engine Join API

@since v0.7.0

type JoinSuccessResp

type JoinSuccessResp struct {
	// Unique identifier of the agent
	AgentId string `json:"agent_id"`
	// Timestamp when the agent was created
	CreateTs int `json:"create_ts"`
	// Running status of the agent
	//
	//  - IDLE (0): The agent is idle.
	//
	//  - STARTING (1): The agent is starting.
	//
	//  - RUNNING (2): The agent is running.
	//
	//  - STOPPING (3): The agent is stopping.
	//
	//  - STOPPED (4): The agent has stopped.
	//
	//  - RECOVERING (5): The agent is recovering.
	//
	//  - FAILED (6): The agent has failed.
	Status string `json:"status"`
}

@brief Successful response returned by the Conversational AI engine Join API

@since v0.7.0

type LeaveResp

type LeaveResp struct {
	// Response returned by the Conversational AI engine API, see Response for details
	Response
}

@brief LeaveResp returned by the Conversational AI engine Leave API

@since v0.7.0

type ListResp

type ListResp struct {
	// Response returned by the Conversational AI engine API, see Response for details
	Response
	// Successful response, see ListSuccessResp for details
	SuccessRes ListSuccessResp
}

@brief ListResp returned by the Conversational AI engine List API

@since v0.7.0

type ListSuccessResp

type ListSuccessResp struct {
	// Intelligent agent data information
	Data struct {
		// Number of intelligent agents returned this time
		Count int `json:"count"`
		// List of intelligent agents that meet the conditions
		List []struct {
			// Intelligent agent creation timestamp
			StartTs int64 `json:"start_ts"`
			// Intelligent agent running status
			//
			//  - IDLE (0): Idle state of the intelligent agent.
			//
			//  - STARTING (1): Intelligent agent is starting.
			//
			//  - RUNNING (2): Intelligent agent is running.
			//
			//  - STOPPING (3): Intelligent agent is stopping.
			//
			//  - STOPPED (4): Intelligent agent has completed exit.
			//
			//  - RECOVERING (5): Intelligent agent is recovering.
			//
			//  - FAILED (6): Intelligent agent execution failed.
			Status string `json:"status"`
			// Unique identifier of the intelligent agent
			AgentId string `json:"agent_id"`
		} `json:"list"`
	} `json:"data"`
	// Metadata of the returned list
	Meta struct {
		// Pagination cursor
		Cursor string `json:"cursor"`
		// Total number of intelligent agents that meet the query conditions
		Total int `json:"total"`
	} `json:"meta"`
	// Request status
	Status string `json:"status"`
}

@brief Successful response returned by the Conversational AI engine List API

@since v0.7.0

type QueryResp

type QueryResp struct {
	// Response returned by the Conversational AI engine API, see Response for details
	Response
	// Success response, see QuerySuccessResp for details
	SuccessRes QuerySuccessResp
}

@brief QueryResp returned by the Conversational AI engine Query API

@since v0.7.0

type QuerySuccessResp

type QuerySuccessResp struct {
	// Request information
	Message string `json:"message"`
	// The agent creation timestamp
	StartTs int64 `json:"start_ts"`
	// The agent stop timestamp
	StopTs int64 `json:"stop_ts"`
	// Unique identifier of the agent
	AgentId string `json:"agent_id"`
	// Running status of the agent
	//
	//  - IDLE (0): The agent is idle.
	//
	//  - STARTING (1): The agent is starting.
	//
	//  - RUNNING (2): The agent is running.
	//
	//  - STOPPING (3): The agent is stopping.
	//
	//  - STOPPED (4): The agent has stopped.
	//
	//  - RECOVERING (5): The agent is recovering.
	//
	//  - FAILED (6): The agent has failed.
	Status string `json:"status"`
}

@brief Successful response returned by the Conversational AI engine Query API

@since v0.7.0

type Response

type Response struct {
	// HTTP base response, see agora.BaseResponse for details
	*agora.BaseResponse
	// Error response, see ErrResponse for details
	ErrResponse ErrResponse
}

@brief Response returned by the Conversational AI engine API

@since v0.7.0

func (Response) IsSuccess

func (b Response) IsSuccess() bool

@brief Determines whether the response returned by the Conversational AI engine API is successful

@note If the response is successful, continue to read the data in the successful response; otherwise, read the data in the error response

@return Returns true if successful, otherwise false

@since v0.7.0

type SpeakResp added in v0.9.0

type SpeakResp struct {
	// Response returned by the Conversational AI engine API, see Response for details
	Response
	// Successful response, see SpeakSuccessResp for details
	SuccessRes SpeakSuccessResp
}

@brief SpeakResp returned by the Conversational AI engine Speak API

@since v0.9.0

type SpeakSuccessResp added in v0.9.0

type SpeakSuccessResp struct {
	// The channel name of the agent
	Channel string `json:"channel"`
	// Unique identifier of the agent
	AgentId string `json:"agent_id"`
	// The start timestamp of the agent
	StartTs int64 `json:"start_ts"`
}

@brief Successful response returned by the Conversational AI engine Speak API

@since v0.9.0

type UpdateResp

type UpdateResp struct {
	// Response returned by the Conversational AI engine API, see Response for details
	Response
	// Successful response, see UpdateSuccessResp for details
	SuccessResp UpdateSuccessResp
}

@brief Response returned by the Conversational AI engine Update API

@since v0.7.0

type UpdateSuccessResp

type UpdateSuccessResp struct {
	// Unique identifier of the agent
	AgentId string `json:"agent_id"`
	// Timestamp when the agent was created
	CreateTs int `json:"create_ts"`
	// Running status of the agent
	//
	//  - IDLE (0): The agent is idle.
	//
	//  - STARTING (1): The agent is starting.
	//
	//  - RUNNING (2): The agent is running.
	//
	//  - STOPPING (3): The agent is stopping.
	//
	//  - STOPPED (4): The agent has stopped.
	//
	//  - RECOVERING (5): The agent is recovering.
	//
	//  - FAILED (6): The agent has failed.
	State string `json:"state"`
}

@brief Successful response returned by the Conversational AI engine Update API

@since v0.7.0

Jump to

Keyboard shortcuts

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