@samchon/openapi
Version:
OpenAPI definitions and converters for 'typia' and 'nestia'.
25 lines (21 loc) • 1.11 kB
JavaScript
import { HttpMigrateRouteFetcher } from "./HttpMigrateRouteFetcher.mjs";
var HttpLlmFunctionFetcher;
(function(HttpLlmFunctionFetcher) {
HttpLlmFunctionFetcher.execute = props => HttpMigrateRouteFetcher.execute(getFetchArguments("execute", props));
HttpLlmFunctionFetcher.propagate = props => HttpMigrateRouteFetcher.propagate(getFetchArguments("propagate", props));
const getFetchArguments = (from, props) => {
const route = props.function.route();
const input = props.input;
const valid = typeof input === "object" && input !== null;
if (valid === false) throw new Error(`Error on HttpLlmFunctionFetcher.${from}(): keyworded arguments must be an object`);
return {
connection: props.connection,
route,
parameters: Object.fromEntries(route.parameters.map((p => [ p.key, input[p.key] ]))),
query: input.query,
body: input.body
};
};
})(HttpLlmFunctionFetcher || (HttpLlmFunctionFetcher = {}));
export { HttpLlmFunctionFetcher };
//# sourceMappingURL=HttpLlmFunctionFetcher.mjs.map