simplai-sdk 0.1.0__tar.gz
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.
- simplai_sdk-0.1.0/ENV_SETUP.md +128 -0
- simplai_sdk-0.1.0/LICENSE +21 -0
- simplai_sdk-0.1.0/MANIFEST.in +9 -0
- simplai_sdk-0.1.0/PKG-INFO +728 -0
- simplai_sdk-0.1.0/README.md +681 -0
- simplai_sdk-0.1.0/pyproject.toml +47 -0
- simplai_sdk-0.1.0/requirements.txt +18 -0
- simplai_sdk-0.1.0/setup.cfg +4 -0
- simplai_sdk-0.1.0/src/billing/__init__.py +6 -0
- simplai_sdk-0.1.0/src/billing/api.py +55 -0
- simplai_sdk-0.1.0/src/billing/client.py +14 -0
- simplai_sdk-0.1.0/src/billing/schema.py +15 -0
- simplai_sdk-0.1.0/src/constants/__init__.py +90 -0
- simplai_sdk-0.1.0/src/core/__init__.py +53 -0
- simplai_sdk-0.1.0/src/core/agents/__init__.py +42 -0
- simplai_sdk-0.1.0/src/core/agents/execution/__init__.py +49 -0
- simplai_sdk-0.1.0/src/core/agents/execution/api.py +283 -0
- simplai_sdk-0.1.0/src/core/agents/execution/client.py +1139 -0
- simplai_sdk-0.1.0/src/core/agents/models.py +99 -0
- simplai_sdk-0.1.0/src/core/workflows/WORKFLOW_ARCHITECTURE.md +417 -0
- simplai_sdk-0.1.0/src/core/workflows/__init__.py +31 -0
- simplai_sdk-0.1.0/src/core/workflows/bulk/__init__.py +14 -0
- simplai_sdk-0.1.0/src/core/workflows/bulk/api.py +202 -0
- simplai_sdk-0.1.0/src/core/workflows/bulk/client.py +115 -0
- simplai_sdk-0.1.0/src/core/workflows/bulk/schema.py +58 -0
- simplai_sdk-0.1.0/src/core/workflows/models.py +49 -0
- simplai_sdk-0.1.0/src/core/workflows/scheduling/__init__.py +9 -0
- simplai_sdk-0.1.0/src/core/workflows/scheduling/api.py +179 -0
- simplai_sdk-0.1.0/src/core/workflows/scheduling/client.py +128 -0
- simplai_sdk-0.1.0/src/core/workflows/scheduling/schema.py +74 -0
- simplai_sdk-0.1.0/src/core/workflows/tool_execution/__init__.py +16 -0
- simplai_sdk-0.1.0/src/core/workflows/tool_execution/api.py +172 -0
- simplai_sdk-0.1.0/src/core/workflows/tool_execution/client.py +195 -0
- simplai_sdk-0.1.0/src/core/workflows/tool_execution/schema.py +40 -0
- simplai_sdk-0.1.0/src/exceptions/__init__.py +21 -0
- simplai_sdk-0.1.0/src/simplai_sdk/__init__.py +7 -0
- simplai_sdk-0.1.0/src/simplai_sdk/simplai.py +239 -0
- simplai_sdk-0.1.0/src/simplai_sdk.egg-info/PKG-INFO +728 -0
- simplai_sdk-0.1.0/src/simplai_sdk.egg-info/SOURCES.txt +52 -0
- simplai_sdk-0.1.0/src/simplai_sdk.egg-info/dependency_links.txt +1 -0
- simplai_sdk-0.1.0/src/simplai_sdk.egg-info/requires.txt +8 -0
- simplai_sdk-0.1.0/src/simplai_sdk.egg-info/top_level.txt +7 -0
- simplai_sdk-0.1.0/src/traces/__init__.py +1 -0
- simplai_sdk-0.1.0/src/traces/agents/__init__.py +55 -0
- simplai_sdk-0.1.0/src/traces/agents/api.py +350 -0
- simplai_sdk-0.1.0/src/traces/agents/client.py +697 -0
- simplai_sdk-0.1.0/src/traces/agents/models.py +249 -0
- simplai_sdk-0.1.0/src/traces/workflows/__init__.py +0 -0
- simplai_sdk-0.1.0/src/utils/__init__.py +0 -0
- simplai_sdk-0.1.0/src/utils/config.py +117 -0
- simplai_sdk-0.1.0/tests/test_agent_chat.py +105 -0
- simplai_sdk-0.1.0/tests/test_agent_chat_stream.py +113 -0
- simplai_sdk-0.1.0/tests/test_execution.py +128 -0
- simplai_sdk-0.1.0/tests/test_traces.py +247 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Environment Configuration Setup
|
|
2
|
+
|
|
3
|
+
This guide explains how to set up environment variables for the Simplai Python SDK.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
1. **Copy the example file:**
|
|
8
|
+
```bash
|
|
9
|
+
cp .env.example .env
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
2. **Edit `.env` with your values:**
|
|
13
|
+
```env
|
|
14
|
+
API_KEY=your-pim-sid-api-key-here
|
|
15
|
+
AGENT_ID=agent-6912e47d72fe386f5281c242
|
|
16
|
+
SIMPAI_BASE_URL=https://edge-service-preprod.simplai.ai
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
3. **Install python-dotenv (if not already installed):**
|
|
20
|
+
```bash
|
|
21
|
+
pip install python-dotenv
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
4. **Run the test scripts:**
|
|
25
|
+
```bash
|
|
26
|
+
python tests/test_agent_chat.py
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Environment Variables
|
|
30
|
+
|
|
31
|
+
### Required
|
|
32
|
+
|
|
33
|
+
- **`API_KEY`**: Your PIM-SID API key for authentication
|
|
34
|
+
|
|
35
|
+
### Optional
|
|
36
|
+
|
|
37
|
+
- **`BASE_URL`**: Base URL for the Simplai API (default: `https://edge-service-preprod.simplai.ai`)
|
|
38
|
+
- **`AGENT_ID`**: Default agent ID to use in tests
|
|
39
|
+
- **`MESSAGE`**: Default message to send in tests
|
|
40
|
+
- **`CONVERSATION_ID`**: Existing conversation ID for continuing conversations
|
|
41
|
+
- **`PROJECT_ID`**: Project ID for the API requests
|
|
42
|
+
- **`TENANT_ID`**: Tenant ID (default: `1`)
|
|
43
|
+
- **`USER_ID`**: User ID for the API requests
|
|
44
|
+
|
|
45
|
+
## File Locations
|
|
46
|
+
|
|
47
|
+
- **`.env.example`**: Template file with example values (safe to commit)
|
|
48
|
+
- **`.env`**: Your actual configuration (gitignored, do NOT commit)
|
|
49
|
+
|
|
50
|
+
## Security Notes
|
|
51
|
+
|
|
52
|
+
⚠️ **Important:**
|
|
53
|
+
- Never commit your `.env` file to version control
|
|
54
|
+
- The `.env` file is automatically gitignored
|
|
55
|
+
- Keep your API keys secure and never share them publicly
|
|
56
|
+
- Use different API keys for different environments (dev, staging, prod)
|
|
57
|
+
|
|
58
|
+
## Loading Order
|
|
59
|
+
|
|
60
|
+
The SDK automatically loads API keys and configuration in this priority order:
|
|
61
|
+
|
|
62
|
+
1. **User-provided parameter** (e.g., `SimplAI(api_key="...")`)
|
|
63
|
+
2. **Environment variable** (e.g., `export API_KEY=...`)
|
|
64
|
+
3. **`.env` file** (automatically loaded if `python-dotenv` is installed)
|
|
65
|
+
4. **Default values** (for base_url only)
|
|
66
|
+
|
|
67
|
+
For API keys, if none of the above are found, the SDK will raise a clear error message.
|
|
68
|
+
|
|
69
|
+
## Example .env File
|
|
70
|
+
|
|
71
|
+
```env
|
|
72
|
+
# API Configuration
|
|
73
|
+
API_KEY=ccd97fb6-f105-4a82-9e6a-bc6a27734d5f
|
|
74
|
+
SIMPAI_BASE_URL=https://edge-service-preprod.simplai.ai
|
|
75
|
+
|
|
76
|
+
# Agent Configuration
|
|
77
|
+
AGENT_ID=agent-6912e47d72fe386f5281c242
|
|
78
|
+
|
|
79
|
+
# Test Message
|
|
80
|
+
MESSAGE=Hello! Can you help me?
|
|
81
|
+
|
|
82
|
+
# Project Configuration
|
|
83
|
+
PROJECT_ID=407
|
|
84
|
+
TENANT_ID=1
|
|
85
|
+
USER_ID=4
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Troubleshooting
|
|
89
|
+
|
|
90
|
+
### "API key is required" Error
|
|
91
|
+
The SDK will show this error if it cannot find an API key. To fix:
|
|
92
|
+
|
|
93
|
+
1. **Provide API key explicitly:**
|
|
94
|
+
```python
|
|
95
|
+
simplai = SimplAI(api_key="your-api-key")
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
2. **Set environment variable:**
|
|
99
|
+
```bash
|
|
100
|
+
export API_KEY=your-api-key
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
3. **Use `.env` file:**
|
|
104
|
+
- Create a `.env` file in the `python-sdk` directory
|
|
105
|
+
- Add `API_KEY=your-api-key` to the file
|
|
106
|
+
- Ensure `python-dotenv` is installed: `pip install python-dotenv`
|
|
107
|
+
|
|
108
|
+
### Environment variables not loading
|
|
109
|
+
- Verify the `.env` file path is correct (should be in `python-sdk/` directory)
|
|
110
|
+
- Check for typos in variable names
|
|
111
|
+
- Ensure there are no spaces around the `=` sign
|
|
112
|
+
- Make sure `python-dotenv` is installed if using `.env` files
|
|
113
|
+
- The SDK will automatically search for `.env` files in common locations
|
|
114
|
+
|
|
115
|
+
### Using environment variables directly
|
|
116
|
+
If you prefer not to use `.env` files, you can set environment variables directly:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
export API_KEY=your-api-key
|
|
120
|
+
export AGENT_ID=agent-123
|
|
121
|
+
python tests/test_agent_chat.py
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Or inline:
|
|
125
|
+
```bash
|
|
126
|
+
API_KEY=your-api-key python tests/test_agent_chat.py
|
|
127
|
+
```
|
|
128
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SimplAI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|