mirror of
https://github.com/open-webui/open-webui
synced 2025-05-19 12:51:35 +00:00
refac: openapi tool server support
This commit is contained in:
parent
359e6f2fd2
commit
5f9679253e
@ -386,9 +386,9 @@ export const executeToolServer = async (
|
|||||||
|
|
||||||
// Handle requestBody composite
|
// Handle requestBody composite
|
||||||
if (operation.requestBody && operation.requestBody.content) {
|
if (operation.requestBody && operation.requestBody.content) {
|
||||||
const contentType = Object.keys(operation.requestBody.content)[0]; // typically "application/json"
|
const contentType = Object.keys(operation.requestBody.content)[0];
|
||||||
if (params.body !== undefined) {
|
if (params !== undefined) {
|
||||||
bodyParams = params.body; // Assume the provided params has a "body" property containing the payload
|
bodyParams = params;
|
||||||
} else {
|
} else {
|
||||||
// Optional: Fallback or explicit error if body is expected but not provided
|
// Optional: Fallback or explicit error if body is expected but not provided
|
||||||
throw new Error(`Request body expected for operation '${name}' but none found.`);
|
throw new Error(`Request body expected for operation '${name}' but none found.`);
|
||||||
|
Loading…
Reference in New Issue
Block a user