Suggestion: function-calling using limited information for saving tokens

The model is confused because it doesn’t receive the description for properties within a subarray. You’d have to name them something like image_generator_overlay_text, image_generator_size_pixels, image_generator_meme_template_query, assigned to better-named operations.

Your function, transformed into the text the AI receives, is unprecedented chaos (and I even added just some enums and description of enums myself)

(system message)

# Tools

## functions

namespace functions {

// Call function based on user msg. Functions:
// generate_image: make img with DALL-E
// meme: gen meme based on user msg
// images: find img on web
// get_time: get current time in location
// quiet: temp-mute user
// news: get latest news on topic
// scrape: scrape url
// search: search Google (use if you don't know answer to question)
// memory: add info to your memory
// image_recog: analyze img for labels and text
// ai_help: get info for commands/settings
// lyrics: get lyrics for song
// spotify: search spotify, get recommendations, or get info about song/artist/album/playlist
type get_user_inquiry = (_: {
// select function to invoke (added_j)
inquiry?: "generate_image" | "meme" | "images" | "get_time" | "quiet" | "nnews" | "created_truncated_j",
params?: {
  prompt: string,
  size: string,
  image_query: string,
  query: string,
  first: boolean,
  location: string,
  user: string,
  expires: number,
  num: number,
  url: string,
  next: boolean,
  info: string,
  permanent: boolean,
  r: string,
  input_cmds: string,
  input_sets: string,
  song: string,
  line: string,
  kind: string,
  recommendations: boolean,
  get_info: boolean,
}) => any;

} // namespace functions

Also calling them “functions”, within a function, within the function block is definitely formula for confusion. “specify operation perfomed based on…” and replace “inquiry” with “operation_selected”

I would make a one-line description in simulated JSON:
"All operations available: {generate_image: AI-created from description, generate_meme: from popular template plus user text, … }

Many of the abbreviations you came up with save no tokens.

move all those function parameters out of the subarray to where they can be described, and give them names like:

And then, after reaching the pinnacle of optimization, becoming now about the same size as individual functions, I don’t think it’s going to work well.