Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) GetHistory(ctx context.Context, agentId string) (*resp.HistoryResp, error)
- func (c *Client) Interrupt(ctx context.Context, agentId string) (*resp.InterruptResp, error)
- func (c *Client) Join(ctx context.Context, name string, payload *req.JoinPropertiesReqBody) (*resp.JoinResp, error)
- func (c *Client) Leave(ctx context.Context, agentId string) (*resp.LeaveResp, error)
- func (c *Client) List(ctx context.Context, options ...req.ListOption) (*resp.ListResp, error)
- func (c *Client) Query(ctx context.Context, agentId string) (*resp.QueryResp, error)
- func (c *Client) Speak(ctx context.Context, agentId string, payload *req.SpeakBody) (*resp.SpeakResp, error)
- func (c *Client) Update(ctx context.Context, agentId string, payload *req.UpdateReqBody) (*resp.UpdateResp, error)
- type Config
- type ServiceRegion
Constants ¶
This section is empty.
Variables ¶
var RetryCount = 3
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient
@brief Creates a Conversational AI engine client with the specified configuration
@param config Configuration of the Conversational AI engine client. See Config for details.
@return Returns the Conversational AI engine client.
@return Returns an error object. If the request fails, the error object is not nil and contains error information.
@since v0.7.0
func (*Client) GetHistory ¶ added in v0.9.0
GetHistory
@brief Acquires the short-term memory of the specified agent instance
@since v0.9.0
@example Use this method to acquire the short-term memory of the specified agent instance.
@param ctx Context to control the request lifecycle.
@param agentId Agent ID.
@return Returns the response *HistoryResp. See api.HistoryResp for details.
@return Returns an error object. If the request fails, the error object is not nil and contains error information.
func (*Client) Interrupt ¶ added in v0.9.0
Interrupt
@brief Interrupts the specified agent instance
@since v0.9.0
@example Use this method to interrupt the specified agent instance.
@param ctx Context to control the request lifecycle.
@param agentId Agent ID.
@return Returns the response *InterruptResp. See api.InterruptResp for details.
@return Returns an error object. If the request fails, the error object is not nil and contains error information.
func (*Client) Join ¶
func (c *Client) Join(ctx context.Context, name string, payload *req.JoinPropertiesReqBody) (*resp.JoinResp, error)
Join @brief Creates an agent instance and joins the specified RTC channel
@since v0.7.0
@example Use this to create an agent instance in an RTC channel.
@post After successful execution, the agent will join the specified channel. You can perform subsequent operations using the returned agent ID.
@param ctx Context to control the request lifecycle.
@param name Unique identifier for the agent. The same identifier cannot be used repeatedly.
@param propertiesBody Configuration properties of the agent, including channel information, token, LLM settings, TTS settings, etc. See api.JoinPropertiesReqBody for details.
@return Returns the response *JoinResp. See api.JoinResp for details.
@return Returns an error object. If the request fails, the error object is not nil and contains error information.
func (*Client) Leave ¶
Leave
@brief Stops the specified agent instance and leaves the RTC channel
@since v0.7.0
@example Use this to stop an agent instance.
@post After successful execution, the agent will be stopped and leave the RTC channel
@note Ensure the agent ID has been obtained by calling the Join API before using this method.
@param ctx Context to control the request lifecycle.
@param agentId Agent ID.
@return Returns the response *LeaveResp. See api.LeaveResp for details.
@return Returns an error object. If the request fails, the error object is not nil and contains error information.
func (*Client) List ¶
List @brief Retrieves a list of agents that meet the specified criteria
@since v0.7.0
@example Use this to get a list of agents that meet the specified criteria.
@post After successful execution, a list of agents that meet the specified criteria will be retrieved.
@param ctx Context to control the request lifecycle.
@param ListOption Query parameters. See api.ListOption for details.
@return Returns the response *ListResp. See api.ListResp for details.
@return Returns an error object. If the request fails, the error object is not nil and contains error information.
func (*Client) Query ¶
Query
@brief Query the current status of the specified agent instance
@since v0.7.0
@example Use this to get the current status of the specified agent instance.
@post After successful execution, the current status of the specified agent instance will be retrieved.
@note Ensure the agent ID has been obtained by calling the Join API before using this method.
@param ctx Context to control the request lifecycle.
@param agentId Agent ID.
@return Returns the response *QueryResp. See api.QueryResp for details.
@return Returns an error object. If the request fails, the error object is not nil and contains error information.
func (*Client) Speak ¶ added in v0.9.0
func (c *Client) Speak(ctx context.Context, agentId string, payload *req.SpeakBody) (*resp.SpeakResp, error)
Speak
@brief Speaks a custom message for the specified agent instance
@since v0.9.0
@param ctx Context to control the request lifecycle.
@param agentId Agent ID.
@param payload Request body for the specified agent to speak a custom message. See api.SpeakBody for details.
@return Returns the response *SpeakResp. See api.SpeakResp for details.
@return Returns an error object. If the request fails, the error object is not nil and contains error information.
func (*Client) Update ¶
func (c *Client) Update(ctx context.Context, agentId string, payload *req.UpdateReqBody) (*resp.UpdateResp, error)
Update
@brief Adjusts the agent's parameters at runtime
@since v0.7.0
@example Use this to adjust the agent's parameters at runtime.
@post After successful execution, the agent's parameters will be adjusted.
@note Ensure the agent ID has been obtained by calling the Join API before using this method.
@param ctx Context to control the request lifecycle.
@param agentId Agent ID.
@param payload Parameters to be adjusted. See api.UpdateReqBody for details.
@return Returns the response *UpdateResp. See api.UpdateResp for details.
@return Returns an error object. If the request fails, the error object is not nil and contains error information.
type Config ¶
type Config struct {
// Agora AppID
AppID string
// Timeout for HTTP requests
HttpTimeout time.Duration
// Credential for accessing the Agora service.
//
// Available credential types:
//
// - BasicAuthCredential: See auth.NewBasicAuthCredential for details
Credential auth.Credential
// Domain area for the REST Client. See domain.Area for details.
DomainArea domain.Area
// Logger for the REST Client
//
// Implement the log.Logger interface in your project to output REST Client logs to your logging component.
//
// Alternatively, you can use the default logging component. See log.NewDefaultLogger for details.
Logger log.Logger
// Service version. See ServiceRegion for details.
ServiceRegion ServiceRegion
}
@brief Defines the configuration for the Conversational AI engine client
@since v0.7.0
type ServiceRegion ¶
type ServiceRegion int
@brief ServiceRegion represents the region of the Conversational AI engine service
@note The service in Chinese mainland and the global region are two different services
@since v0.7.0
const ( UnknownServiceRegion ServiceRegion = iota // ChineseMainlandServiceRegion represents the Conversational AI engine service in Chinese mainland ChineseMainlandServiceRegion // GlobalServiceRegion represents the Conversational AI engine service in the global region, except Chinese mainland GlobalServiceRegion )


Click the copy icon under Primary Certificate to obtain the App Certificate for your project.

