Ask AI
Skip to main content

LLM Completion Request

Function: LLM Completion Request

This function allows you to send a message (a "prompt") to an advanced Artificial Intelligence (AI) model and receive a generated response. It's perfect for tasks like generating text, summarizing information, answering questions, or even extracting structured data from free-form text.

Input

  • User prompt (Text, Required): This is the main message or question you want to send to the AI. Be clear and specific to get the best results.
  • User prompt placeholders (Key-Value Pairs, Optional): If your "User prompt" contains special tags like \{\{PRODUCT_NAME\}\}, you can define these placeholders here. The system will automatically replace them with the values you provide before sending the prompt to the AI.
  • System prompt (Text, Optional): This sets the initial instructions for how the AI should behave. Think of it as giving the AI a role or specific guidelines (e.g., "You are a helpful assistant," or "Always respond in a friendly tone.").
  • System prompt placeholders (Key-Value Pairs, Optional): Similar to user prompt placeholders, these allow you to dynamically replace parts of your "System prompt" with specific values.
  • Model (Dropdown, Required): Choose the specific AI model you want to use. Different models have varying capabilities, costs, and performance.
  • Files (List of Files, Optional): Attach one or more files if your query relates to their content. Note that not all AI models support processing files.
  • API Token (optional) (Text, Optional): If you have a specific API key for the AI service, you can provide it here. If left blank, the system will attempt to use your company's default AI credits or configuration.
  • Response format (Data Structure, Optional): If you expect the AI's response to follow a specific structure (like a list of items or a customer record), you can select a predefined data structure here. The AI will then try to format its answer as a JSON object matching that structure. If left blank, the AI will provide a plain text response.

Output

  • Result (Variable): This is where the AI's generated response will be stored. You can name this variable anything you like (e.g., AI_Response, SummaryText, ExtractedData). The content will be either plain text or a structured object, depending on whether you specified a "Response format."

Execution Flow

Real-Life Examples

Example 1: Generating a Marketing Slogan

Scenario: You need a catchy slogan for a new eco-friendly cleaning product.

Inputs:

  • User prompt: "Generate 5 short, catchy marketing slogans for a new eco-friendly, plant-based cleaning product that is safe for pets and children."
  • System prompt: "You are a creative marketing expert specializing in sustainable products. Your slogans should be inspiring and highlight safety and environmental benefits."
  • Model: "GPT-4"
  • Result: Slogans

Result: The Slogans variable will contain a text string with five marketing slogans, such as: "Clean with Nature's Touch, Safe for All." "Pure Clean, Pure Peace of Mind." "Eco-Friendly Shine, Family Safe Design." "Plant-Powered Clean, Happy Home Scene." "Gentle on Earth, Tough on Grime."

Example 2: Summarizing a Customer Feedback Document

Scenario: You have a long document containing customer feedback and want a concise summary.

Inputs:

  • User prompt: "Summarize the key themes and common complaints from the attached customer feedback document. Focus on areas for improvement."
  • Files: customer_feedback_report.pdf (assuming "GPT-4" supports file processing)
  • Model: "GPT-4"
  • Result: FeedbackSummary

Result: The FeedbackSummary variable will contain a text summary of the PDF document, highlighting recurring issues like "slow delivery times" and "difficulty navigating the website," and positive feedback on "product quality."

Example 3: Extracting Contact Information from an Email

Scenario: You receive an email from a new lead and want to automatically extract their name, company, and email address into a structured format for your CRM.

Inputs:

  • User prompt: "Extract the contact person's full name, company name, and email address from the following email text: 'Subject: Partnership Inquiry - Hello, my name is John Doe from Acme Corp. I'm interested in discussing a potential collaboration. You can reach me at [email protected]. Best regards, John.'"
  • System prompt: "You are an expert in extracting contact information. Only provide the requested data."
  • Model: "Gemini 1.5 Pro"
  • Response format: A predefined data structure named ContactInfo with fields for FullName (Text), CompanyName (Text), and Email (Email).
  • Result: NewLeadContact

Result: The NewLeadContact variable will contain a structured object (JSON) with the extracted information:

\{
"FullName": "John Doe",
"CompanyName": "Acme Corp.",
"Email": "[email protected]"
\}