INNER CODE UNIT · JavaScript

message

nirholas/XActions · packages/xactions-edge/index.js:253

      const message = result.content?.map((part) => part.text).filter(Boolean).join('\n') || `${name} failed`;
      const payment = parsePaymentRequired(message);
      if (payment) throw new PaymentRequiredError(name, payment);
      throw new XActionsError(message, { tool: name, retryable: RATE_LIMIT_HINT.test(message) });
    }
    return result?.structuredContent ?? result?.content?.map((part) => part.text).join('\n') ?? null;
  }

  /** @returns {Promise<Array<object>>} */
  async listPrompts(options) {
    await this.initialize();
    return (await this.request('prompts/list', {}, options)).prompts;
  }

  /**
   * @param {string} name
   * @param {Record<string,string>} [args]
   * @returns {Promise<{description: string, messages: Array<object>}>}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…