@economic/agents-react 1.1.7 → 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
@@ -221,7 +221,7 @@ type ChatSummary = {
221
221
  created_at: number;
222
222
  updated_at: number;
223
223
  };
224
- type MessageRating = {
224
+ type MessageFeedback = {
225
225
  message_id: string;
226
226
  rating: number;
227
227
  comment?: string;
@@ -297,8 +297,8 @@ declare function useChat<ToolContext extends Record<string, unknown>>(options: U
297
297
  isStreaming: boolean;
298
298
  isToolContinuation: boolean;
299
299
  };
300
- rateMessage: (messageId: string, rating: number, comment?: string) => Promise<unknown>;
301
- getMessageRatings: () => Promise<MessageRating[]>;
300
+ submitMessageFeedback: (messageId: string, rating: number, comment?: string) => Promise<unknown>;
301
+ getMessageFeedback: () => Promise<Record<string, MessageFeedback>>;
302
302
  };
303
303
  //#endregion
304
304
  //#region src/useAssistant.d.ts
@@ -342,9 +342,9 @@ declare function useAssistant<ToolContext extends Record<string, unknown>>(optio
342
342
  isStreaming: boolean;
343
343
  isToolContinuation: boolean;
344
344
  };
345
- rateMessage: (messageId: string, rating: number, comment?: string) => Promise<unknown>;
346
- getMessageRatings: () => Promise<MessageRating[]>;
345
+ submitMessageFeedback: (messageId: string, rating: number, comment?: string) => Promise<unknown>;
346
+ getMessageFeedback: () => Promise<Record<string, MessageFeedback>>;
347
347
  };
348
348
  };
349
349
  //#endregion
350
- export { type AgentConnectionState, type AgentConnectionStatus, type AgentConnectionType, type ChatSummary, type MessageRating, 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 await 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.7",
3
+ "version": "1.1.8",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"