persona-sdk-python 0.2.4__tar.gz → 0.2.6__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.
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/PKG-INFO +28 -12
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/README.md +27 -11
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/api/agents.py +12 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/pyproject.toml +1 -1
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/.gitignore +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/DEPLOY.md +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/bitbucket-pipelines.yml +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/__init__.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/api/__init__.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/api/credentials.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/api/features.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/api/knowledge_bases.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/api/missions.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/api/projects.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/api/service_prices.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/api/sessions.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/api/triggers.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/api/workflows.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/auth/__init__.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/auth/api_key_auth.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/auth/base.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/auth/bearer_token_auth.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/client.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/runners/__init__.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/runners/agent_runner.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/runners/resource_retriever.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/runners/tool_invoker.py +0 -0
- {persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: persona-sdk-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Async Python SDK for the Persona AI platform
|
|
5
5
|
Project-URL: Homepage, https://persona.applica.guru
|
|
6
6
|
Project-URL: Repository, https://bitbucket.org/applicaguru/persona-sdk-python
|
|
@@ -123,7 +123,7 @@ The `PersonaSdk` instance exposes one client per resource:
|
|
|
123
123
|
|
|
124
124
|
| Attribute | Description |
|
|
125
125
|
|-----------|-------------|
|
|
126
|
-
| `sdk.agents` | Agent management (CRUD, voices) |
|
|
126
|
+
| `sdk.agents` | Agent management (CRUD, voices, AI instructions, architect) |
|
|
127
127
|
| `sdk.projects` | Project management and subscriptions |
|
|
128
128
|
| `sdk.sessions` | Sessions, messages, usage |
|
|
129
129
|
| `sdk.knowledge_bases` | Knowledge bases, documents, chunk search |
|
|
@@ -134,24 +134,20 @@ The `PersonaSdk` instance exposes one client per resource:
|
|
|
134
134
|
| `sdk.credentials` | OAuth credentials and authorization |
|
|
135
135
|
| `sdk.service_prices` | Service pricing |
|
|
136
136
|
|
|
137
|
-
Each API method is fully async. Always close the SDK when done
|
|
137
|
+
Each API method is fully async. Always close the SDK when done to release the
|
|
138
|
+
underlying HTTP connection pool:
|
|
138
139
|
|
|
139
140
|
```python
|
|
140
|
-
sdk = PersonaSdk(
|
|
141
|
+
sdk = PersonaSdk(
|
|
142
|
+
base_url="https://persona.applica.guru/api",
|
|
143
|
+
auth="prs_your_api_key",
|
|
144
|
+
)
|
|
141
145
|
try:
|
|
142
146
|
agents = await sdk.agents.list()
|
|
143
147
|
finally:
|
|
144
148
|
await sdk.close()
|
|
145
149
|
```
|
|
146
150
|
|
|
147
|
-
Or use it as an async context manager pattern:
|
|
148
|
-
|
|
149
|
-
```python
|
|
150
|
-
sdk = PersonaSdk(...)
|
|
151
|
-
async with sdk.client._client: # internal httpx client
|
|
152
|
-
...
|
|
153
|
-
```
|
|
154
|
-
|
|
155
151
|
## CRUD example
|
|
156
152
|
|
|
157
153
|
```python
|
|
@@ -172,6 +168,26 @@ await sdk.agents.update(agent["id"], fetched)
|
|
|
172
168
|
await sdk.agents.delete(agent["id"])
|
|
173
169
|
```
|
|
174
170
|
|
|
171
|
+
## AI System Instructions Generation
|
|
172
|
+
|
|
173
|
+
Generate system instructions for an agent using the project's AI architect:
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
# Generate from a description
|
|
177
|
+
instructions = await sdk.agents.generate_system_instructions(
|
|
178
|
+
"Create a customer support agent that handles billing inquiries"
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
# Multi-turn refinement with session ID
|
|
182
|
+
instructions = await sdk.agents.generate_system_instructions(
|
|
183
|
+
"Add a rule to always ask for the order number first",
|
|
184
|
+
session_id="my-session-id",
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
# Get the project's architect agent configuration
|
|
188
|
+
architect = await sdk.agents.get_architect()
|
|
189
|
+
```
|
|
190
|
+
|
|
175
191
|
## Pagination
|
|
176
192
|
|
|
177
193
|
List endpoints accept `keyword`, `page`, and `size`:
|
|
@@ -99,7 +99,7 @@ The `PersonaSdk` instance exposes one client per resource:
|
|
|
99
99
|
|
|
100
100
|
| Attribute | Description |
|
|
101
101
|
|-----------|-------------|
|
|
102
|
-
| `sdk.agents` | Agent management (CRUD, voices) |
|
|
102
|
+
| `sdk.agents` | Agent management (CRUD, voices, AI instructions, architect) |
|
|
103
103
|
| `sdk.projects` | Project management and subscriptions |
|
|
104
104
|
| `sdk.sessions` | Sessions, messages, usage |
|
|
105
105
|
| `sdk.knowledge_bases` | Knowledge bases, documents, chunk search |
|
|
@@ -110,24 +110,20 @@ The `PersonaSdk` instance exposes one client per resource:
|
|
|
110
110
|
| `sdk.credentials` | OAuth credentials and authorization |
|
|
111
111
|
| `sdk.service_prices` | Service pricing |
|
|
112
112
|
|
|
113
|
-
Each API method is fully async. Always close the SDK when done
|
|
113
|
+
Each API method is fully async. Always close the SDK when done to release the
|
|
114
|
+
underlying HTTP connection pool:
|
|
114
115
|
|
|
115
116
|
```python
|
|
116
|
-
sdk = PersonaSdk(
|
|
117
|
+
sdk = PersonaSdk(
|
|
118
|
+
base_url="https://persona.applica.guru/api",
|
|
119
|
+
auth="prs_your_api_key",
|
|
120
|
+
)
|
|
117
121
|
try:
|
|
118
122
|
agents = await sdk.agents.list()
|
|
119
123
|
finally:
|
|
120
124
|
await sdk.close()
|
|
121
125
|
```
|
|
122
126
|
|
|
123
|
-
Or use it as an async context manager pattern:
|
|
124
|
-
|
|
125
|
-
```python
|
|
126
|
-
sdk = PersonaSdk(...)
|
|
127
|
-
async with sdk.client._client: # internal httpx client
|
|
128
|
-
...
|
|
129
|
-
```
|
|
130
|
-
|
|
131
127
|
## CRUD example
|
|
132
128
|
|
|
133
129
|
```python
|
|
@@ -148,6 +144,26 @@ await sdk.agents.update(agent["id"], fetched)
|
|
|
148
144
|
await sdk.agents.delete(agent["id"])
|
|
149
145
|
```
|
|
150
146
|
|
|
147
|
+
## AI System Instructions Generation
|
|
148
|
+
|
|
149
|
+
Generate system instructions for an agent using the project's AI architect:
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
# Generate from a description
|
|
153
|
+
instructions = await sdk.agents.generate_system_instructions(
|
|
154
|
+
"Create a customer support agent that handles billing inquiries"
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
# Multi-turn refinement with session ID
|
|
158
|
+
instructions = await sdk.agents.generate_system_instructions(
|
|
159
|
+
"Add a rule to always ask for the order number first",
|
|
160
|
+
session_id="my-session-id",
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
# Get the project's architect agent configuration
|
|
164
|
+
architect = await sdk.agents.get_architect()
|
|
165
|
+
```
|
|
166
|
+
|
|
151
167
|
## Pagination
|
|
152
168
|
|
|
153
169
|
List endpoints accept `keyword`, `page`, and `size`:
|
|
@@ -25,3 +25,15 @@ class AgentsApi:
|
|
|
25
25
|
|
|
26
26
|
async def get_voices(self, synthesizer_type: str) -> dict:
|
|
27
27
|
return await self._client.get(f"/values/synthesizers/{synthesizer_type}/voices")
|
|
28
|
+
|
|
29
|
+
async def generate_system_instructions(self, prompt: str, session_id: str = None) -> str:
|
|
30
|
+
"""Generate system instructions using the project's AI architect agent."""
|
|
31
|
+
body = {"prompt": prompt}
|
|
32
|
+
if session_id:
|
|
33
|
+
body["sessionId"] = session_id
|
|
34
|
+
result = await self._client.post("/agents/system-instructions", json=body)
|
|
35
|
+
return result.get("instructions", "")
|
|
36
|
+
|
|
37
|
+
async def get_architect(self) -> dict:
|
|
38
|
+
"""Get or create the project's architect agent configuration."""
|
|
39
|
+
return await self._client.get("/agents/architect")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{persona_sdk_python-0.2.4 → persona_sdk_python-0.2.6}/persona_sdk/runners/resource_retriever.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|