Goals Module
Goals in the cApp Framework
Example Goal: Finding a Flight for a User
{
"name": "Find Flight",
"description": "Find a flight for the user based on their specified preferences and constraints.",
"parameters": {
"origin": {
"type": "string",
"description": "The departure city or airport.",
"example": "San Francisco (SFO)"
},
"destination": {
"type": "string",
"description": "The arrival city or airport.",
"example": "New York City (JFK)"
},
"departure_date": {
"type": "string",
"description": "The date of departure in YYYY-MM-DD format.",
"example": "2025-02-15"
},
"return_date": {
"type": "string",
"description": "The return date for round-trip flights in YYYY-MM-DD format.",
"example": "2025-02-20"
},
"class": {
"type": "string",
"description": "The preferred class of travel.",
"example": "Economy"
},
"budget": {
"type": "number",
"description": "The maximum budget for the flight in USD.",
"example": 500
},
"non_stop": {
"type": "boolean",
"description": "Whether the user prefers non-stop flights only.",
"example": true
}
},
"output": {
"type": "FlightDetails",
"description": "Details of the recommended flight(s), including airline, flight times, and pricing."
},
"constraints": [
"Departure and return dates must be valid future dates.",
"Budget cannot be less than $50."
],
"example_usage": {
"input": {
"origin": "San Francisco (SFO)",
"destination": "New York City (JFK)",
"departure_date": "2025-02-15",
"return_date": "2025-02-20",
"class": "Economy",
"budget": 400,
"non_stop": true
},
"output": {
"airline": "Delta Airlines",
"flight_number": "DL1234",
"departure_time": "2025-02-15T08:30:00",
"arrival_time": "2025-02-15T16:00:00",
"price": 350,
"class": "Economy",
"non_stop": true
}
}
}Last updated