Ask ChatGPT - Captain icon

Ask ChatGPT - Captain

Node to Ask GPT - Captain

Ask ChatGPT - Captain

AI-generated

Overview

This node sends a user-provided prompt to a GPT-based API endpoint and returns the generated response. It is useful for integrating GPT-powered conversational AI or text generation capabilities into workflows, such as generating text completions, answering questions, or creating content based on user input.

Use Case Examples

  1. A user inputs a prompt asking for a summary of a document, and the node returns the summarized text.
  2. A user provides a question, and the node returns an answer generated by the GPT model.

Properties

Name Meaning
Your Prompt The text prompt or question to send to the GPT API for generating a response.

Output

JSON

  • response - The JSON response from the GPT API containing the generated text or answer based on the user's prompt.

Dependencies

  • Requires an API key stored in the environment variable `UNEXO_API_KEY` for authorization.
  • Requires the base URL of the GPT API stored in the environment variable `CDP_URL`.
  • Makes HTTP POST requests to the endpoint `${CDP_URL}/api/gpt/askGPT` with the user prompt in the request body.

Troubleshooting

  • Common issues include missing or invalid API key (`UNEXO_API_KEY`), resulting in authorization errors.
  • Network or endpoint unavailability may cause request failures; the node retries the request up to 3 times with a 2-second delay between attempts.
  • If the environment variable `CDP_URL` is not set or incorrect, the node will fail to reach the API endpoint.

Discussion