@aigentyc/chat-sdk 0.5.4 → 0.6.0

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.
Files changed (35) hide show
  1. package/context7.json +1 -1
  2. package/dist/{SlotsContext-B_087V7B.d.ts → SlotsContext-hUp2jze9.d.ts} +8 -0
  3. package/dist/{SlotsContext-DAQiASVu.d.cts → SlotsContext-p_bTEjGT.d.cts} +8 -0
  4. package/dist/ai-elements.cjs +2 -2
  5. package/dist/ai-elements.cjs.map +1 -1
  6. package/dist/ai-elements.js +2 -2
  7. package/dist/ai-elements.js.map +1 -1
  8. package/dist/{chunk-CPWM6NNE.cjs → chunk-7MHR4BSJ.cjs} +21 -21
  9. package/dist/{chunk-CPWM6NNE.cjs.map → chunk-7MHR4BSJ.cjs.map} +1 -1
  10. package/dist/{chunk-BKIYPLMT.js → chunk-7TMQBROA.js} +4 -4
  11. package/dist/{chunk-BKIYPLMT.js.map → chunk-7TMQBROA.js.map} +1 -1
  12. package/dist/{chunk-JEK2V5I3.cjs → chunk-AQTN4QLR.cjs} +6 -6
  13. package/dist/{chunk-JEK2V5I3.cjs.map → chunk-AQTN4QLR.cjs.map} +1 -1
  14. package/dist/{chunk-JAEXKKSE.js → chunk-G63CLUHC.js} +21 -2
  15. package/dist/chunk-G63CLUHC.js.map +1 -0
  16. package/dist/{chunk-UXVOUC2A.cjs → chunk-JJRLHXHZ.cjs} +21 -2
  17. package/dist/chunk-JJRLHXHZ.cjs.map +1 -0
  18. package/dist/{chunk-CW6LCVNC.js → chunk-ZPOCKCBF.js} +3 -3
  19. package/dist/{chunk-CW6LCVNC.js.map → chunk-ZPOCKCBF.js.map} +1 -1
  20. package/dist/components.cjs +15 -15
  21. package/dist/components.js +4 -4
  22. package/dist/hooks.cjs +4 -4
  23. package/dist/hooks.d.cts +1 -1
  24. package/dist/hooks.d.ts +1 -1
  25. package/dist/hooks.js +1 -1
  26. package/dist/index.cjs +22 -22
  27. package/dist/index.d.cts +1 -1
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +5 -5
  30. package/dist/llms-full.txt +2 -2
  31. package/dist/tools.cjs +5 -5
  32. package/dist/tools.js +2 -2
  33. package/package.json +5 -5
  34. package/dist/chunk-JAEXKKSE.js.map +0 -1
  35. package/dist/chunk-UXVOUC2A.cjs.map +0 -1
package/context7.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "url": "https://context7.com/llmstxt/cdn_jsdelivr_net_npm_aigentyc_chat-sdk_0_5_0_llms_txt",
2
+ "url": "https://context7.com/llmstxt/cdn_jsdelivr_net_npm_aigentyc_chat-sdk_0_6_0_llms_txt",
3
3
  "public_key": "pk_dHiyF4hGXkgbb1jdrT7TU"
4
4
  }
@@ -85,6 +85,14 @@ interface ChatContextValue {
85
85
  * {@link ChatContextValue.newConversation}.
86
86
  */
87
87
  retryLastTurn: () => void;
88
+ /**
89
+ * Replace a sent user message with new text and answer it again.
90
+ *
91
+ * Everything after that message is dropped, as in ChatGPT's edit: the
92
+ * conversation continues from the corrected question, not alongside the old
93
+ * one. A turn still streaming is stopped first.
94
+ */
95
+ editMessage: (messageId: string, content: string) => void;
88
96
  newConversation: () => void;
89
97
  clearMessages: () => void;
90
98
  callbacks?: ChatEventCallbacks;
@@ -85,6 +85,14 @@ interface ChatContextValue {
85
85
  * {@link ChatContextValue.newConversation}.
86
86
  */
87
87
  retryLastTurn: () => void;
88
+ /**
89
+ * Replace a sent user message with new text and answer it again.
90
+ *
91
+ * Everything after that message is dropped, as in ChatGPT's edit: the
92
+ * conversation continues from the corrected question, not alongside the old
93
+ * one. A turn still streaming is stopped first.
94
+ */
95
+ editMessage: (messageId: string, content: string) => void;
88
96
  newConversation: () => void;
89
97
  clearMessages: () => void;
90
98
  callbacks?: ChatEventCallbacks;
@@ -1424,7 +1424,7 @@ var ContextReasoningUsage = ({
1424
1424
  ...props
1425
1425
  }) => {
1426
1426
  const { usage, modelId } = useContextValue();
1427
- const reasoningTokens = usage?.reasoningTokens ?? 0;
1427
+ const reasoningTokens = usage?.outputTokenDetails?.reasoningTokens ?? 0;
1428
1428
  if (children) {
1429
1429
  return children;
1430
1430
  }
@@ -1457,7 +1457,7 @@ var ContextCacheUsage = ({
1457
1457
  ...props
1458
1458
  }) => {
1459
1459
  const { usage, modelId } = useContextValue();
1460
- const cacheTokens = usage?.cachedInputTokens ?? 0;
1460
+ const cacheTokens = usage?.inputTokenDetails?.cacheReadTokens ?? 0;
1461
1461
  if (children) {
1462
1462
  return children;
1463
1463
  }