OpenAI Ask

A provider-specific guide to the OpenAI Ask action for accessing GPT models.

The OpenAI Ask Action provides direct access to OpenAI's powerful language models, including the GPT-3.5 and GPT-4 families. Use this action when you want to leverage the specific capabilities and performance of OpenAI's technology for your text generation, summarization, or analysis tasks.

This guide covers specifics for the OpenAI action. For a general overview of how to work with Large Language Models, including prompting techniques, temperature, and other settings, please see our main **[LLM Action Guide](./llm.md)**.

Connection Setup

You will need an OpenAI account and your API key.

  1. Sign up for an account on the OpenAI Platform.

  2. Find your API key in your account settings under API Keys.

  3. In AgenticFlow, navigate to Settings > Connections and add a new OpenAI Connection, providing your API key.

Configuration

Input Parameters

Parameter
Type
Description

Connection

Connection

Select the OpenAI connection you created.

Model

Select

Choose the specific OpenAI model you want to use (e.g., gpt-4-turbo, gpt-3.5-turbo).

System Prompt

Text

Instructions for the AI's persona or role (e.g., "You are a helpful assistant.").

User Prompt

Text

The main instruction or question for the AI model.

Temperature

Number

Controls randomness. See the main LLM guide for details.

Max Tokens

Number

The maximum length of the generated response.

JSON Mode

Boolean

If true, instructs the model to only output valid JSON. See the main LLM guide.

Output Parameters

Parameter
Type
Description

Output

Text

The text generated by the OpenAI model.

Example: Using a Specific GPT Model

This action is used in the same way as the general LLM Action, but it allows you to guarantee that you are using a specific model from OpenAI's lineup.

  • To create a marketing email:

    • Model: gpt-4-turbo (for highest quality)

    • System Prompt: You are a world-class copywriter specializing in email marketing.

    • User Prompt: Write a short, punchy email announcing our new product: the "Quantum Coffee Mug".

  • To extract structured data quickly:

    • Model: gpt-3.5-turbo (for speed and lower cost)

    • User Prompt: Extract the name and email from this text: {{some_input_text}}

    • JSON Mode: true

Last updated

Was this helpful?