4
4
import io .agora .rest .core .DefaultContext ;
5
5
import io .agora .rest .services .convoai .req .JoinConvoAIReq ;
6
6
import io .agora .rest .services .convoai .req .ListConvoAIReq ;
7
+ import io .agora .rest .services .convoai .req .SpeakConvoAIReq ;
7
8
import 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 ;
8
11
import io .agora .rest .services .convoai .res .JoinConvoAIRes ;
9
12
import io .agora .rest .services .convoai .res .ListConvoAIRes ;
10
13
import io .agora .rest .services .convoai .res .QueryConvoAIRes ;
14
+ import io .agora .rest .services .convoai .res .SpeakConvoAIRes ;
11
15
import io .agora .rest .services .convoai .res .UpdateConvoAIRes ;
12
16
import reactor .core .publisher .Mono ;
13
17
@@ -18,7 +22,8 @@ public abstract class ConvoAIClient {
18
22
/**
19
23
* @param convoAIConfig Instance of {@link ConvoAIConfig}.
20
24
* @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.
22
27
* @since v0.3.0
23
28
*/
24
29
public static synchronized ConvoAIClient create (ConvoAIConfig convoAIConfig ) {
@@ -36,11 +41,13 @@ public static synchronized ConvoAIClient create(ConvoAIConfig convoAIConfig) {
36
41
}
37
42
38
43
/**
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}.
40
46
* @return Returns the join response result, see {@link JoinConvoAIRes}.
41
47
* @brief Creates an agent instance and joins the specified RTC channel.
42
48
* @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.
44
51
* @since v0.3.0
45
52
*/
46
53
public abstract Mono <JoinConvoAIRes > join (JoinConvoAIReq request );
@@ -49,18 +56,23 @@ public static synchronized ConvoAIClient create(ConvoAIConfig convoAIConfig) {
49
56
* @param agentId Agent ID
50
57
* @brief Stops the specified agent instance and leaves the RTC channel.
51
58
* @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.
54
63
* @since v0.3.0
55
64
*/
56
65
public abstract Mono <Void > leave (String agentId );
57
66
58
67
/**
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.
61
72
* @brief Retrieves a list of agents that meet the specified criteria.
62
73
* @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.
64
76
* @since v0.3.0
65
77
*/
66
78
public abstract Mono <ListConvoAIRes > list (ListConvoAIReq request );
@@ -70,22 +82,61 @@ public static synchronized ConvoAIClient create(ConvoAIConfig convoAIConfig) {
70
82
* @return Returns the query response result, see {@link QueryConvoAIRes}
71
83
* @brief Query the current status of the specified agent instance.
72
84
* @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.
75
89
* @since v0.3.0
76
90
*/
77
91
public abstract Mono <QueryConvoAIRes > query (String agentId );
78
92
79
93
/**
80
94
* @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.
83
99
* @brief Adjusts the agent's parameters at runtime.
84
100
* @example Use this to adjust the agent's parameters at runtime.
85
101
* @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.
87
104
* @since v0.3.0
88
105
*/
89
106
public abstract Mono <UpdateConvoAIRes > update (String agentId , UpdateConvoAIReq request );
90
107
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
+
91
142
}
0 commit comments