airtrain 0.1.9__py3-none-any.whl → 0.1.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airtrain/__init__.py +1 -1
- airtrain/contrib/__init__.py +29 -0
- airtrain/contrib/travel/__init__.py +29 -0
- airtrain/contrib/travel/agents.py +243 -0
- airtrain/contrib/travel/models.py +59 -0
- airtrain/integrations/google/credentials.py +2 -1
- {airtrain-0.1.9.dist-info → airtrain-0.1.11.dist-info}/METADATA +3 -1
- {airtrain-0.1.9.dist-info → airtrain-0.1.11.dist-info}/RECORD +10 -6
- {airtrain-0.1.9.dist-info → airtrain-0.1.11.dist-info}/WHEEL +0 -0
- {airtrain-0.1.9.dist-info → airtrain-0.1.11.dist-info}/top_level.txt +0 -0
airtrain/__init__.py
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
"""Airtrain contrib package for community contributions"""
|
2
|
+
|
3
|
+
from .travel.agents import (
|
4
|
+
TravelAgentBase,
|
5
|
+
ClothingAgent,
|
6
|
+
HikingAgent,
|
7
|
+
InternetConnectivityAgent,
|
8
|
+
FoodRecommendationAgent,
|
9
|
+
PersonalizedRecommendationAgent,
|
10
|
+
)
|
11
|
+
from .travel.models import (
|
12
|
+
ClothingRecommendation,
|
13
|
+
HikingOption,
|
14
|
+
InternetAvailability,
|
15
|
+
FoodOption,
|
16
|
+
)
|
17
|
+
|
18
|
+
__all__ = [
|
19
|
+
"TravelAgentBase",
|
20
|
+
"ClothingAgent",
|
21
|
+
"HikingAgent",
|
22
|
+
"InternetConnectivityAgent",
|
23
|
+
"FoodRecommendationAgent",
|
24
|
+
"PersonalizedRecommendationAgent",
|
25
|
+
"ClothingRecommendation",
|
26
|
+
"HikingOption",
|
27
|
+
"InternetAvailability",
|
28
|
+
"FoodOption",
|
29
|
+
]
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"""Travel related agents and models"""
|
2
|
+
|
3
|
+
from .agents import (
|
4
|
+
TravelAgentBase,
|
5
|
+
ClothingAgent,
|
6
|
+
HikingAgent,
|
7
|
+
InternetConnectivityAgent,
|
8
|
+
FoodRecommendationAgent,
|
9
|
+
PersonalizedRecommendationAgent,
|
10
|
+
)
|
11
|
+
from .models import (
|
12
|
+
ClothingRecommendation,
|
13
|
+
HikingOption,
|
14
|
+
InternetAvailability,
|
15
|
+
FoodOption,
|
16
|
+
)
|
17
|
+
|
18
|
+
__all__ = [
|
19
|
+
"TravelAgentBase",
|
20
|
+
"ClothingAgent",
|
21
|
+
"HikingAgent",
|
22
|
+
"InternetConnectivityAgent",
|
23
|
+
"FoodRecommendationAgent",
|
24
|
+
"PersonalizedRecommendationAgent",
|
25
|
+
"ClothingRecommendation",
|
26
|
+
"HikingOption",
|
27
|
+
"InternetAvailability",
|
28
|
+
"FoodOption",
|
29
|
+
]
|
@@ -0,0 +1,243 @@
|
|
1
|
+
from typing import Optional, List, Any
|
2
|
+
from airtrain.core.skills import Skill, ProcessingError
|
3
|
+
from airtrain.integrations.openai.skills import OpenAIParserSkill, OpenAIParserInput
|
4
|
+
from .models import (
|
5
|
+
ClothingRecommendation,
|
6
|
+
HikingOption,
|
7
|
+
InternetAvailability,
|
8
|
+
FoodOption,
|
9
|
+
PersonalizedRecommendation,
|
10
|
+
)
|
11
|
+
|
12
|
+
|
13
|
+
class TravelAgentBase(OpenAIParserSkill):
|
14
|
+
def __init__(self, credentials=None):
|
15
|
+
super().__init__(credentials)
|
16
|
+
self.model = "gpt-4o"
|
17
|
+
self.temperature = 0.0
|
18
|
+
|
19
|
+
|
20
|
+
class ClothingAgent(TravelAgentBase):
|
21
|
+
"""Agent for clothing recommendations"""
|
22
|
+
|
23
|
+
def get_recommendations(
|
24
|
+
self, location: str, duration: int, activities: List[str], season: str
|
25
|
+
) -> ClothingRecommendation:
|
26
|
+
prompt = f"""
|
27
|
+
Provide clothing recommendations for a {duration}-day trip to {location} during {season}.
|
28
|
+
Activities planned: {', '.join(activities)}.
|
29
|
+
Include essential items, weather-specific clothing, and cultural considerations.
|
30
|
+
"""
|
31
|
+
|
32
|
+
input_data = OpenAIParserInput(
|
33
|
+
user_input=prompt,
|
34
|
+
system_prompt="You are a travel clothing expert. Provide detailed packing recommendations.",
|
35
|
+
response_model=ClothingRecommendation,
|
36
|
+
model=self.model,
|
37
|
+
temperature=self.temperature,
|
38
|
+
)
|
39
|
+
|
40
|
+
result = self.process(input_data)
|
41
|
+
return result.parsed_response
|
42
|
+
|
43
|
+
|
44
|
+
class HikingAgent(TravelAgentBase):
|
45
|
+
"""Agent for hiking recommendations"""
|
46
|
+
|
47
|
+
def get_hiking_options(
|
48
|
+
self, location: str, difficulty: str, duration_preference: float
|
49
|
+
) -> List[HikingOption]:
|
50
|
+
prompt = f"""
|
51
|
+
Find hiking trails in {location} that match:
|
52
|
+
- Difficulty level: {difficulty}
|
53
|
+
- Preferred duration: around {duration_preference} hours
|
54
|
+
Provide detailed trail information and safety tips.
|
55
|
+
"""
|
56
|
+
|
57
|
+
input_data = OpenAIParserInput(
|
58
|
+
user_input=prompt,
|
59
|
+
system_prompt="You are a hiking expert. Recommend suitable trails with safety considerations.",
|
60
|
+
response_model=List[HikingOption],
|
61
|
+
model=self.model,
|
62
|
+
)
|
63
|
+
|
64
|
+
result = self.process(input_data)
|
65
|
+
return result.parsed_response
|
66
|
+
|
67
|
+
|
68
|
+
class InternetAgent(TravelAgentBase):
|
69
|
+
"""Agent for internet availability information"""
|
70
|
+
|
71
|
+
def get_connectivity_info(
|
72
|
+
self,
|
73
|
+
location: str,
|
74
|
+
duration: int,
|
75
|
+
work_requirements: Optional[List[str]] = None,
|
76
|
+
) -> InternetAvailability:
|
77
|
+
prompt = f"""
|
78
|
+
Provide detailed internet connectivity information for {location} for a {duration}-day stay.
|
79
|
+
{f'Work requirements: {", ".join(work_requirements)}' if work_requirements else ''}
|
80
|
+
Include public WiFi spots, recommended providers, and connectivity tips.
|
81
|
+
"""
|
82
|
+
|
83
|
+
input_data = OpenAIParserInput(
|
84
|
+
user_input=prompt,
|
85
|
+
system_prompt="You are a connectivity expert. Provide detailed internet availability information.",
|
86
|
+
response_model=InternetAvailability,
|
87
|
+
model=self.model,
|
88
|
+
temperature=self.temperature,
|
89
|
+
)
|
90
|
+
|
91
|
+
result = self.process(input_data)
|
92
|
+
return result.parsed_response
|
93
|
+
|
94
|
+
|
95
|
+
class FoodAgent(TravelAgentBase):
|
96
|
+
"""Agent for food recommendations"""
|
97
|
+
|
98
|
+
def get_food_recommendations(
|
99
|
+
self,
|
100
|
+
location: str,
|
101
|
+
dietary_restrictions: Optional[List[str]] = None,
|
102
|
+
preferences: Optional[List[str]] = None,
|
103
|
+
budget_level: str = "medium",
|
104
|
+
) -> FoodOption:
|
105
|
+
prompt = f"""
|
106
|
+
Provide food recommendations for {location}.
|
107
|
+
{f'Dietary restrictions: {", ".join(dietary_restrictions)}' if dietary_restrictions else ''}
|
108
|
+
{f'Food preferences: {", ".join(preferences)}' if preferences else ''}
|
109
|
+
Budget level: {budget_level}
|
110
|
+
Include local specialties, restaurant recommendations, and food safety tips.
|
111
|
+
"""
|
112
|
+
|
113
|
+
input_data = OpenAIParserInput(
|
114
|
+
user_input=prompt,
|
115
|
+
system_prompt="You are a culinary expert. Provide detailed food recommendations.",
|
116
|
+
response_model=FoodOption,
|
117
|
+
model=self.model,
|
118
|
+
temperature=self.temperature,
|
119
|
+
)
|
120
|
+
|
121
|
+
result = self.process(input_data)
|
122
|
+
return result.parsed_response
|
123
|
+
|
124
|
+
|
125
|
+
class PersonalizedAgent(TravelAgentBase):
|
126
|
+
"""Agent for personalized travel recommendations"""
|
127
|
+
|
128
|
+
def get_personalized_recommendations(
|
129
|
+
self,
|
130
|
+
location: str,
|
131
|
+
duration: int,
|
132
|
+
interests: List[str],
|
133
|
+
budget_level: str,
|
134
|
+
travel_style: str,
|
135
|
+
previous_destinations: Optional[List[str]] = None,
|
136
|
+
) -> PersonalizedRecommendation:
|
137
|
+
prompt = f"""
|
138
|
+
Create personalized travel recommendations for {location} for {duration} days.
|
139
|
+
Interests: {', '.join(interests)}
|
140
|
+
Travel style: {travel_style}
|
141
|
+
Budget level: {budget_level}
|
142
|
+
{f'Previous destinations: {", ".join(previous_destinations)}' if previous_destinations else ''}
|
143
|
+
Include hidden gems, local events, and a custom itinerary.
|
144
|
+
"""
|
145
|
+
|
146
|
+
input_data = OpenAIParserInput(
|
147
|
+
user_input=prompt,
|
148
|
+
system_prompt="You are a personal travel consultant. Provide tailored recommendations.",
|
149
|
+
response_model=PersonalizedRecommendation,
|
150
|
+
model=self.model,
|
151
|
+
temperature=self.temperature,
|
152
|
+
)
|
153
|
+
|
154
|
+
result = self.process(input_data)
|
155
|
+
return result.parsed_response
|
156
|
+
|
157
|
+
|
158
|
+
# Similar pattern for other agents...
|
159
|
+
|
160
|
+
if __name__ == "__main__":
|
161
|
+
# Initialize all agents
|
162
|
+
clothing_agent = ClothingAgent()
|
163
|
+
hiking_agent = HikingAgent()
|
164
|
+
internet_agent = InternetAgent()
|
165
|
+
food_agent = FoodAgent()
|
166
|
+
personalized_agent = PersonalizedAgent()
|
167
|
+
|
168
|
+
# Example location and common parameters
|
169
|
+
location = "Kyoto, Japan"
|
170
|
+
duration = 7
|
171
|
+
season = "spring"
|
172
|
+
|
173
|
+
try:
|
174
|
+
# Get clothing recommendations
|
175
|
+
clothing_result = clothing_agent.get_recommendations(
|
176
|
+
location=location,
|
177
|
+
duration=duration,
|
178
|
+
activities=["hiking", "temple visits", "city walking", "photography"],
|
179
|
+
season=season,
|
180
|
+
)
|
181
|
+
print("\n=== Clothing Recommendations ===")
|
182
|
+
print(f"Essential items: {', '.join(clothing_result.essential_items)}")
|
183
|
+
print(f"Weather specific: {', '.join(clothing_result.weather_specific)}")
|
184
|
+
print(
|
185
|
+
f"Cultural considerations: {', '.join(clothing_result.cultural_considerations)}"
|
186
|
+
)
|
187
|
+
|
188
|
+
# Get hiking options
|
189
|
+
hiking_result = hiking_agent.get_hiking_options(
|
190
|
+
location=location, difficulty="moderate", duration_preference=4.0
|
191
|
+
)
|
192
|
+
print("\n=== Hiking Options ===")
|
193
|
+
for trail in hiking_result:
|
194
|
+
print(f"\nTrail: {trail.trail_name}")
|
195
|
+
print(f"Difficulty: {trail.difficulty}")
|
196
|
+
print(f"Duration: {trail.duration_hours} hours")
|
197
|
+
print(f"Distance: {trail.distance_km} km")
|
198
|
+
|
199
|
+
# Get internet availability
|
200
|
+
internet_result = internet_agent.get_connectivity_info(
|
201
|
+
location=location,
|
202
|
+
duration=duration,
|
203
|
+
work_requirements=["video calls", "cloud storage access"],
|
204
|
+
)
|
205
|
+
print("\n=== Internet Availability ===")
|
206
|
+
print(f"General availability: {internet_result.general_availability}")
|
207
|
+
print(f"Average speed: {internet_result.average_speed_mbps} Mbps")
|
208
|
+
print(
|
209
|
+
f"Recommended providers: {', '.join(internet_result.recommended_providers)}"
|
210
|
+
)
|
211
|
+
|
212
|
+
# Get food recommendations
|
213
|
+
food_result = food_agent.get_food_recommendations(
|
214
|
+
location=location,
|
215
|
+
dietary_restrictions=["vegetarian"],
|
216
|
+
preferences=["traditional", "local specialties"],
|
217
|
+
budget_level="medium",
|
218
|
+
)
|
219
|
+
print("\n=== Food Recommendations ===")
|
220
|
+
print("Local specialties:", ", ".join(food_result.local_specialties))
|
221
|
+
print("Must-try dishes:", ", ".join(food_result.must_try_dishes))
|
222
|
+
for restaurant in food_result.recommended_restaurants[:3]: # Show top 3
|
223
|
+
print(f"Restaurant: {restaurant['name']} - {restaurant['type']}")
|
224
|
+
|
225
|
+
# Get personalized recommendations
|
226
|
+
personal_result = personalized_agent.get_personalized_recommendations(
|
227
|
+
location=location,
|
228
|
+
duration=duration,
|
229
|
+
interests=["photography", "culture", "nature", "food"],
|
230
|
+
budget_level="medium",
|
231
|
+
travel_style="balanced",
|
232
|
+
previous_destinations=["Tokyo", "Seoul"],
|
233
|
+
)
|
234
|
+
print("\n=== Personalized Recommendations ===")
|
235
|
+
print("Hidden gems:", ", ".join(personal_result.hidden_gems))
|
236
|
+
print("\nCustom Itinerary:")
|
237
|
+
for day in personal_result.custom_itinerary:
|
238
|
+
print(f"Day {day['day']}: {day['activities']}")
|
239
|
+
|
240
|
+
except ProcessingError as e:
|
241
|
+
print(f"Error processing travel recommendations: {str(e)}")
|
242
|
+
except Exception as e:
|
243
|
+
print(f"Unexpected error: {str(e)}")
|
@@ -0,0 +1,59 @@
|
|
1
|
+
from typing import List, Optional, Dict, Any
|
2
|
+
from pydantic import BaseModel, Field, validator
|
3
|
+
|
4
|
+
|
5
|
+
class ClothingRecommendation(BaseModel):
|
6
|
+
"""Model for clothing recommendations"""
|
7
|
+
|
8
|
+
essential_items: List[str]
|
9
|
+
weather_specific: List[str]
|
10
|
+
activity_specific: List[str]
|
11
|
+
cultural_considerations: List[str]
|
12
|
+
packing_tips: List[str]
|
13
|
+
|
14
|
+
|
15
|
+
class HikingOption(BaseModel):
|
16
|
+
"""Model for hiking recommendations"""
|
17
|
+
|
18
|
+
trail_name: str
|
19
|
+
difficulty: str
|
20
|
+
duration_hours: float
|
21
|
+
distance_km: float
|
22
|
+
elevation_gain_m: float
|
23
|
+
best_season: List[str]
|
24
|
+
required_gear: List[str]
|
25
|
+
safety_tips: List[str]
|
26
|
+
highlights: List[str]
|
27
|
+
|
28
|
+
|
29
|
+
class InternetAvailability(BaseModel):
|
30
|
+
"""Model for internet availability information"""
|
31
|
+
|
32
|
+
general_availability: str
|
33
|
+
average_speed_mbps: float
|
34
|
+
public_wifi_spots: List[str]
|
35
|
+
recommended_providers: List[str]
|
36
|
+
connectivity_tips: List[str]
|
37
|
+
offline_alternatives: List[str]
|
38
|
+
|
39
|
+
|
40
|
+
class FoodOption(BaseModel):
|
41
|
+
"""Model for food recommendations"""
|
42
|
+
|
43
|
+
local_specialties: List[str]
|
44
|
+
recommended_restaurants: List[Dict[str, str]]
|
45
|
+
dietary_considerations: List[str]
|
46
|
+
food_safety_tips: List[str]
|
47
|
+
price_ranges: Dict[str, str]
|
48
|
+
must_try_dishes: List[str]
|
49
|
+
|
50
|
+
|
51
|
+
class PersonalizedRecommendation(BaseModel):
|
52
|
+
"""Model for personalized recommendations"""
|
53
|
+
|
54
|
+
activities: List[Dict[str, str]]
|
55
|
+
hidden_gems: List[str]
|
56
|
+
local_events: List[Dict[str, str]]
|
57
|
+
custom_itinerary: List[Dict[str, Any]]
|
58
|
+
safety_tips: List[str]
|
59
|
+
budget_recommendations: Dict[str, str]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: airtrain
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.11
|
4
4
|
Summary: A platform for building and deploying AI agents with structured skills
|
5
5
|
Home-page: https://github.com/rosaboyle/airtrain.dev
|
6
6
|
Author: Dheeraj Pai
|
@@ -24,6 +24,8 @@ Requires-Dist: loguru>=0.7.3
|
|
24
24
|
Requires-Dist: requests>=2.32.3
|
25
25
|
Requires-Dist: boto3>=1.36.6
|
26
26
|
Requires-Dist: together>=1.3.13
|
27
|
+
Requires-Dist: anthropic>=0.45.0
|
28
|
+
Requires-Dist: groq>=0.15.0
|
27
29
|
Dynamic: author
|
28
30
|
Dynamic: author-email
|
29
31
|
Dynamic: classifier
|
@@ -1,4 +1,8 @@
|
|
1
|
-
airtrain/__init__.py,sha256=
|
1
|
+
airtrain/__init__.py,sha256=9Iz01w_MQoT9YAt5RVbxwQHBt_TR-kr1KI-DdxaYfk8,313
|
2
|
+
airtrain/contrib/__init__.py,sha256=pG-7mJ0pBMqp3Q86mIF9bo1PqoBOVSGlnEK1yY1U1ok,641
|
3
|
+
airtrain/contrib/travel/__init__.py,sha256=2xWgnyQdHOvfSHcrjeb66Md8P7Jl4DTKOvC6osubQQE,607
|
4
|
+
airtrain/contrib/travel/agents.py,sha256=tpQtZ0WUiXBuhvZtc2JlEam5TuR5l-Tndi14YyImDBM,8975
|
5
|
+
airtrain/contrib/travel/models.py,sha256=E4Mtds5TINmXLXu65aTYqv6wwOh2KclJHZ2eXRrBqiY,1547
|
2
6
|
airtrain/core/__init__.py,sha256=9h7iKwTzZocCPc9bU6j8bA02BokteWIOcO1uaqGMcrk,254
|
3
7
|
airtrain/core/credentials.py,sha256=PgQotrQc46J5djidKnkK1znUv3fyNkUFDO-m2Kn_Gzo,4006
|
4
8
|
airtrain/core/schemas.py,sha256=MMXrDviC4gRea_QaPpbjgO--B_UKxnD7YrxqZOLJZZU,7003
|
@@ -14,7 +18,7 @@ airtrain/integrations/cerebras/__init__.py,sha256=zAD-qV38OzHhMCz1z-NvjjqcYEhURb
|
|
14
18
|
airtrain/integrations/cerebras/credentials.py,sha256=IFkn8LxMAaOpvEWXDpb94VQGtqcDxQ7rZHKH-tX4Nuw,884
|
15
19
|
airtrain/integrations/cerebras/skills.py,sha256=O9vwFzvv_tUOwFOVE8CszAQEac711eVYVUj_8dVMTpc,1596
|
16
20
|
airtrain/integrations/google/__init__.py,sha256=INZFNOcNebz3m-Ggk07ZjmX0kNHIbTe_St9gBlZBki8,176
|
17
|
-
airtrain/integrations/google/credentials.py,sha256=
|
21
|
+
airtrain/integrations/google/credentials.py,sha256=Mm4jNWF02rIf0_GuHLcUUPyLHC4NMRdF_iTCoVTQ0Bs,1033
|
18
22
|
airtrain/integrations/google/skills.py,sha256=uwmgetl5Ien7fLOA5HIZdqoL6AZnexFDyzfsrGuJ1RU,1606
|
19
23
|
airtrain/integrations/groq/__init__.py,sha256=B_X2fXbsJfFD6GquKeVCsEJjwd9Ygbq1uEHlV4Jy7YE,154
|
20
24
|
airtrain/integrations/groq/credentials.py,sha256=A8-VIyoZTkHFQb-O-lmu-UrgaLZ3hfWfzzigkYteESk,829
|
@@ -32,7 +36,7 @@ airtrain/integrations/sambanova/skills.py,sha256=Po1ur_QFwzVIugbkk2mt73WdXDz_Gr9
|
|
32
36
|
airtrain/integrations/together/__init__.py,sha256=we4KXn_pUs6Dxo3QcB-t40BSRraQFdKg2nXw7yi2FjM,185
|
33
37
|
airtrain/integrations/together/credentials.py,sha256=y5M6ZQrfYJLJbClxEasq4HaVyZM0l5lFshwVP6jq2E4,720
|
34
38
|
airtrain/integrations/together/skills.py,sha256=YMOULyk2TX32rCjhxK29e4ehn8iIzMXpg3xmdYtuyQQ,1664
|
35
|
-
airtrain-0.1.
|
36
|
-
airtrain-0.1.
|
37
|
-
airtrain-0.1.
|
38
|
-
airtrain-0.1.
|
39
|
+
airtrain-0.1.11.dist-info/METADATA,sha256=8qZMiOyqKPZWWYPGuSgXyeAfOzHXuuHGODdnUERYwKA,4536
|
40
|
+
airtrain-0.1.11.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
41
|
+
airtrain-0.1.11.dist-info/top_level.txt,sha256=cFWW1vY6VMCb3AGVdz6jBDpZ65xxBRSqlsPyySxTkxY,9
|
42
|
+
airtrain-0.1.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|