RunnableFunction.mjs 871 B

1234567891011121314151617181920212223242526272829
  1. export function isRunnableFunctionWithParse(fn) {
  2. return typeof fn.parse === 'function';
  3. }
  4. /**
  5. * This is helper class for passing a `function` and `parse` where the `function`
  6. * argument type matches the `parse` return type.
  7. *
  8. * @deprecated - please use ParsingToolFunction instead.
  9. */
  10. export class ParsingFunction {
  11. constructor(input) {
  12. this.function = input.function;
  13. this.parse = input.parse;
  14. this.parameters = input.parameters;
  15. this.description = input.description;
  16. this.name = input.name;
  17. }
  18. }
  19. /**
  20. * This is helper class for passing a `function` and `parse` where the `function`
  21. * argument type matches the `parse` return type.
  22. */
  23. export class ParsingToolFunction {
  24. constructor(input) {
  25. this.type = 'function';
  26. this.function = input;
  27. }
  28. }
  29. //# sourceMappingURL=RunnableFunction.mjs.map