@economic/agents-react 1.1.6 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -214,6 +214,20 @@ type AgentConnectionState = {
214
214
  type: AgentConnectionType;
215
215
  subAgentName?: string;
216
216
  };
217
+ type ChatSummary = {
218
+ name: string;
219
+ title?: string;
220
+ summary?: string;
221
+ created_at: number;
222
+ updated_at: number;
223
+ };
224
+ type MessageFeedback = {
225
+ message_id: string;
226
+ rating: number;
227
+ comment?: string;
228
+ created_at: number;
229
+ updated_at: number;
230
+ };
217
231
  //#endregion
218
232
  //#region src/useAgent.d.ts
219
233
  interface UseAgentOptions {
@@ -283,18 +297,11 @@ declare function useChat<ToolContext extends Record<string, unknown>>(options: U
283
297
  isStreaming: boolean;
284
298
  isToolContinuation: boolean;
285
299
  };
286
- rateMessage: (messageId: string, rating: number, comment?: string) => Promise<unknown>;
287
- getMessageRatings: () => Promise<unknown>;
300
+ submitMessageFeedback: (messageId: string, rating: number, comment?: string) => Promise<unknown>;
301
+ getMessageFeedback: () => Promise<Record<string, MessageFeedback>>;
288
302
  };
289
303
  //#endregion
290
304
  //#region src/useAssistant.d.ts
291
- type ChatSummary = {
292
- name: string;
293
- title?: string;
294
- summary?: string;
295
- created_at: number;
296
- updated_at: number;
297
- };
298
305
  interface UseAssistantOptions<ToolContext extends Record<string, unknown> = Record<string, unknown>> extends Omit<UseChatOptions<ToolContext>, "actorId" | "getInitialMessages"> {}
299
306
  declare function useAssistant<ToolContext extends Record<string, unknown>>(options: UseAssistantOptions<ToolContext>): {
300
307
  currentChatName: string | undefined;
@@ -335,9 +342,9 @@ declare function useAssistant<ToolContext extends Record<string, unknown>>(optio
335
342
  isStreaming: boolean;
336
343
  isToolContinuation: boolean;
337
344
  };
338
- rateMessage: (messageId: string, rating: number, comment?: string) => Promise<unknown>;
339
- getMessageRatings: () => Promise<unknown>;
345
+ submitMessageFeedback: (messageId: string, rating: number, comment?: string) => Promise<unknown>;
346
+ getMessageFeedback: () => Promise<Record<string, MessageFeedback>>;
340
347
  };
341
348
  };
342
349
  //#endregion
343
- export { type AgentConnectionState, type AgentConnectionStatus, type AgentConnectionType, type ChatSummary, useAgent, useAssistant, useChat };
350
+ export { type AgentConnectionState, type AgentConnectionStatus, type AgentConnectionType, type ChatSummary, type MessageFeedback, useAgent, useAssistant, useChat };
package/dist/index.mjs CHANGED
@@ -57,22 +57,22 @@ function useChat(options) {
57
57
  chat.messages.length,
58
58
  welcomeMessage
59
59
  ]);
60
- async function rateMessage(messageId, rating, comment) {
61
- return agent.call("rateMessage", [
60
+ async function submitMessageFeedback(messageId, rating, comment) {
61
+ return agent.call("submitMessageFeedback", [
62
62
  messageId,
63
63
  rating,
64
64
  comment
65
65
  ]);
66
66
  }
67
- async function getMessageRatings() {
68
- return agent.call("getMessageRatings");
67
+ async function getMessageFeedback() {
68
+ return await agent.call("getMessageFeedback");
69
69
  }
70
70
  return {
71
71
  status,
72
72
  agent,
73
73
  chat,
74
- rateMessage,
75
- getMessageRatings
74
+ submitMessageFeedback,
75
+ getMessageFeedback
76
76
  };
77
77
  }
78
78
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@economic/agents-react",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"