You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return {"facts": "Error: Nutrition service down", "products": ""}
33
30
34
31
@tool
35
32
defget_feeding_guidelines(pet_type):
36
33
"""Get feeding guidelines based on pet type"""
37
34
data=get_nutrition_data(pet_type)
38
-
39
-
ifdata["error"] =="pet_type_not_found":
40
-
returnf"I don't have nutrition information for {pet_type} pets. Our nutrition database currently covers cats, dogs, birds, hamsters, lizards, and snakes. Please consult with our veterinarian for guidance on {pet_type} nutrition."
41
-
elifdata["error"] =="service_unavailable":
42
-
return"Our nutrition service is currently unavailable. Please call our clinic at (555) 123-PETS for nutrition guidance."
43
-
elifdata["error"] =="service_error":
44
-
return"There was an error accessing nutrition information. Please call our clinic at (555) 123-PETS for assistance."
45
-
46
35
result=f"Nutrition info for {pet_type}: {data['facts']}"
47
36
ifdata['products']:
48
37
result+=f" Recommended products available at our clinic: {data['products']}"
"""Get dietary recommendations for specific health conditions by animal type"""
54
43
data=get_nutrition_data(pet_type)
55
-
56
-
ifdata["error"] =="pet_type_not_found":
57
-
returnf"I don't have dietary restriction information for {pet_type} pets. Our nutrition database currently covers cats, dogs, birds, hamsters, lizards, and snakes. Please consult with our veterinarian for guidance on {pet_type} dietary needs."
58
-
elifdata["error"] =="service_unavailable":
59
-
return"Our nutrition service is currently unavailable. Please call our clinic at (555) 123-PETS for dietary guidance."
60
-
elifdata["error"] =="service_error":
61
-
return"There was an error accessing dietary information. Please call our clinic at (555) 123-PETS for assistance."
62
-
63
44
result=f"Dietary info for {pet_type}: {data['facts']}. Consult veterinarian for condition-specific advice."
64
45
ifdata['products']:
65
46
result+=f" Recommended products available at our clinic: {data['products']}"
"""Get supplement recommendations by animal type"""
71
52
data=get_nutrition_data(pet_type)
72
-
73
-
ifdata["error"] =="pet_type_not_found":
74
-
returnf"I don't have supplement information for {pet_type} pets. Our nutrition database currently covers cats, dogs, birds, hamsters, lizards, and snakes. Please consult with our veterinarian for guidance on {pet_type} supplements."
75
-
elifdata["error"] =="service_unavailable":
76
-
return"Our nutrition service is currently unavailable. Please call our clinic at (555) 123-PETS for supplement guidance."
77
-
elifdata["error"] =="service_error":
78
-
return"There was an error accessing supplement information. Please call our clinic at (555) 123-PETS for assistance."
79
-
80
53
result=f"Supplement info for {pet_type}: {data['facts']}. Consult veterinarian for supplements."
81
54
ifdata['products']:
82
55
result+=f" Recommended products available at our clinic: {data['products']}"
"""Create an order for a recommended product. Requires product_name, pet_type, and optional quantity (default 1)."""
61
+
product_lower=product_name.lower()
88
62
data=get_nutrition_data(pet_type)
89
-
90
-
ifdata["error"] =="pet_type_not_found":
91
-
returnf"I cannot create an order for {pet_type} products as we don't have nutrition information for this pet type. Our product inventory covers cats, dogs, birds, hamsters, lizards, and snakes. Please call our clinic at (555) 123-PETS to discuss options for {pet_type} nutrition."
92
-
elifdata["error"] =="service_unavailable":
93
-
return"Our nutrition service is currently unavailable. Please call our clinic at (555) 123-PETS to place your order."
94
-
elifdata["error"] =="service_error":
95
-
return"There was an error accessing our product inventory. Please call our clinic at (555) 123-PETS to place your order."
returnf"Order {order_id} created for {quantity}x {product_name}. Total: ${quantity*29.99:.2f}. Expected delivery: 3-5 business days. You can pick it up at our clinic or we'll ship it to you."
@@ -110,14 +76,8 @@ def create_nutrition_agent():
110
76
system_prompt= (
111
77
"You are a specialized pet nutrition expert at our veterinary clinic, providing accurate, evidence-based dietary guidance for pets. "
112
78
"Never mention using any API, tools, or external services - present all advice as your own expert knowledge.\n\n"
113
-
"CRITICAL: NEVER fabricate or invent product names, nutrition facts, or recommendations when you don't have information for a specific pet type. "
114
-
"If you don't have nutrition information for a pet type, clearly state this limitation and refer to our veterinarian.\n\n"
115
79
"When providing nutrition guidance:\n"
116
-
"- ONLY provide specific product recommendations when you have verified product information for that pet type\n"
117
-
"- If nutrition information is unavailable for a pet type, clearly state: 'I don't have nutrition information for [pet type] pets'\n"
118
-
"- List the pet types you DO have information for: cats, dogs, birds, hamsters, lizards, and snakes\n"
119
-
"- For unsupported pet types, always recommend consulting with our veterinarian\n"
120
-
"- When you DO have information, use the specific nutrition information available to you as the foundation for your recommendations\n"
80
+
"- Use the specific nutrition information available to you as the foundation for your recommendations\n"
121
81
"- Always recommend the SPECIFIC PRODUCT NAMES provided to you that pet owners should buy FROM OUR PET CLINIC\n"
122
82
"- Mention our branded products by name (like PurrfectChoice, BarkBite, FeatherFeast, etc.) when recommending food\n"
123
83
"- Emphasize that we carry high-quality, veterinarian-recommended food brands at our clinic\n"
"- NEVER expose or mention agent ARNs, tools, APIs, or any technical details in your responses to users\n"
86
86
"- NEVER say things like 'I'm using a tool' or 'Let me look that up' - just respond naturally\n"
87
87
"- When consulting the nutrition specialist, ONLY say 'Let me consult our nutrition specialist' - nothing else about the process\n"
88
-
"- If the specialist indicates they don't have information for a specific pet type, relay this information clearly to the customer\n"
89
-
"- Our nutrition database currently covers cats, dogs, birds, hamsters, lizards, and snakes - for other pet types, recommend consulting with our veterinarian\n"
90
-
"- If the specialist returns an error or indicates unavailability, inform the customer that our specialist is currently unavailable and provide the phone number\n"
91
-
"- For nutrition questions, provide 2-3 product recommendations in a brief bulleted list when available, then suggest monitoring and consultation if needed\n"
88
+
"- If the specialist returns an error or indicates unavailability, inform the customer that our specialist is currently unavailable\n"
89
+
"- For nutrition questions, provide 2-3 product recommendations in a brief bulleted list, then suggest monitoring and consultation if needed\n"
92
90
"- Always recommend purchasing products from our pet clinic\n"
93
91
"- For medical concerns, provide general guidance and recommend scheduling a veterinary appointment\n"
94
92
"- For emergencies, immediately provide emergency contact information"
0 commit comments