Skip to content

Commit a91e959

Browse files
authored
Fix backwards incompatible change in ai extension (#1234)
The name of this property changed during the development of the ai extension, and in the latest verison, we dropped support for shadowing the same value across both names, so this is now an error. Also use the same error handling code from the RAG querying code. Closes #1232
1 parent ba7ed6a commit a91e959

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/ai/src/core.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,11 @@ export class RAGClient {
218218
headers: {
219219
"Content-Type": "application/json",
220220
},
221-
body: JSON.stringify({
222-
...request,
223-
input: request.inputs,
224-
}),
221+
body: JSON.stringify(request),
225222
});
226223

227224
if (!response.ok) {
228-
const bodyText = await response.text();
229-
throw new Error(bodyText);
225+
await handleResponseError(response);
230226
}
231227

232228
const data: { data: { embedding: number[] }[] } = await response.json();

0 commit comments

Comments
 (0)