44import io .agora .rest .core .DefaultContext ;
55import io .agora .rest .services .convoai .req .JoinConvoAIReq ;
66import io .agora .rest .services .convoai .req .ListConvoAIReq ;
7+ import io .agora .rest .services .convoai .req .SpeakConvoAIReq ;
78import io .agora .rest .services .convoai .req .UpdateConvoAIReq ;
9+ import io .agora .rest .services .convoai .res .HistoryConvoAIRes ;
10+ import io .agora .rest .services .convoai .res .InterruptConvoAIRes ;
811import io .agora .rest .services .convoai .res .JoinConvoAIRes ;
912import io .agora .rest .services .convoai .res .ListConvoAIRes ;
1013import io .agora .rest .services .convoai .res .QueryConvoAIRes ;
14+ import io .agora .rest .services .convoai .res .SpeakConvoAIRes ;
1115import io .agora .rest .services .convoai .res .UpdateConvoAIRes ;
1216import reactor .core .publisher .Mono ;
1317
@@ -18,7 +22,8 @@ public abstract class ConvoAIClient {
1822 /**
1923 * @param convoAIConfig Instance of {@link ConvoAIConfig}.
2024 * @return Returns the Conversational AI engine client instance.
21- * @brief Creates a Conversational AI engine client with the specified configuration.
25+ * @brief Creates a Conversational AI engine client with the specified
26+ * configuration.
2227 * @since v0.3.0
2328 */
2429 public static synchronized ConvoAIClient create (ConvoAIConfig convoAIConfig ) {
@@ -36,11 +41,13 @@ public static synchronized ConvoAIClient create(ConvoAIConfig convoAIConfig) {
3641 }
3742
3843 /**
39- * @param request Parameters for the join request to the conversational AI engine, see {@link JoinConvoAIReq}.
44+ * @param request Parameters for the join request to the conversational AI
45+ * engine, see {@link JoinConvoAIReq}.
4046 * @return Returns the join response result, see {@link JoinConvoAIRes}.
4147 * @brief Creates an agent instance and joins the specified RTC channel.
4248 * @example Use this to create an agent instance in an RTC channel.
43- * @post After successful execution, the agent will join the specified channel. You can perform subsequent operations using the returned agent ID.
49+ * @post After successful execution, the agent will join the specified channel.
50+ * You can perform subsequent operations using the returned agent ID.
4451 * @since v0.3.0
4552 */
4653 public abstract Mono <JoinConvoAIRes > join (JoinConvoAIReq request );
@@ -49,18 +56,23 @@ public static synchronized ConvoAIClient create(ConvoAIConfig convoAIConfig) {
4956 * @param agentId Agent ID
5057 * @brief Stops the specified agent instance and leaves the RTC channel.
5158 * @example Use this to stop an agent instance.
52- * @post After successful execution, the agent will be stopped and leave the RTC channel.
53- * @note Ensure the agent ID has been obtained by calling the join API before using this method.
59+ * @post After successful execution, the agent will be stopped and leave the RTC
60+ * channel.
61+ * @note Ensure the agent ID has been obtained by calling the join API before
62+ * using this method.
5463 * @since v0.3.0
5564 */
5665 public abstract Mono <Void > leave (String agentId );
5766
5867 /**
59- * @param request Parameters for listing conversational agents, see {@link ListConvoAIReq}.
60- * @return Returns the list response result, see {@link ListConvoAIRes} for details.
68+ * @param request Parameters for listing conversational agents, see
69+ * {@link ListConvoAIReq}.
70+ * @return Returns the list response result, see {@link ListConvoAIRes} for
71+ * details.
6172 * @brief Retrieves a list of agents that meet the specified criteria.
6273 * @example Use this to get a list of agents that meet the specified criteria.
63- * @post After successful execution, a list of agents that meet the specified criteria will be retrieved.
74+ * @post After successful execution, a list of agents that meet the specified
75+ * criteria will be retrieved.
6476 * @since v0.3.0
6577 */
6678 public abstract Mono <ListConvoAIRes > list (ListConvoAIReq request );
@@ -70,22 +82,61 @@ public static synchronized ConvoAIClient create(ConvoAIConfig convoAIConfig) {
7082 * @return Returns the query response result, see {@link QueryConvoAIRes}
7183 * @brief Query the current status of the specified agent instance.
7284 * @example Use this to get the current status of the specified agent instance.
73- * @post After successful execution, the current running status information of the specified agent instance will be retrieved.
74- * @note Ensure the agent ID has been obtained by calling the join API before using this method.
85+ * @post After successful execution, the current running status information of
86+ * the specified agent instance will be retrieved.
87+ * @note Ensure the agent ID has been obtained by calling the join API before
88+ * using this method.
7589 * @since v0.3.0
7690 */
7791 public abstract Mono <QueryConvoAIRes > query (String agentId );
7892
7993 /**
8094 * @param agentId Agent ID
81- * @param request Parameters for updating the conversational agent, see {@link UpdateConvoAIReq} for details.
82- * @return Returns the update response result, see {@link UpdateConvoAIRes}.
95+ * @param request Parameters for updating the conversational agent, see
96+ * {@link UpdateConvoAIReq} for details.
97+ * @return Returns the update response result, see {@link UpdateConvoAIRes}
98+ * for details.
8399 * @brief Adjusts the agent's parameters at runtime.
84100 * @example Use this to adjust the agent's parameters at runtime.
85101 * @post After successful execution, the agent's parameters will be adjusted.
86- * @note Ensure the agent ID has been obtained by calling the join API before using this method.
102+ * @note Ensure the agent ID has been obtained by calling the join API before
103+ * using this method.
87104 * @since v0.3.0
88105 */
89106 public abstract Mono <UpdateConvoAIRes > update (String agentId , UpdateConvoAIReq request );
90107
108+ /**
109+ * @brief Acquires the short-term memory of the specified agent instance
110+ * @since v0.4.0
111+ * @example Use this method to acquire the short-term memory of the specified
112+ * agent instance.
113+ * @param agentId Agent ID.
114+ * @return Returns the short-term memory of the specified agent instance. See
115+ * {@link HistoryConvoAIRes} for details.
116+ */
117+ public abstract Mono <HistoryConvoAIRes > getHistory (String agentId );
118+
119+ /**
120+ * @brief Interrupts the specified agent instance
121+ * @since v0.9.0
122+ * @example Use this method to interrupt the specified agent instance.
123+ * @param agentId Agent ID.
124+ * @return Returns the interrupt response result, see
125+ * {@link InterruptConvoAIRes}.
126+ */
127+ public abstract Mono <InterruptConvoAIRes > interrupt (String agentId );
128+
129+ /**
130+ * @brief Speaks a custom message for the specified agent instance
131+ * @since v0.9.0
132+ * @example Use this method to speak a custom message for the specified agent
133+ * instance.
134+ * @param agentId Agent ID.
135+ * @param request Request body for the specified agent to speak a custom
136+ * message. See {@link SpeakConvoAIReq} for details.
137+ * @return Returns the response *SpeakResp. See {@link SpeakConvoAIRes} for
138+ * details.
139+ */
140+ public abstract Mono <SpeakConvoAIRes > speak (String agentId , SpeakConvoAIReq request );
141+
91142}
0 commit comments