airtrain 0.1.5__py3-none-any.whl → 0.1.6__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-0.1.6.dist-info/METADATA +164 -0
- {airtrain-0.1.5.dist-info → airtrain-0.1.6.dist-info}/RECORD +5 -5
- airtrain-0.1.5.dist-info/METADATA +0 -106
- {airtrain-0.1.5.dist-info → airtrain-0.1.6.dist-info}/WHEEL +0 -0
- {airtrain-0.1.5.dist-info → airtrain-0.1.6.dist-info}/top_level.txt +0 -0
airtrain/__init__.py
CHANGED
@@ -0,0 +1,164 @@
|
|
1
|
+
Metadata-Version: 2.2
|
2
|
+
Name: airtrain
|
3
|
+
Version: 0.1.6
|
4
|
+
Summary: A platform for building and deploying AI agents with structured skills
|
5
|
+
Home-page: https://github.com/rosaboyle/airtrain.dev
|
6
|
+
Author: Dheeraj Pai
|
7
|
+
Author-email: helloworldcmu@gmail.com
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
9
|
+
Classifier: Intended Audience :: Developers
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
11
|
+
Classifier: Operating System :: OS Independent
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
16
|
+
Requires-Python: >=3.8
|
17
|
+
Description-Content-Type: text/markdown
|
18
|
+
Requires-Dist: pydantic>=2.0.0
|
19
|
+
Requires-Dist: openai>=1.0.0
|
20
|
+
Requires-Dist: python-dotenv>=0.19.0
|
21
|
+
Requires-Dist: PyYAML>=5.4.1
|
22
|
+
Requires-Dist: firebase-admin>=5.0.0
|
23
|
+
Requires-Dist: loguru>=0.5.3
|
24
|
+
Dynamic: author
|
25
|
+
Dynamic: author-email
|
26
|
+
Dynamic: classifier
|
27
|
+
Dynamic: description
|
28
|
+
Dynamic: description-content-type
|
29
|
+
Dynamic: home-page
|
30
|
+
Dynamic: requires-dist
|
31
|
+
Dynamic: requires-python
|
32
|
+
Dynamic: summary
|
33
|
+
|
34
|
+
# Airtrain
|
35
|
+
|
36
|
+
A powerful platform for building and deploying AI agents with structured skills and capabilities.
|
37
|
+
|
38
|
+
## Features
|
39
|
+
|
40
|
+
- **Structured Skills**: Build modular AI skills with defined input/output schemas
|
41
|
+
- **Multiple LLM Integrations**: Built-in support for OpenAI and Anthropic models
|
42
|
+
- **Structured Outputs**: Parse LLM responses into structured Pydantic models
|
43
|
+
- **Credential Management**: Secure handling of API keys and credentials
|
44
|
+
- **Type Safety**: Full type hints and Pydantic model support
|
45
|
+
- **Image Support**: Handle image inputs for multimodal models
|
46
|
+
- **Error Handling**: Robust error handling and logging
|
47
|
+
|
48
|
+
## Installation
|
49
|
+
|
50
|
+
```bash
|
51
|
+
pip install airtrain
|
52
|
+
```
|
53
|
+
|
54
|
+
## Quick Start
|
55
|
+
|
56
|
+
### 1. Basic OpenAI Chat
|
57
|
+
|
58
|
+
```python
|
59
|
+
from airtrain.integrations.openai.skills import OpenAIChatSkill, OpenAIInput
|
60
|
+
|
61
|
+
# Initialize the skill
|
62
|
+
skill = OpenAIChatSkill()
|
63
|
+
|
64
|
+
# Create input
|
65
|
+
input_data = OpenAIInput(
|
66
|
+
user_input="Explain quantum computing in simple terms.",
|
67
|
+
system_prompt="You are a helpful teacher.",
|
68
|
+
max_tokens=500,
|
69
|
+
temperature=0.7
|
70
|
+
)
|
71
|
+
|
72
|
+
# Get response
|
73
|
+
result = skill.process(input_data)
|
74
|
+
print(result.response)
|
75
|
+
print(f"Tokens Used: {result.usage['total_tokens']}")
|
76
|
+
```
|
77
|
+
|
78
|
+
### 2. Anthropic Claude Integration
|
79
|
+
|
80
|
+
```python
|
81
|
+
from airtrain.integrations.anthropic.skills import AnthropicChatSkill, AnthropicInput
|
82
|
+
|
83
|
+
# Initialize the skill
|
84
|
+
skill = AnthropicChatSkill()
|
85
|
+
|
86
|
+
# Create input
|
87
|
+
input_data = AnthropicInput(
|
88
|
+
user_input="Explain the theory of relativity.",
|
89
|
+
system_prompt="You are a physics expert.",
|
90
|
+
model="claude-3-opus-20240229",
|
91
|
+
temperature=0.3
|
92
|
+
)
|
93
|
+
|
94
|
+
# Get response
|
95
|
+
result = skill.process(input_data)
|
96
|
+
print(result.response)
|
97
|
+
print(f"Usage: {result.usage}")
|
98
|
+
```
|
99
|
+
|
100
|
+
### 3. Structured Output with OpenAI
|
101
|
+
|
102
|
+
```python
|
103
|
+
from pydantic import BaseModel
|
104
|
+
from typing import List
|
105
|
+
from airtrain.integrations.openai.skills import OpenAIParserSkill, OpenAIParserInput
|
106
|
+
|
107
|
+
# Define your response model
|
108
|
+
class PersonInfo(BaseModel):
|
109
|
+
name: str
|
110
|
+
age: int
|
111
|
+
occupation: str
|
112
|
+
skills: List[str]
|
113
|
+
|
114
|
+
# Initialize the parser skill
|
115
|
+
parser_skill = OpenAIParserSkill()
|
116
|
+
|
117
|
+
# Create input with response model
|
118
|
+
input_data = OpenAIParserInput(
|
119
|
+
user_input="Tell me about John Doe, a 30-year-old software engineer who specializes in Python and AI",
|
120
|
+
system_prompt="Extract structured information about the person.",
|
121
|
+
response_model=PersonInfo
|
122
|
+
)
|
123
|
+
|
124
|
+
# Get structured response
|
125
|
+
result = parser_skill.process(input_data)
|
126
|
+
person_info = result.parsed_response
|
127
|
+
print(f"Name: {person_info.name}")
|
128
|
+
print(f"Skills: {', '.join(person_info.skills)}")
|
129
|
+
```
|
130
|
+
|
131
|
+
## Error Handling
|
132
|
+
|
133
|
+
All skills include built-in error handling:
|
134
|
+
|
135
|
+
```python
|
136
|
+
from airtrain.core.skills import ProcessingError
|
137
|
+
|
138
|
+
try:
|
139
|
+
result = skill.process(input_data)
|
140
|
+
except ProcessingError as e:
|
141
|
+
print(f"Processing failed: {e}")
|
142
|
+
```
|
143
|
+
|
144
|
+
## Advanced Features
|
145
|
+
|
146
|
+
- Image Analysis Support
|
147
|
+
- Function Calling
|
148
|
+
- Custom Validators
|
149
|
+
- Async Processing
|
150
|
+
- Token Usage Tracking
|
151
|
+
|
152
|
+
For more examples and detailed documentation, visit our [documentation](https://airtrain.readthedocs.io/).
|
153
|
+
|
154
|
+
## Documentation
|
155
|
+
|
156
|
+
For detailed documentation, visit [our documentation site](https://docs.airtrain.dev/).
|
157
|
+
|
158
|
+
## Contributing
|
159
|
+
|
160
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
161
|
+
|
162
|
+
## License
|
163
|
+
|
164
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
@@ -1,10 +1,10 @@
|
|
1
|
-
airtrain/__init__.py,sha256=
|
1
|
+
airtrain/__init__.py,sha256=t0n2IItXdHzaLZf_1zSUmSf3buF-8Y4FJol1LAzSclk,312
|
2
2
|
airtrain/core/__init__.py,sha256=9h7iKwTzZocCPc9bU6j8bA02BokteWIOcO1uaqGMcrk,254
|
3
3
|
airtrain/core/credentials.py,sha256=PgQotrQc46J5djidKnkK1znUv3fyNkUFDO-m2Kn_Gzo,4006
|
4
4
|
airtrain/core/schemas.py,sha256=MMXrDviC4gRea_QaPpbjgO--B_UKxnD7YrxqZOLJZZU,7003
|
5
5
|
airtrain/core/skills.py,sha256=LljalzeSHK5eQPTAOEAYc5D8Qn1kVSfiz9WgziTD5UM,4688
|
6
6
|
airtrain/integrations/__init__.py,sha256=PRKI_A-KE307C4lpXgFAsZA2oFtTl1kt_4CrRUF2rpU,832
|
7
|
-
airtrain-0.1.
|
8
|
-
airtrain-0.1.
|
9
|
-
airtrain-0.1.
|
10
|
-
airtrain-0.1.
|
7
|
+
airtrain-0.1.6.dist-info/METADATA,sha256=C0hcwg_Am0cUqrv8vKfNJ_AeMdBfGhxrSEmzDbjJA7o,4380
|
8
|
+
airtrain-0.1.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
9
|
+
airtrain-0.1.6.dist-info/top_level.txt,sha256=cFWW1vY6VMCb3AGVdz6jBDpZ65xxBRSqlsPyySxTkxY,9
|
10
|
+
airtrain-0.1.6.dist-info/RECORD,,
|
@@ -1,106 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.2
|
2
|
-
Name: airtrain
|
3
|
-
Version: 0.1.5
|
4
|
-
Summary: A platform for building and deploying AI agents with structured skills
|
5
|
-
Home-page: https://github.com/rosaboyle/airtrain.dev
|
6
|
-
Author: Dheeraj Pai
|
7
|
-
Author-email: helloworldcmu@gmail.com
|
8
|
-
Classifier: Development Status :: 3 - Alpha
|
9
|
-
Classifier: Intended Audience :: Developers
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
11
|
-
Classifier: Operating System :: OS Independent
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
16
|
-
Requires-Python: >=3.8
|
17
|
-
Description-Content-Type: text/markdown
|
18
|
-
Requires-Dist: pydantic>=2.0.0
|
19
|
-
Requires-Dist: openai>=1.0.0
|
20
|
-
Requires-Dist: python-dotenv>=0.19.0
|
21
|
-
Requires-Dist: PyYAML>=5.4.1
|
22
|
-
Requires-Dist: firebase-admin>=5.0.0
|
23
|
-
Requires-Dist: loguru>=0.5.3
|
24
|
-
Dynamic: author
|
25
|
-
Dynamic: author-email
|
26
|
-
Dynamic: classifier
|
27
|
-
Dynamic: description
|
28
|
-
Dynamic: description-content-type
|
29
|
-
Dynamic: home-page
|
30
|
-
Dynamic: requires-dist
|
31
|
-
Dynamic: requires-python
|
32
|
-
Dynamic: summary
|
33
|
-
|
34
|
-
# Airtrain
|
35
|
-
|
36
|
-
A powerful platform for building and deploying AI agents with structured skills and capabilities.
|
37
|
-
|
38
|
-
## Features
|
39
|
-
|
40
|
-
- **Structured Skills**: Build modular AI skills with defined input/output schemas
|
41
|
-
- **OpenAI Integration**: Built-in support for OpenAI's GPT models with structured outputs
|
42
|
-
- **Credential Management**: Secure handling of API keys and credentials
|
43
|
-
- **Type Safety**: Full type hints and Pydantic model support
|
44
|
-
- **Async Support**: Both synchronous and asynchronous API implementations
|
45
|
-
|
46
|
-
## Installation
|
47
|
-
|
48
|
-
```bash
|
49
|
-
pip install airtrain
|
50
|
-
```
|
51
|
-
|
52
|
-
## Quick Start
|
53
|
-
|
54
|
-
### Creating a Structured OpenAI Skill
|
55
|
-
|
56
|
-
```python
|
57
|
-
from airtrain.core.skills import Skill
|
58
|
-
from airtrain.core.schemas import InputSchema, OutputSchema
|
59
|
-
from pydantic import BaseModel
|
60
|
-
from typing import List
|
61
|
-
|
62
|
-
# Define your response model
|
63
|
-
class PersonInfo(BaseModel):
|
64
|
-
name: str
|
65
|
-
age: int
|
66
|
-
occupation: str
|
67
|
-
skills: List[str]
|
68
|
-
|
69
|
-
# Create a skill
|
70
|
-
class OpenAIParserSkill(Skill):
|
71
|
-
def process(self, input_data):
|
72
|
-
# Implementation
|
73
|
-
return parsed_response
|
74
|
-
|
75
|
-
# Use the skill
|
76
|
-
skill = OpenAIParserSkill()
|
77
|
-
result = skill.process(input_data)
|
78
|
-
```
|
79
|
-
|
80
|
-
### Managing Credentials
|
81
|
-
|
82
|
-
```python
|
83
|
-
from airtrain.core.credentials import OpenAICredentials
|
84
|
-
from pathlib import Path
|
85
|
-
|
86
|
-
# Load credentials
|
87
|
-
creds = OpenAICredentials(
|
88
|
-
api_key="your-api-key",
|
89
|
-
organization_id="optional-org-id"
|
90
|
-
)
|
91
|
-
|
92
|
-
# Save to environment
|
93
|
-
creds.load_to_env()
|
94
|
-
```
|
95
|
-
|
96
|
-
## Documentation
|
97
|
-
|
98
|
-
For detailed documentation, visit [our documentation site](https://docs.airtrain.dev/).
|
99
|
-
|
100
|
-
## Contributing
|
101
|
-
|
102
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
103
|
-
|
104
|
-
## License
|
105
|
-
|
106
|
-
This project is licensed under the MIT License - see the LICENSE file for details.
|
File without changes
|
File without changes
|