Yo team - read this post, and skip down to the part where it says:
It’s not a bug. You MUST edit your \custom_sentences[languagecode]\slot_types.yaml If your parameter name is not in that list - you cant use it.
here’s mine:
# config/custom_sentences/en/slot_types.yaml
lists:
bank:
wildcard: true
number:
wildcard: true
index_x:
wildcard: true
index_y:
wildcard: true
datetime:
wildcard: true
due_date:
wildcard: true
start_datetime:
wildcard: true
end_datetime:
wildcard: true
due_datetime:
wildcard: true
description:
wildcard: true
lat:
wildcard: true
lon:
wildcard: true
value:
wildcard: true
query:
wildcard: true
status:
wildcard: true
id:
wildcard: true
recipe_id:
wildcard: true
new_name:
wildcard: true
type:
values:
- 'completed'
- 'needs_action'
period:
values:
- "DAY"
- "WEEK"
- "MONTH"
operator:
values:
- "AND"
- "OR"
- "NOT"
- "XOR"
- "CART"
Ive focused on providing generic pipes i can misuse the heck out of everywhere… I put in the entry for ‘type’ to be able to bit flip tasks… (thus the name type, it matches the names on the params for the action for tasks…check it)
lat,lon i have some intents to target - -targets, and get range and distance.
Index_x, Index_y, operator were all put in to support my system index.
I’m fairly certain between this and rest_command you can build a voice UI for just about anything that supports it. I’m currently targeting a fairly feature complete voice implementation of Mealie right now.
This works:
note I’m defaulting EVERYTHING, so it’ll pass blank, 10 items if nothing else. Yes, 25, chicken works. Tell your LLM how to use the tool. Yes, that book in the description is seen by the LLM. So are the remlines in the params table. Tell the LLM what it’s looking at.
query mealie recipe search - pass TWO vars through intent_script to rest_command get:
search_recipes:
description: >
# This is your search tool for Mealie's Recipe System.
# Returns:
# recipe_id: 'recipe.id'
# name: 'recipe.name'
# description: " recipe.description "
# (and other additional detail instructions as available...)
# Top Chef: (Best Practices)
# First, use this search_recipes intent to help find things to cook for your human.
# The return includes recipe_id
# THEN, when you help your human prepare the food provide the correct recipe_id to
# get_recipe_by_id(recipe_id:'76e685c9-8d0d-4d9b-8561-fea912f8105a')
# to get ingredients and detailed cooking instructions.
# Humans like food.
# example: >
# ```json
# {
# 'query': 'Chicken',
# 'number' : '5'
# }
# ```
parameters:
query: # Your search term to look up on Mealie
required: true
number: # the number of search terms to return - default(10) if omitted, Max 50 please
required: false
action:
- action: rest_command.mealie_recipe_search
metadata: {}
data:
search: "{{query | default('')}}"
perPage: "{{number | default(10)}}"
response_variable: response_text
- stop: ""
response_variable: response_text # and return it
speech:
text: >
search:'{{query | default('')}}' number: '{{number| default(10)}}'
response:
{%- if action_response.content['items'] | length > 0 %}
{%- for recipe in action_response.content['items'] %}
recipe_id:'{{ recipe.id }}'
name: '{{ recipe.name }}'
description: "{{ recipe.description }}"
detail_lookup: get_recipe_by_id{'recipe_id': '{{ recipe.id }}'}
{%- endfor %}
{%- else %}
{%- if ( (query | default('')) == '') %}
No search term was provided to query.
usage: search_recipes{'query': 'search term', 'number': 'number of results to return'}
{%- else %}
No recipes found for query:"{{ query }}".
{%- endif %}
{%- endif %}
Note -in your returns, tell the LLM if nothing comes back in a null set - else it tends to make up errors or data that doesnt exist…
query Mealie recipe DB by recipe_id, using mealie.integration, triggered by intent_script:
get_recipe_by_id:
description: >
# This tool pulls detailed preparation instructions for any recipe_id
# in Mealie's Recipe System.
# NOTE: if you do NOT know the correct Mealie [RECIPE_ID] (this is a primary key in thier index...)
# then this intent may not be you're looking for.
# Maybe try
# search_recipes(query:'[search_term]', number:'[number]')
# to find some ideas or get recipe_id's off of today's
# ~MEALIE~
# menu.
# Humans like food.
# example: >
# ```json
# {
# 'recipe_id': '76e685c9-8d0d-4d9b-8561-fea912f8105a'
# }
# ```
parameters:
recipe_id: # Recipe ID to look up on Mealie format like: '76e685c9-8d0d-4d9b-8561-fea912f8105a'
required: true
action:
- action: mealie.get_recipe
metadata: {}
data:
config_entry_id: 01JG8GQB5WT9AMNXA1HPE65W4E
recipe_id: "{{recipe_id}}"
response_variable: response_text # get action response
- stop: ""
response_variable: response_text # and return it
speech:
text: >
recipe:'{{recipe_id}}'
{{action_response}}
Happy intent-ing