From b670daf89a6dc939d1ec10554acae0ff484d4713 Mon Sep 17 00:00:00 2001 From: Pamella Bezerra Date: Tue, 1 Oct 2024 22:10:21 -0300 Subject: [PATCH] Rename attributes --- .../js/components/TourGuide/TourGuide.tsx | 33 +++++++++---------- example/tour_guide/ai_assistants.py | 9 ++--- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/example/assets/js/components/TourGuide/TourGuide.tsx b/example/assets/js/components/TourGuide/TourGuide.tsx index a0a7225..ad8fcf8 100644 --- a/example/assets/js/components/TourGuide/TourGuide.tsx +++ b/example/assets/js/components/TourGuide/TourGuide.tsx @@ -12,11 +12,11 @@ import { Title, } from "@mantine/core"; import { notifications } from "@mantine/notifications"; +import { IconLocation, IconMap2 } from "@tabler/icons-react"; interface Attraction { - attraction_name: string; - attraction_description: string; - attraction_url: string; + name: string; + description: string; } export function TourGuide() { @@ -83,7 +83,7 @@ export function TourGuide() { Tour Guide - + setLongitude(e.target.value)} /> - + - + {attractions.map((attraction, index) => ( - - {attraction.attraction_name} + + {attraction.name} - {attraction.attraction_description} + {attraction.description} diff --git a/example/tour_guide/ai_assistants.py b/example/tour_guide/ai_assistants.py index c91dd85..40e4870 100644 --- a/example/tour_guide/ai_assistants.py +++ b/example/tour_guide/ai_assistants.py @@ -9,13 +9,10 @@ class Attraction(BaseModel): - attraction_name: str = Field(description="The name of the attraction in english") - attraction_description: str = Field( + name: str = Field(description="The name of the attraction in english") + description: str = Field( description="The description of the attraction, provide information in an entertaining way" ) - attraction_url: str = Field( - description="The URL of the attraction, keep empty if you don't have this information" - ) class TourGuide(BaseModel): @@ -31,7 +28,7 @@ class TourGuideAIAssistant(AIAssistant): "Only include in your response the items that are relevant to a tourist visiting the area. " "Only call the find_nearby_attractions tool once. " ) - model = "gpt-4o-2024-08-06" + model = "gpt-4o-mini" structured_output = TourGuide def get_instructions(self):