Skip to content

Text Generation

James edited this page May 10, 2026 · 4 revisions

Text Generation

Text Generation services support Home Assistant Assist, AI Tasks, and direct automation calls through response services.

Common Uses

  • Use the generated Conversation entity with Assist.
  • Use the generated AI Task entity for data generation.
  • Call groq.generate_text from scripts and automations.
  • Call groq.generate_structured when an automation needs JSON that follows a schema.

Basic Service Call

action: groq.generate_text
data:
  prompt: Summarize the current home status for a dashboard notification.
  model: llama-3.1-8b-instant
  temperature: 0.2
response_variable: groq_text

Advanced Request Options

The Text Generation setup flow includes options for:

  • model
  • system prompt
  • temperature
  • maximum completion tokens
  • top-p
  • stop sequences
  • seed
  • service tier
  • streaming Assist responses
  • reasoning effort and reasoning format for supported models
  • prompt caching for supported models
  • structured outputs for supported models
  • additional request body options

Use request_body_options for Groq chat completion fields that are not exposed as dedicated Home Assistant controls.

action: groq.generate_text
data:
  prompt: Create a short goodnight message.
  model: openai/gpt-oss-20b
  request_body_options:
    user: home-assistant
    metadata:
      workflow: bedtime
response_variable: groq_text

Structured Outputs

Use groq.generate_structured when you want the response to follow a JSON Schema.

action: groq.generate_structured
data:
  prompt: Extract the room, device, and requested action from "turn off the kitchen lights".
  model: openai/gpt-oss-20b
  strict: true
  schema_name: home_intent
  schema:
    type: object
    properties:
      room:
        type: string
      device:
        type: string
      action:
        type: string
    required:
      - room
      - device
      - action
    additionalProperties: false
response_variable: groq_structured

Built-In Fallback Models

The setup flow prefers live Groq model discovery. If discovery is unavailable, the integration has built-in fallback model IDs including:

  • llama-3.1-8b-instant
  • llama-3.3-70b-versatile
  • openai/gpt-oss-20b
  • openai/gpt-oss-120b
  • openai/gpt-oss-safeguard-20b
  • qwen/qwen3-32b
  • groq/compound
  • groq/compound-mini

Reasoning and prompt caching options are only offered for models known to support them.

Clone this wiki locally