Ask AI
Skip to main content

Extract Object from llm response

Function: Extract Object from LLM Response

This action helps you automatically pull out structured information (like customer details, product specifications, or task lists) from a text response generated by an Artificial Intelligence (AI) model. It specifically looks for data organized in a JSON format, which is a common way for systems to exchange structured data. This allows you to easily use AI-generated insights in your applications without manual data entry.

Input

  • LLM Response: (STRING) The complete text message or output you received from an AI model (like a chatbot or a text generator). This is the source where the action will search for the structured data. This input is required.
  • Data-format: (DATA_FORMAT) A predefined structure or template in your application that describes how the extracted information should look. This ensures the data pulled from the AI response fits perfectly into your existing data fields, making it easy to use. This input is required.

Output

  • Result: (OBJECT) The structured information successfully extracted from the AI response. This output will be stored in a variable (by default named RESULT), and its structure will match the Data-format you provided.

Execution Flow

Real-Life Examples

Example 1: Customer Inquiry Processing

Scenario: A customer service chatbot (AI) summarizes a customer's request, including their name, email, and the issue, in a text response. You want to automatically create a new support ticket with this information.

Inputs:

  • LLM Response: "Thank you for contacting us. Customer details: json\n\{\"name\": \"Alice Smith\", \"email\": \"[email protected]\", \"issue\": \"Cannot log in to account\"\}\n. We will get back to you shortly."
  • Data-format: CustomerTicketDetails (a predefined structure with fields like Customer Name (STRING), Customer Email (EMAIL), Issue Description (STRING)).

Result: A new variable, RESULT, containing an object with: Customer Name: "Alice Smith" Customer Email: "[email protected]" Issue Description: "Cannot log in to account" This object can then be used to automatically create a new support ticket in your system.

Example 2: Product Review Analysis

Scenario: An AI model analyzes a product review and extracts key sentiment and features mentioned. You want to store this structured feedback for analysis.

Inputs:

  • LLM Response: "The AI analyzed the review and found: {"sentiment": "positive", "features_liked": ["battery life", "camera"], "features_disliked": []}. Overall a great product."
  • Data-format: ProductFeedback (a predefined structure with fields like Sentiment (STRING), Liked Features (ARRAY of STRING), Disliked Features (ARRAY of STRING)).

Result: A new variable, RESULT, containing an object with: Sentiment: "positive" Liked Features: ["battery life", "camera"] Disliked Features: [] This data can be used to update product feedback dashboards or trigger alerts for specific sentiments.

Example 3: Meeting Summary Task Extraction

Scenario: An AI assistant summarizes a meeting transcript and identifies action items. You want to extract these action items into a structured task list for your project management tool.

Inputs:

  • LLM Response: "Meeting summary: We discussed project Alpha. Action items identified: [{"task": "Schedule follow-up", "assignee": "John", "due_date": "2023-12-01"}, {"task": "Prepare report", "assignee": "Jane", "due_date": "2023-11-28"}]. Next steps will be discussed next week."
  • Data-format: MeetingActionItem (a predefined structure for an ARRAY of OBJECTS, where each object has fields like Task Description (STRING), Assigned To (STRING), Due Date (DATE)).

Result: A new variable, RESULT, containing a list of objects. The first object: Task Description: "Schedule follow-up" Assigned To: "John" Due Date: "2023-12-01" The second object: Task Description: "Prepare report" Assigned To: "Jane" Due Date: "2023-11-28" This list can be used to automatically populate tasks in your project management application.