Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ai-sdk/svelte

Package Overview
Dependencies
Maintainers
0
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/svelte - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

6

CHANGELOG.md
# @ai-sdk/svelte
## 0.0.9
### Patch Changes
- 827ef450: feat (ai/ui): improve error handling in useAssistant
## 0.0.8

@@ -4,0 +10,0 @@

17

dist/index.js

@@ -416,3 +416,3 @@ "use strict";

async function append(message, requestOptions) {
var _a, _b, _c, _d;
var _a, _b, _c, _d, _e;
status.set("in_progress");

@@ -426,3 +426,3 @@ abortController = new AbortController();

try {
const result = await fetch(api, {
const response = await fetch(api, {
method: "POST",

@@ -441,7 +441,12 @@ credentials,

});
if (result.body == null) {
if (!response.ok) {
throw new Error(
(_c = await response.text()) != null ? _c : "Failed to fetch the assistant response."
);
}
if (response.body == null) {
throw new Error("The response body is empty.");
}
for await (const { type, value } of (0, import_ui_utils3.readDataStream)(
result.body.getReader()
response.body.getReader()
)) {

@@ -475,3 +480,3 @@ switch (type) {

{
id: (_c = value.id) != null ? _c : (0, import_ui_utils3.generateId)(),
id: (_d = value.id) != null ? _d : (0, import_ui_utils3.generateId)(),
role: "data",

@@ -503,3 +508,3 @@ content: "",

} catch (err) {
if ((0, import_provider_utils.isAbortError)(error) && ((_d = abortController == null ? void 0 : abortController.signal) == null ? void 0 : _d.aborted)) {
if ((0, import_provider_utils.isAbortError)(error) && ((_e = abortController == null ? void 0 : abortController.signal) == null ? void 0 : _e.aborted)) {
abortController = null;

@@ -506,0 +511,0 @@ return;

{
"name": "@ai-sdk/svelte",
"version": "0.0.8",
"version": "0.0.9",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "sideEffects": false,

@@ -115,3 +115,3 @@ import { isAbortError } from '@ai-sdk/provider-utils';

try {
const result = await fetch(api, {
const response = await fetch(api, {
method: 'POST',

@@ -132,3 +132,9 @@ credentials,

if (result.body == null) {
if (!response.ok) {
throw new Error(
(await response.text()) ?? 'Failed to fetch the assistant response.',
);
}
if (response.body == null) {
throw new Error('The response body is empty.');

@@ -139,3 +145,3 @@ }

for await (const { type, value } of readDataStream(
result.body.getReader(),
response.body.getReader(),
)) {

@@ -142,0 +148,0 @@ switch (type) {

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc