@openassistantgpt/react
Advanced tools
Comparing version 0.3.1 to 0.3.2
# @assistant | ||
## 0.3.2 | ||
### Patch Changes | ||
- 2fcbfad: Add support for multiple sources and custom text before displaying the sources | ||
## 0.3.1 | ||
@@ -4,0 +10,0 @@ |
@@ -154,4 +154,16 @@ "use strict"; | ||
setMessages((messages2) => { | ||
var _a2, _b; | ||
const lastMessage = messages2[messages2.length - 1]; | ||
lastMessage.annotations = annotation; | ||
if (!lastMessage.annotations) { | ||
lastMessage.annotations = []; | ||
} | ||
if (!((_a2 = lastMessage.annotations) == null ? void 0 : _a2.some( | ||
(a) => ( | ||
// @ts-ignore - because they use JSONValue as a type | ||
a.file_citation.file_id === // @ts-ignore - because they use JSONValue as a type | ||
annotation.file_citation.file_id | ||
) | ||
))) { | ||
(_b = lastMessage.annotations) == null ? void 0 : _b.push(annotation); | ||
} | ||
return [ | ||
@@ -158,0 +170,0 @@ ...messages2.slice(0, messages2.length - 1), |
{ | ||
"name": "@openassistantgpt/react", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -202,3 +202,17 @@ import { isAbortError } from '@ai-sdk/provider-utils'; | ||
// @ts-ignore - because they use JSONValue as a type | ||
lastMessage.annotations = annotation; | ||
if (!lastMessage.annotations) { | ||
lastMessage.annotations = []; | ||
} | ||
if ( | ||
!lastMessage.annotations?.some( | ||
a => | ||
// @ts-ignore - because they use JSONValue as a type | ||
a!.file_citation.file_id === | ||
// @ts-ignore - because they use JSONValue as a type | ||
annotation.file_citation.file_id, | ||
) | ||
) { | ||
lastMessage.annotations?.push(annotation); | ||
} | ||
return [ | ||
@@ -205,0 +219,0 @@ ...messages.slice(0, messages.length - 1), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83051
1057