> ## Documentation Index
> Fetch the complete documentation index at: https://docs.odella.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Questions Block

> Leverage AI to generate multiple questions based on a given prompt and value

## Overview

The Generate Questions Block uses AI capabilities to create a specified number of questions based on an input prompt and value. This block is particularly useful for expanding research activities, breaking down complex topics into manageable parts, or creating comprehensive question sets for various purposes.

<Frame>
  <img src="https://mintcdn.com/odella/I7v1Fbrp2kx7rLoj/block-reference/assets/generate_questions_light.png?fit=max&auto=format&n=I7v1Fbrp2kx7rLoj&q=85&s=9e6330773a11ccfc26d48f824a591162" alt="Generate Questions Block Screenshot" className="block dark:hidden" width="894" height="506" data-path="block-reference/assets/generate_questions_light.png" />

  <img src="https://mintcdn.com/odella/I7v1Fbrp2kx7rLoj/block-reference/assets/generate_questions_dark.png?fit=max&auto=format&n=I7v1Fbrp2kx7rLoj&q=85&s=51fba0b552f44b35c0a56ed190b08685" alt="Generate Questions Block Screenshot" className="hidden dark:block" width="924" height="518" data-path="block-reference/assets/generate_questions_dark.png" />
</Frame>

## Inputs

<ParamField path="systemPrompt" type="string">
  The system prompt to send to the model. Optional. Used to provide high-level guidance to the AI model.
</ParamField>

<ParamField path="context" type="string | chat-message | chat-message[] | array">
  The context to generate related questions from. Optional. Can be a string, chat message, array of chat messages, or other array types that can be coerced to strings.
</ParamField>

<ParamField path="instruction" type="string">
  Available when using the "Blank" template. The instruction for generating questions.
</ParamField>

<ParamField path="question" type="string">
  Available when using the "Research Questions" template. The question to generate research queries for.
</ParamField>

## Outputs

<ResponseField name="questions" type="string[]">
  An array of generated questions based on the input context and prompts.
</ResponseField>

<ResponseField name="duration" type="number">
  The time in milliseconds that the block took to execute.
</ResponseField>

## Editor Settings

<ParamField path="AI Model" type="string" default="default">
  The AI model to use for generating questions. Available models are dynamically populated based on the LLM provider configuration. Only models supporting function calls are shown.
</ParamField>

<ParamField path="From Template" type="string" default="Research Questions">
  Choose from predefined templates:

  * Blank: A simple template with custom instruction
  * Research Questions: Template for generating Google search queries
</ParamField>

<ParamField path="Number of Questions" type="number" default={3} min={1} max={10}>
  The number of questions to generate. Must be between 1 and 10.
</ParamField>

<ParamField path="Temperature" type="number" default={0.5} min={0} max={1} step={0.1}>
  Controls randomness in the output. Lower values make the output more focused and deterministic.
</ParamField>

<ParamField path="Prompt Text" type="code">
  The prompt template text. Supports interpolation using {"{{"}variable{"}}"} syntax. Uses custom prompt interpolation highlighting.
</ParamField>

## Error Handling

The block will retry failed attempts up to 3 times with exponential backoff:

* Minimum retry delay: 500ms
* Maximum retry delay: 5000ms
* Retry factor: 2.5x
* Includes randomization
* Maximum retry time: 5 minutes

Error messages will be logged for:

* Invalid number of questions (must be 1-10)
* Empty or invalid responses
* API rate limits (will retry)
* API timeouts (will retry)
* Other API errors

<Warning>
  Always review the generated questions for relevance and appropriateness, especially when using them for critical research or decision-making processes.
</Warning>

## FAQ

<AccordionGroup>
  <Accordion title="How diverse are the generated questions?">
    The diversity of questions depends on the input prompt, the provided value, and the AI model's capabilities. You can encourage more diverse questions by adjusting the temperature setting or by providing a more open-ended prompt.
  </Accordion>

  <Accordion title="Can I generate questions in languages other than English?">
    Yes, the Generate Questions block can generate questions in various languages. Simply provide the prompt and value in your desired language, and ensure the chosen AI model supports that language.
  </Accordion>

  <Accordion title="How can I ensure the generated questions are relevant to my specific needs?">
    To improve relevance, provide a clear and specific prompt that outlines the type of questions you're looking for. You can also experiment with different AI models and settings to find the best combination for your use case.
  </Accordion>
</AccordionGroup>

## See Also

* [Ask AI Block](/block-reference/ai/ai)
* [Analyze Table Block](/block-reference/ai/analyze-table)
* [AI Filter Block](/block-reference/ai/ai-filter)
