Skip to content

Instantly share code, notes, and snippets.

@mediacutlet
Last active April 20, 2025 15:27
Show Gist options
  • Save mediacutlet/70c408a0a35fadefd8e304457972f97e to your computer and use it in GitHub Desktop.
Save mediacutlet/70c408a0a35fadefd8e304457972f97e to your computer and use it in GitHub Desktop.
Home Assistant - Voice Assistant LLM Flash Briefing Replacement Script (v0.5)
sequence:
- choose:
- conditions:
- condition: template
value_template: >-
{{ news_categories_and_sources == 'International News and Global
Events' }}
sequence:
- action: conversation.process
metadata: {}
data:
text: >-
You are a research assistant collecting today's top
*international* news stories and global events. Search the web
for the latest headlines **only from reputable sources such as
CNN, BBC, Reuters, or Associated Press**. Do not include
U.S.-only stories unless they have significant international
relevance. Provide 5 headlines and concise summaries (max 265
characters each). Do not fabricate or summarize beyond what is
verifiable. If you cannot access these sources, say so. Format
each item as: 1. [Headline] | [Summary] (Source: [Name])
agent_id: conversation.chatgpt
response_variable: top_news_response
- conditions:
- condition: template
value_template: >-
{{ news_categories_and_sources == 'United States Politics Top
Stories' }}
sequence:
- action: conversation.process
metadata: {}
data:
text: >-
You are a research assistant collecting today's top *U.S.
political* news stories. Search the web for verified headlines
**from sources like CNN, BBC, Reuters, or Associated Press**.
Focus only on political topics: elections, policy, legislation,
Supreme Court, and government activity. No summaries beyond
verifiable content. List 5 items with concise summaries (max 265
characters). If no political headlines are found from these
sources, state that. Format as: 1. [Headline] | [Summary]
(Source: [Name])
agent_id: conversation.chatgpt
response_variable: top_news_response
- conditions:
- condition: template
value_template: >-
{{ news_categories_and_sources == 'United States Top News
Excluding Politics' }}
sequence:
- action: conversation.process
metadata: {}
data:
text: >-
You are a research assistant collecting today's top
*non-political* U.S. news stories. Search the web for major
headlines from CNN, BBC, Reuters, or Associated Press. Exclude
anything about politics, elections, or legislation. Focus
instead on events, business, tech, health, or society. Provide 5
entries with summaries (max 265 characters). Do not fabricate.
Format as: 1. [Headline] | [Summary] (Source: [Name])
agent_id: conversation.chatgpt
response_variable: top_news_response
- conditions:
- condition: template
value_template: "{{ news_categories_and_sources == 'Weather Related Headlines' }}"
sequence:
- action: conversation.process
metadata: {}
data:
text: >-
You are a research assistant gathering today's top
*weather-related* headlines. Search the web for stories from
CNN, BBC, Reuters, or Associated Press. Focus on weather events,
forecasts, natural disasters, and climate-related stories. List
up to 5 entries, each with a concise summary (max 265
characters). Do not summarize or add info beyond the source.
Format as: 1. [Headline] | [Summary] (Source: [Name])
agent_id: conversation.chatgpt
response_variable: top_news_response
- conditions:
- condition: template
value_template: "{{ news_categories_and_sources == 'NASA and Science Headlines' }}"
sequence:
- action: conversation.process
metadata: {}
data:
text: >-
You are a research assistant collecting today's top headlines
related to *NASA, astronomy, space exploration, and scientific
breakthroughs*. Use only CNN, BBC, Reuters, or Associated Press.
Avoid speculative stories or fringe science. Provide up to 5
headlines and short summaries (max 265 characters). Do not make
anything up. Format as: 1. [Headline] | [Summary] (Source:
[Name])
agent_id: conversation.chatgpt
response_variable: top_news_response
- conditions:
- condition: template
value_template: >-
{{ news_categories_and_sources == 'Media and Entertainment
Headlines' }}
sequence:
- action: conversation.process
metadata: {}
data:
text: >-
You are a research assistant collecting today's top *media,
film, TV, and entertainment* news stories. Use only CNN, BBC,
Reuters, or Associated Press. Avoid celebrity gossip unless it’s
covered by one of those sources. Provide up to 5 headlines and
concise summaries (max 265 characters). No fictional content.
Format as: 1. [Headline] | [Summary] (Source: [Name])
agent_id: conversation.chatgpt
response_variable: top_news_response
- conditions:
- condition: template
value_template: "{{ news_categories_and_sources == 'Unlisted Topic (Other)' }}"
sequence:
- action: conversation.process
metadata: {}
data:
text: >-
A user has requested a flash briefing on the topic: "{{
other_topic_name }}". Search the web for current, relevant
headlines from reputable sources such as CNN, BBC, Reuters, or
Associated Press. Return up to 5 headlines with short summaries
(≤265 characters). Only use information found in the results. Do
not fabricate, speculate, or pull unrelated content. If no
verifiable stories are found, say so clearly. Format each item
as: 1. [Headline] | [Summary] (Source: [Name])
agent_id: conversation.chatgpt
response_variable: top_news_response
- variables:
response:
international_news: >
This tool retrieves raw news data that you will use to generate a
flash briefing. When the user requests a flash briefing, use this
tool to fetch recent headlines and short summaries from reputable
sources such as CNN, BBC, Reuters, or AP. The user may specify a
category, or you may infer the best option based on their request. The
tool will return up to 5 headlines relevant to the topic, each paired
with a short summary and source attribution. Your job is to transform
this data into a clear, engaging, and factually accurate
narrative-style briefing. Do not include any URLs, source names, or
citations in the final output. Do not return the stories in a
numbered or bulleted list. Instead, generate a conversational,
paragraph-style summary—like an intelligent and informed family member
briefly reviewing today’s top news. Use only the information found in
the provided results. Do not invent facts, speculate, editorialize,
or pull in unrelated content. If the headlines are sparse or
unavailable, say so honestly. Prioritize clarity, coherence, and
truthfulness in your delivery. When possible, incorporate clear
temporal references—such as “today,” “on Wednesday,” “earlier this
month,” or “last year”— to help anchor events in time. Only include
such references if they are explicitly mentioned or can be reliably
inferred from the source summaries. Here is the news:
{{top_news_response}}
- stop: ""
response_variable: response
fields:
news_categories_and_sources:
selector:
select:
options:
- International News and Global Events
- United States Politics Top Stories
- United States Top News Excluding Politics
- Weather Related Headlines
- NASA and Science Headlines
- Media and Entertainment Headlines
- Unlisted Topic (Other)
name: News Categories and Sources
description: >-
Choose a news source and area of interest from the options below. Doing so
will return the top five news stories and brief summaries from the
category and/or source.
default: Weather Related Headlines
required: true
other_topic_name:
selector:
text: null
name: Other Topic Name
description: >-
Since an undefined (other) topic was requested for the flash briefing,
populate this field with the topic, new category, or search intent
phrasing from the user’s original request. This value will be used to
guide the downstream news search.
default: top news in the United States
alias: "Flash Briefing - Get Latest Top News Headlines "
description: >-
This tool retrieves raw news data that you will use to generate a flash
briefing. When the user requests a flash briefing, use this tool to fetch
recent headlines and short summaries from reputable news sources (CNN, BBC,
Reuters, AP). The user may specify a news category; you may choose an option
which applies best to the user's query. This tool (script) will return up to 5
headlines relevant to that topic, each paired with a short summary and source
attribution. Your job is to transform that data into a clear, engaging, and
factually accurate narrative-style briefing. Do not include any URLs or
sources in the final output. Only include information found in the results. Do
not invent details, speculate, or pull in unrelated information. If the
results are sparse or missing, explain that honestly. Do not invent stories or
headlines; prioritize truthfulness. Do not return the results in a list
format, instead deliver a conversational paragraph which spans across the
topics, as if an intelligent and informed family member was reviewing the top
news stories of the day. When possible, incorporate clear temporal
references—such as “today,” “on Wednesday,” “earlier this month,” or “last
year”— to help anchor events in time. Only include such references if they are
explicitly mentioned or can be reliably inferred from the source summaries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment