@assistant-ui/react-edge
Advanced tools
Comparing version
@@ -17,2 +17,7 @@ import { ChatModelAdapter, ChatModelRunOptions, ThreadMessage } from "@assistant-ui/react"; | ||
onError?: (error: Error) => void; | ||
/** | ||
* Callback function to be called when the request is cancelled. | ||
* Use this option to notify the server that the user explicitly requested a cancellation. | ||
*/ | ||
onCancel?: () => void; | ||
credentials?: RequestCredentials; | ||
@@ -19,0 +24,0 @@ /** |
@@ -44,2 +44,3 @@ // src/edge/EdgeModelAdapter.ts | ||
const headersValue = typeof this.options.headers === "function" ? await this.options.headers() : this.options.headers; | ||
abortSignal.addEventListener("abort", () => this.options.onCancel); | ||
const headers = new Headers(headersValue); | ||
@@ -46,0 +47,0 @@ headers.set("Content-Type", "application/json"); |
{ | ||
"name": "@assistant-ui/react-edge", | ||
"description": "The legacy edge runtime for assistant-ui", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"license": "MIT", | ||
@@ -58,3 +58,3 @@ "type": "module", | ||
"@assistant-ui/x-buildutils": "0.0.1", | ||
"@assistant-ui/react": "0.10.8" | ||
"@assistant-ui/react": "0.10.9" | ||
}, | ||
@@ -61,0 +61,0 @@ "publishConfig": { |
@@ -52,2 +52,8 @@ import { toCoreMessages } from "../converters/toCoreMessages"; | ||
/** | ||
* Callback function to be called when the request is cancelled. | ||
* Use this option to notify the server that the user explicitly requested a cancellation. | ||
*/ | ||
onCancel?: () => void; | ||
credentials?: RequestCredentials; | ||
@@ -120,2 +126,4 @@ | ||
abortSignal.addEventListener("abort", () => this.options.onCancel); | ||
const headers = new Headers(headersValue); | ||
@@ -122,0 +130,0 @@ headers.set("Content-Type", "application/json"); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
165039
0.56%3043
0.4%