Skip to content

Commit

Permalink
Rename "airport code" NYC to LGA (LaGuardia).
Browse files Browse the repository at this point in the history
NYC is not an airport code, and smart models,
notably Qwen, will catch this, and subsitute
JFK to correct the user's mistake. The
the tool schema specifies that the
function takes airport codes.
  • Loading branch information
therealkenc committed Dec 2, 2024
1 parent 6e7e496 commit 4afdeb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/tools/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ function getFlightTimes(args: { [key: string]: any }) {
const arrival = args.arrival;

const flights = {
"NYC-LAX": { departure: "08:00 AM", arrival: "11:30 AM", duration: "5h 30m" },
"LAX-NYC": { departure: "02:00 PM", arrival: "10:30 PM", duration: "5h 30m" },
"LGA-LAX": { departure: "08:00 AM", arrival: "11:30 AM", duration: "5h 30m" },
"LAX-LGA": { departure: "02:00 PM", arrival: "10:30 PM", duration: "5h 30m" },
"LHR-JFK": { departure: "10:00 AM", arrival: "01:00 PM", duration: "8h 00m" },
"JFK-LHR": { departure: "09:00 PM", arrival: "09:00 AM", duration: "7h 00m" },
"CDG-DXB": { departure: "11:00 AM", arrival: "08:00 PM", duration: "6h 00m" },
Expand All @@ -22,7 +22,7 @@ function getFlightTimes(args: { [key: string]: any }) {

async function run(model: string) {
// Initialize conversation with a user query
let messages = [{ role: 'user', content: 'What is the flight time from New York (NYC) to Los Angeles (LAX)?' }];
let messages = [{ role: 'user', content: 'What is the flight time from New York (LGA) to Los Angeles (LAX)?' }];

// First API call: Send the query and function description to the model
const response = await ollama.chat({
Expand Down

0 comments on commit 4afdeb3

Please sign in to comment.