ACTIONS
  • Home
  • My Actions
  • My Projects
  • My Packages
OpenAI -> Summarize
Function Documentation: OpenAI -> Summarize (Simple)

Action summary

OpenAI -> Summarize

Xano

Function Documentation: OpenAI -> Summarize (Simple)

OpenAI Vision API;

Overview

This function summarizes a piece of text using the OpenAI API. It requires an input text and returns a summary of that text.

Inputs

  1. openai_api_key (registry | text) Required

    • Description: The API key required to access the OpenAI API for processing the input text.
  2. input_text (text) Required

    • Description: The text that needs to be summarized.
  3. model (enum) Optional

    • Description: Specifies the model to be used for generating the summary.
    • Options:
      • gpt-4o-mini (default)
      • gpt-4o
      • gpt-4o-turbo

Function Stack

1. OpenAI API Request

  1. API Request to https://api.openai.com/v1/chat/completions
    • Purpose: Sends a request to the OpenAI API to summarize the input text.

2. Precondition: API Request Success

  1. Precondition: openai_api.response.status == 200
    • Purpose: Ensures that the API request was successful (HTTP status code 200).

3. OpenAI API Response Content

  1. Create Variable: response
    • Purpose: Stores the summary response content from the OpenAI API, retrieved from the result.

Response

  • The function returns a summary of the provided input text.

Success response

{
   "summary": "A brief and concise explanation of the input text."
}

Error response

{
  "error": {
    "message": "API key is missing or invalid."
  }
}

Example

Input

{
  "openai_api_key": "sk-xxxxxx",
  "input_text": "Artificial Intelligence has transformed many industries...",
  "model": "gpt-4"
}

Output

{
   "summary": "AI has greatly impacted various industries through automation and efficiency."
}

Version notes

2024-10-07 18:26:57
Current
2024-10-07T12:58:16.000+00:00

Function Documentation: OpenAI -> Summarize (Simple)

OpenAI Vision API;

Overview

This function summarizes a piece of text using the OpenAI API. It requires an input text and returns a summary of that text.

Inputs

  1. openai_api_key (registry | text) Required

    • Description: The API key required to access the OpenAI API for processing the input text.
  2. input_text (text) Required

    • Description: The text that needs to be summarized.
  3. model (enum) Optional

    • Description: Specifies the model to be used for generating the summary.
    • Options:
      • gpt-3 (default)
      • gpt-4

Function Stack

1. OpenAI API Request

  1. API Request to https://api.openai.com/v1/chat/completions
    • Purpose: Sends a request to the OpenAI API to summarize the input text.

2. Precondition: API Request Success

  1. Precondition: openai_api.response.status == 200
    • Purpose: Ensures that the API request was successful (HTTP status code 200).

3. OpenAI API Response Content

  1. Create Variable: response
    • Purpose: Stores the summary response content from the OpenAI API, retrieved from the result.

Response

  • The function returns a summary of the provided input text.

Success response

{
   "summary": "A brief and concise explanation of the input text."
}

Error response

{
  "error": {
    "message": "API key is missing or invalid."
  }
}

Example

Input

{
  "openai_api_key": "sk-xxxxxx",
  "input_text": "Artificial Intelligence has transformed many industries...",
  "model": "gpt-4"
}

Output

{
   "summary": "AI has greatly impacted various industries through automation and efficiency."
}