#Good to hear, thank you ^^!

1 messages · Page 1 of 1 (latest)

robust hare
#

gotcha - in that case the gCal API isn't going to be useful at all.

#

@lofty dagger , so you're kinda looking for something like this, right?

lofty dagger
#

@robust hare Yeah, pretty much exactly that 🤩 There are some other - optional - criteria that need to be supported, but once I get the hang of the general case they should hopefully be possible to add. Is there a page or something somewhere, where I can read about it?

robust hare
#

well tbh there isn't much more than those screenshots. There isn't a prebuilt model in vertex or anything for this task, so I wrote a few of my own examples and included them in directly in the prompt (you can see it here in AI Studio

#
import google.generativeai as genai

genai.configure(api_key="YOUR_API_KEY")

# Set up the model
generation_config = {
  "temperature": 0.9,
  "top_p": 1,
  "top_k": 1,
  "max_output_tokens": 2048,
}

model = genai.GenerativeModel(model_name="gemini-1.0-pro", generation_config=generation_config)

prompt_examples = [
  "input: weeklong trip to mexico for 8 people",
  "destination: Mexico",
  "travelers: 8 people",
  "duration: 1 week",

  "input: My wife and I want to go to Vegas for a weekend",
  "destination: Las Vegas, Nevada",
  "travelers: 2 adults",
  "duration: 2 or 3 days",

  "input: NYC solo vacation for 5 days",
  "destination: New York City, New York",
  "travelers: 1 adult",
  "duration: 5 days",

  "input: Disneyworld trip for family of 5",
  "destination: Disney World, Orlando, Florida",
  "travelers: 2 adults, 3 children",
  "duration: (not specified, but typically 1 to 2 weeks)",

  "input: Safari with my parents",
  "destination: Kenya",
  "travelers: 3 adults",
  "duration: (not specified, but typically 7 to 10 days)",

  "input: Wimbledon finals for a group of 6",
  "destination: London, England",
  "travelers: 6 people",
  "duration: (not specified, but likely 2 to 5 days)",

  "input: Overnight trip to see a broadway play for 7",
  "destination: New York City, New York",
  "travelers: 7 people",
  "duration: 1 day",

  "input: Roadtrip to the largest Lake in the US for 3 people",
  "destination: Lake Superior (shared by Minnesota, Wisconsin, and Michigan)",
  "travelers: 3 people",
  "duration: (not specified, but likely 1 to 4 days)",

  "input: 2 people going to Superbowl 2025",
  "destination: New Orleans, Louisiana",
  "travelers: 2 people",
  "duration: Likely 3-4 days (including travel)",

  "input: 5 person trip to LA from Monday to Thursday",
  "destination: ",
]

response = model.generate_content(prompt_parts)
print(response.text)```
#

If you have a hundred or so examples of the actual user input that you can annotate with the "correct" outputs, you can take this a step further by custom-tuning a model

lofty dagger
#

Wow. Thanks so much for you've written this far! I understand what you're writing in broad terms, I haven't fully grasped the workflow in the Google tools though. Am I getting it right in that your examples above had no model data(I hope I'm using the right terms here), "just" google.generativeai? But how do you tell it to output those specific things? (Destination, Travelers, Duration) Is it by creating those entities? columns? in the examples? And then genai follows that pattern when creating "real" output?

#

I do believe that tuning a model would make a difference. But since this is in the proof of concept stage... Getting the results you got just from 5-10 examples? That would be fantastic. But this is also about learning what tools there are. I've kind of been jumping around between this(Gemini?), Google Natural language, Vertex AI.. So many things to discover..,

robust hare
#

Sounds like you are understanding it correctly.

  • Running that python block is exactly the same thing as clicking the "Run" button on this screenshot.
  • it uses the stock, unmodified gemini-1.0-pro model
  • I came up with nine examples of what I wanted the model to do, and manually wrote them out in in full.
#

The prompt that is sent to the stock gemini model consists of those nine examples plus the partial stub at the end for the input I want to evaluate

#

But how do you tell it to output those specific things? (Destination, Travelers, Duration) Is it by creating those entities? columns? in the examples? And then genai follows that pattern when creating "real" output?
yup, you're exactly correct. The model is simply following the pattern I provided it.

#

Basically think of generative AI as autocomplete on steroids. The implementation of the structured prompts isn't actually the important part. For example, I can just give the same examples in a big old text blob and get the same results