persona-sdk-python 0.2.24__tar.gz → 0.2.25__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.24 → persona_sdk_python-0.2.25}/PKG-INFO +1 -1
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/__init__.py +3 -0
- persona_sdk_python-0.2.25/persona_sdk/api/channels.py +64 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/pyproject.toml +1 -1
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/uv.lock +2 -2
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/.github/workflows/ci.yml +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/.github/workflows/deploy.yml +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/.gitignore +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/DEPLOY.md +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/MIGRATION_GITHUB.md +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/README.md +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/_serde.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/__init__.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/agents.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/credentials.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/features.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/human_tasks.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/knowledge_bases.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/markup_rules.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/missions.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/projects.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/providers.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/service_prices.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/sessions.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/triggers.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/api/workflows.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/auth/__init__.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/auth/api_key_auth.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/auth/base.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/auth/bearer_token_auth.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/client.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/runners/__init__.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/runners/agent_runner.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/runners/resource_retriever.py +0 -0
- {persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/runners/tool_invoker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: persona-sdk-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.25
|
|
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
|
|
@@ -13,6 +13,7 @@ from persona_sdk.api.sessions import SessionsApi
|
|
|
13
13
|
from persona_sdk.api.triggers import TriggersApi
|
|
14
14
|
from persona_sdk.api.workflows import WorkflowsApi
|
|
15
15
|
from persona_sdk.api.human_tasks import HumanTasksApi
|
|
16
|
+
from persona_sdk.api.channels import ChannelsApi
|
|
16
17
|
from persona_sdk.auth import (
|
|
17
18
|
ApiKeyAuthenticationProvider,
|
|
18
19
|
AuthenticationProvider,
|
|
@@ -61,6 +62,7 @@ __all__ = [
|
|
|
61
62
|
"TriggersApi",
|
|
62
63
|
"WorkflowsApi",
|
|
63
64
|
"HumanTasksApi",
|
|
65
|
+
"ChannelsApi",
|
|
64
66
|
# Domain models (re-exported from persona-models)
|
|
65
67
|
"Paginated",
|
|
66
68
|
"AgentConfiguration",
|
|
@@ -139,6 +141,7 @@ class PersonaSdk:
|
|
|
139
141
|
self.agents = AgentsApi(self.client)
|
|
140
142
|
self.workflows = WorkflowsApi(self.workflows_client)
|
|
141
143
|
self.human_tasks = HumanTasksApi(self.workflows_client)
|
|
144
|
+
self.channels = ChannelsApi(self.workflows_client)
|
|
142
145
|
self.triggers = TriggersApi(self.client)
|
|
143
146
|
self.sessions = SessionsApi(self.client)
|
|
144
147
|
self.credentials = CredentialsApi(self.client)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from persona_sdk.client import PersonaClient
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ChannelsApi:
|
|
9
|
+
"""
|
|
10
|
+
Notification channels: where the project's human tasks are announced
|
|
11
|
+
and can be answered outside the inbox (a Telegram group, one message
|
|
12
|
+
per task). Linking happens through deep links: the service
|
|
13
|
+
returns a one-shot URL (``t.me/<bot>?startgroup=...`` for a group,
|
|
14
|
+
``t.me/<bot>?start=...`` for the user's own account).
|
|
15
|
+
|
|
16
|
+
Lives on the workflows service (same client as ``HumanTasksApi``).
|
|
17
|
+
Identity endpoints require a user (IAM bearer) session.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(self, client: PersonaClient):
|
|
21
|
+
self._client = client
|
|
22
|
+
|
|
23
|
+
async def providers(self) -> list[dict[str, Any]]:
|
|
24
|
+
"""The providers enabled on the server (e.g. the Telegram bot)."""
|
|
25
|
+
return await self._client.get("/channels/providers")
|
|
26
|
+
|
|
27
|
+
async def list(self) -> list[dict[str, Any]]:
|
|
28
|
+
"""The project's channels, with their setup status."""
|
|
29
|
+
return await self._client.get("/channels")
|
|
30
|
+
|
|
31
|
+
async def create_link(self, provider: str = "telegram") -> dict[str, Any]:
|
|
32
|
+
"""One-shot deep link that links a group to the project."""
|
|
33
|
+
return await self._client.post(f"/channels/{provider}/link-token")
|
|
34
|
+
|
|
35
|
+
async def update(
|
|
36
|
+
self,
|
|
37
|
+
channel_id: str,
|
|
38
|
+
include_payload: bool | None = None,
|
|
39
|
+
locale: str | None = None,
|
|
40
|
+
) -> dict[str, Any]:
|
|
41
|
+
body: dict[str, Any] = {}
|
|
42
|
+
if include_payload is not None:
|
|
43
|
+
body["includePayload"] = include_payload
|
|
44
|
+
if locale:
|
|
45
|
+
body["locale"] = locale
|
|
46
|
+
return await self._client.patch(f"/channels/{channel_id}", json=body)
|
|
47
|
+
|
|
48
|
+
async def verify(self, channel_id: str) -> dict[str, Any]:
|
|
49
|
+
"""Re-checks the channel setup (the bot can still post in the group)."""
|
|
50
|
+
return await self._client.post(f"/channels/{channel_id}/verify")
|
|
51
|
+
|
|
52
|
+
async def unlink(self, channel_id: str) -> None:
|
|
53
|
+
await self._client.delete(f"/channels/{channel_id}")
|
|
54
|
+
|
|
55
|
+
async def my_identities(self) -> list[dict[str, Any]]:
|
|
56
|
+
"""The caller's linked accounts."""
|
|
57
|
+
return await self._client.get("/channels/identities/me")
|
|
58
|
+
|
|
59
|
+
async def create_identity_link(self, provider: str = "telegram") -> dict[str, Any]:
|
|
60
|
+
"""One-shot deep link that links the caller's account."""
|
|
61
|
+
return await self._client.post(f"/channels/identities/{provider}/link-token")
|
|
62
|
+
|
|
63
|
+
async def unlink_identity(self, provider: str = "telegram") -> None:
|
|
64
|
+
await self._client.delete(f"/channels/identities/me/{provider}")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
version = 1
|
|
2
|
-
revision =
|
|
2
|
+
revision = 5
|
|
3
3
|
requires-python = ">=3.10"
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
@@ -106,7 +106,7 @@ wheels = [
|
|
|
106
106
|
|
|
107
107
|
[[package]]
|
|
108
108
|
name = "persona-sdk-python"
|
|
109
|
-
version = "0.2.
|
|
109
|
+
version = "0.2.25"
|
|
110
110
|
source = { editable = "." }
|
|
111
111
|
dependencies = [
|
|
112
112
|
{ name = "httpx" },
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/auth/bearer_token_auth.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{persona_sdk_python-0.2.24 → persona_sdk_python-0.2.25}/persona_sdk/runners/resource_retriever.py
RENAMED
|
File without changes
|
|
File without changes
|