How to Define JSON Structure Output for Your AI Assistant
Welcome to the guide on configuring JSON structure output for your AI Assistant! This feature allows you to customize how your assistant delivers structured responses, ensuring the output always meets your specific needs.
π Why Define a JSON Structure?β
By defining a JSON structure, you can organize the AI Assistant's responses into a clear and consistent format. This is useful for:
- Generating structured data for APIs, reports, or content creation.
- Automating workflows that need specific data formats.
- Extracting information from unstructured data, like documents or research papers.
Example:
If you're building a blog content generator, your AI Assistant can provide results like:
{
"blog_type": "informational",
"blog_titles": ["Top 10 Marketing Trends", "How to Boost Sales"],
"blog_headings": ["Introduction", "Trend Analysis", "Conclusion"],
"keywords": [
{"name": "digital marketing", "description": "Focus on marketing strategies"},
{"name": "SEO", "description": "Include SEO tips"}
]
}
π€ Auto-Configure Parameters with AIβ
Setting up your AI Assistant's JSON response structure has never been easier! With the Auto-Configure Parameters feature, you can let the AI handle the setup for you. Simply describe how you want the AI Assistant to respond, or provide a JSON example, and the system will automatically generate the necessary parameters.
Why Use Auto-Configure?β
Manually defining parameters one by one can be time-consuming, especially if you need a complex structure. With this feature, you can:
- Quickly generate a structured response format by just describing it.
- Easily convert a JSON example into a complete parameter setup.
- Save time and avoid manual configuration errors.
How to Use Auto-Configureβ
Step 1: Open the Auto-Configure Toolβ
- In the JSON Structure Response section, look for the β¨ Auto-Configure Button next to the β Add Parameter button.
- Click the β¨ Auto-Configure Button to open the configuration modal.
Step 2: Describe Your Desired Output or Provide a JSON Exampleβ
- In the modal, you'll see an input box
- You can describe the response format in natural language or paste a JSON example.
Examples:
- "The AI Assistant must always return me a list of blog titles, blog headings, and keywords to focus on in my blog post."
- "It must return the product URL, product name, price, and description."
- "It has to respond with a JSON based on this example:
{"fruit": "Apple", "size": "Large", "color": "Red"}
*
- Click the "Configure Output Format" button to proceed.
Step 3: Review and Edit the Generated Parametersβ
- After the AI finishes, your parameter list will be overwritten with the newly generated structure.
β οΈ Important: If you already had parameters defined, they will be replaced.
- Tip: Review the changes carefully before saving.
- If you save the AI Assistant with these new parameters, your previous setup will be lost.
- Review the auto-generated parameters and make any necessary edits.
- You can reorder, modify, or delete fields as needed.
- Add or adjust nested parameters for more complex structures.
- Once satisfied, save the updated configuration.
Example Walkthroughβ
User Input:β
"I need the AI to provide the product name, price, availability, and product details (like size and color)."
AI-Generated Parameters:β
{
"product_name": "Wireless Headphones",
"price": 59.99,
"availability": true,
"product_details": {
"size": "Medium",
"color": "Black"
}
}
How the AI Configured It:β
- product_name β Text
- Instructions to AI (may differ): "Provide the product name."
- price β Decimal
- Instructions to AI (may differ): "Provide the product price."
- availability β Boolean
- Instructions to AI (may differ): "Is the product available?"
- product_details β Object
- Nested Parameters:
- size β Text ("Provide the product size."(may differ))
- color β Text ("Provide the product color."(may differ))
- Nested Parameters:
Important Notesβ
- Overwriting Warning: Once the AI auto-generates the parameters, your existing configuration will be overwritten. β οΈ Be cautious! If you save without reviewing, your previous setup will be lost.
- Manual Edits Recommended: After auto-configuration, always review and adjust the generated parameters to make sure they fit your exact needs.
- No Coding Required: Just describe what you needβthe AI takes care of the rest!
π Step-by-Step Guide to Configuring JSON Output Manuallyβ
1. Add a New Parameterβ
- Click the β button to add a new parameter.
- Set the Parameter Name (e.g.,
blog_type
). - Choose the Parameter Type (e.g., Text, Number, Object).
- In the Advanced tab you will find options like:
- Is Optional - if checked the parameter may be skipped
- Default Value - if defined and the parameter is skipped, it will be populated with this value
- Enum Options - available for
Text
,Number
andDecimal
types, enables your AI Assistant to pick one value from these options
π Tip: Use simple, clear names in lowercase with underscores (e.g., product_name
).
2. Select the Parameter Typeβ
Hereβs a breakdown of the available parameter types:
Parameter Type | Description | Example |
---|---|---|
Text | Plain text | "blog_type": "informational" |
Number | Whole numbers | "quantity": 10 |
Decimal | Numbers with decimals | "price": 19.99 |
Boolean | Yes/No, True/False values | "is_active": true |
Object | A group of nested parameters | "author": {"name": "Alex"} |
Dictionary | Flexible key-value pairs | "details": {"color": "red"} |
List Of Texts | A list of text items | "tags": ["AI", "Tech"] |
List Of Numbers | A list of numbers | "ratings": [5, 4, 3] |
List Of Objects | A list of structured objects | SeeNested Parametersbelow |
3. Guide the AI Assistantβ
- Instructions to AI Assistant: Explain how the AI should complete this parameter. Example: "Choose between informational, educational, or transactional."
- Default Value: Set a value that the AI will use if no input is provided.
- Is Optional?:
- If checked, the AI may provide a value or skip it.
- If a default value is set and the AI skips it, the default will be used.
- If unchecked (required), the AI will always provide a value.
- Autofill by AI Assistant:
- If checked, the AI can automatically fill this parameter.
- If unchecked, the parameter will not be filled by the AI, and the default value will always be used.
4. Use Enum Options for Fixed Choicesβ
If you want the AI to choose from specific values, you can define Enum Options.
π§ Example Setup:
- Parameter Name:
blog_type
- Type: Text
- Enum Options:
- Informational
- Educational
- Transactional
Now, the AI will only choose from these options.
5. Configure Nested Parameters for Objects & Listsβ
For Object or List Of Objects types, you can define nested parameters.
π Example: Adding Keywords with Descriptions
- Parameter Name:
keywords
- Type: Object
- Nested Parameters:
- name (Text): The keyword.
- description (Text): Why this keyword is important.
AI Response:
"keywords": [
{"name": "AI tools", "description": "Focus on AI automation"},
{"name": "workflow", "description": "Discuss optimizing workflows"}
]
π― Real-Life Example: Extracting Research Paper Details in JSON Formatβ
In this guide, you'll learn how to configure your AI Assistant to search for research papers online, scrape key information, and return the data in a structured JSON format.
To achieve this, we'll connect the AI Assistant to the Web Browser and Web Scraper tools, enabling it to search for research papers and extract the necessary information.
Target JSON Structureβ
Hereβs the final JSON output we want the AI Assistant to generate:
{
"title": "Application of Quantum Algorithms in Interstellar Navigation: A New Frontier",
"authors": [
"Dr. Stella Voyager",
"Dr. Nova Star",
"Dr. Lyra Hunter"
],
"abstract": "This paper investigates the utilization of quantum algorithms to improve interstellar navigation systems. By leveraging quantum superposition and entanglement, our proposed navigation system can calculate optimal travel paths through space-time anomalies more efficiently than classical methods. Experimental simulations suggest a significant reduction in travel time and fuel consumption for interstellar missions.",
"keywords": [
"Quantum algorithms",
"interstellar navigation",
"space-time anomalies",
"quantum superposition",
"quantum entanglement",
"space travel"
],
"publication_info": {
"journal_name": "Astrophysics and Quantum Mechanics Journal",
"year": 2024,
"doi": "10.1234/aqmj.2024.56789"
}
}
Step-by-Step Guide to Configure This JSON Outputβ
Step 1: Add the Root Parametersβ
We'll start by defining the main fields in the JSON structure.
- Title
- Parameter Name:
title
- Type: Text
- Instructions to AI Assistant: "Extract the title of the research paper."
- Parameter Name:
- Authors
- Parameter Name:
authors
- Type: List of Texts
- Instructions to AI Assistant: "List all authors of the research paper."
- Parameter Name:
- Abstract
- Parameter Name:
abstract
- Type: Text
- Instructions to AI Assistant: "Extract the abstract section of the research paper."
- Parameter Name:
- Keywords
- Parameter Name:
keywords
- Type: List of Texts
- Instructions to AI Assistant: "Extract relevant keywords from the research paper."
- Parameter Name:
Step 2: Configure the Nested Object β publication_info
β
Now, let's configure the nested object to include publication details like the journal name, publication year, and DOI.
- Parameter Name:
publication_info
- Type: Object
- Instructions to AI Assistant: "Provide publication details for the research paper."
- Nested Parameters:
- journal_name
- Type: Text
- Instructions to AI Assistant: "Extract the name of the journal where the paper was published."
- year
- Type: Number
- Instructions to AI Assistant: "Extract the publication year of the research paper."
- doi
- Type: Text
- Instructions to AI Assistant: "Extract the DOI (Digital Object Identifier) of the research paper."
- journal_name
Step 3: Enable the Web Browser and Web Scraper Toolsβ
To allow the AI Assistant to search for and extract research paper data, you need to connect the Web Browser and Web Scraper tools.
-
Open the AI Assistant Tools tab.
-
Add Tools:
- Configure Web Browser to let the AI search for research papers online.
- Configure Web Scraper to allow the AI to extract structured data from research paper websites.
π How It Works:
- The Web Browser will search for relevant research papers.
- The Web Scraper will extract the required information and structure it according to your JSON setup.
Step 4: Final Check & Saveβ
- Review all parameters to ensure they are correctly configured.
- Use the up/down arrows to organize the parameter order. β οΈ Note: Once saved, the order of existing parameters cannot be changed.
- Save the AI Assistant.
Detailed Parameter Configuration Summaryβ
Parameter Name | Type | Instructions to AI Assistant |
---|---|---|
title | Text | Extract the title of the research paper. |
authors | List of Texts | List all authors of the research paper. |
abstract | Text | Extract the abstract section of the research paper. |
keywords | List of Texts | Extract relevant keywords from the research paper. |
publication_info | Object | Provide publication details for the research paper. |
βββjournal_name | Text | Extract the journal name. |
βββyear | Number | Extract the publication year. |
βββdoi | Text | Extract the DOI (Digital Object Identifier). |
Final AI Response Exampleβ
Once everything is set up, the AI Assistant will generate structured responses like this:
{
"title": "Application of Quantum Algorithms in Interstellar Navigation: A New Frontier",
"authors": [
"Dr. Stella Voyager",
"Dr. Nova Star",
"Dr. Lyra Hunter"
],
"abstract": "This paper investigates the utilization of quantum algorithms to improve interstellar navigation systems. By leveraging quantum superposition and entanglement, our proposed navigation system can calculate optimal travel paths through space-time anomalies more efficiently than classical methods. Experimental simulations suggest a significant reduction in travel time and fuel consumption for interstellar missions.",
"keywords": [
"Quantum algorithms",
"interstellar navigation",
"space-time anomalies",
"quantum superposition",
"quantum entanglement",
"space travel"
],
"publication_info": {
"journal_name": "Astrophysics and Quantum Mechanics Journal",
"year": 2024,
"doi": "10.1234/aqmj.2024.56789"
}
}
π§ Common Questions Answeredβ
β Do I need coding skills to use this feature? π No! It's all done through a user-friendly interface with dropdowns and text fields.
β What happens if I donβt configure a parameter? π
- If the parameter is optional, the AI may provide a value or skip it.
- If a default value is set and the AI skips it, the default will be used.
- If the parameter is required, the AI will always provide a value.
β Can I change the order of the parameters? π Yes! Use the up/down arrows next to each parameter to reorder them before saving. β οΈ Once saved, the order cannot be changed for existing parametersβonly for newly added ones.
π Key Takeawaysβ
- Customizable: Define exactly how your AI Assistant structures its responses.
- User-Friendly: Set up parameters without any coding.
- Consistent Output: Get reliable, structured data every time.
Ready to create your structured AI responses? Start defining your JSON output now!
π‘ Need help? If you have any questions, reach out to our support team. We're here to assist you!