para-sdk 0.24.0a3__cp38-abi3-manylinux_2_34_x86_64.whl → 0.24.0rc2__cp38-abi3-manylinux_2_34_x86_64.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.
Potentially problematic release.
This version of para-sdk might be problematic. Click here for more details.
- para/__init__.py +1 -2
- para/para.abi3.so +0 -0
- {para_sdk-0.24.0a3.dist-info → para_sdk-0.24.0rc2.dist-info}/METADATA +1 -2
- para_sdk-0.24.0rc2.dist-info/RECORD +10 -0
- para/notebook_client.py +0 -138
- para_sdk-0.24.0a3.dist-info/RECORD +0 -11
- {para_sdk-0.24.0a3.dist-info → para_sdk-0.24.0rc2.dist-info}/WHEEL +0 -0
para/__init__.py
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
from .client import UserClient, new_client, new_connection
|
|
2
|
-
from .notebook_client import NotebookClient, from_env, connect_to, existing_users, cognito_add
|
|
1
|
+
from .client import UserClient, new_client, new_connection
|
para/para.abi3.so
CHANGED
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
para/__init__.py,sha256=j91SUu6B2VlgXvHvNkH5NK3WDkBdrNBytoPhO5E_LWU,58
|
|
2
|
+
para/__main__.py,sha256=GUDEQZo7PdWXRCYbNZm65kcl0lENtu3AikKs0bflDrM,64
|
|
3
|
+
para/client.py,sha256=-L3BQ54fumiD06vW97etNcPbFgUA6qIjJUu0YF6Ng8A,10141
|
|
4
|
+
para/conversation_panel.py,sha256=cGRdl2ay1BJJ1yOsJTunDgJAY7CD4BczTiWE0VzN3xc,2168
|
|
5
|
+
para/messages.py,sha256=U41mSpPXp9ub5JpUU53hn-yha9dCA9qOxrj9vsGQUHY,6102
|
|
6
|
+
para/para.abi3.so,sha256=u2Qw__9Uuudg0k4Bthz_TuHdBPmFm9Xr0iFur0th_MA,73296544
|
|
7
|
+
para/poller.py,sha256=vmUeA_Gj9xD7O15n9tY8w37QMMHZwfJpbShB9lNHoJ4,1666
|
|
8
|
+
para_sdk-0.24.0rc2.dist-info/METADATA,sha256=TeTKEHQLE1YAN4goNpzNCE1U7Oc3axMaOT_BRsE2ngE,154
|
|
9
|
+
para_sdk-0.24.0rc2.dist-info/WHEEL,sha256=pUkYIDB1vZX9ZqAclLOB_KP53Hv9iCsStkIScN-dKhw,106
|
|
10
|
+
para_sdk-0.24.0rc2.dist-info/RECORD,,
|
para/notebook_client.py
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import json
|
|
3
|
-
import base64
|
|
4
|
-
import builtins
|
|
5
|
-
from dataclasses import dataclass
|
|
6
|
-
from para import para;
|
|
7
|
-
from typing import Any, Optional
|
|
8
|
-
from typing import List
|
|
9
|
-
import boto3
|
|
10
|
-
|
|
11
|
-
if hasattr(builtins, "__IPYTHON__"):
|
|
12
|
-
from .conversation_panel import ConversationPanel
|
|
13
|
-
|
|
14
|
-
if hasattr(builtins, "__IPYTHON__"):
|
|
15
|
-
import panel as pn
|
|
16
|
-
pn.extension()
|
|
17
|
-
|
|
18
|
-
class NotebookClient:
|
|
19
|
-
_client: any
|
|
20
|
-
|
|
21
|
-
def __init__(self, client: any):
|
|
22
|
-
self._client = client
|
|
23
|
-
|
|
24
|
-
def new_request(self, subject: str, action: str, target_actor_id=None, **kwargs):
|
|
25
|
-
return self._client.pncp.skill_request(subject, action, target=target_actor_id, **kwargs)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
async def from_env():
|
|
29
|
-
paranet_endpoint = os.environ.get('PARANET_ENDPOINT')
|
|
30
|
-
|
|
31
|
-
if not paranet_endpoint:
|
|
32
|
-
raise ValueError("PARANET_ENDPOINT is not set")
|
|
33
|
-
|
|
34
|
-
actor = os.environ.get('PARANET_ACTOR_ID')
|
|
35
|
-
version = os.environ.get('PARANET_ACTOR_VERSION') or '1.0.0'
|
|
36
|
-
|
|
37
|
-
if not actor:
|
|
38
|
-
raise ValueError("PARANET_ACTOR is required")
|
|
39
|
-
|
|
40
|
-
actor_entity_id = f'{actor}@{version}'
|
|
41
|
-
|
|
42
|
-
paranet_access_token = os.environ.get('PARANET_ACTOR_ACCESS_TOKEN')
|
|
43
|
-
paranet_refresh_token = os.environ.get('PARANET_ACTOR_REFRESH_TOKEN')
|
|
44
|
-
|
|
45
|
-
paranet_jwt = os.environ.get('PARANET_ACTOR_JWT')
|
|
46
|
-
paranet_password = os.environ.get('PARANET_ACTOR_PASSWORD')
|
|
47
|
-
paranet_cognito_password = os.environ.get('PARANET_ACTOR_COGNITO_PASSWORD')
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
print(f"Paranet endpoint: {paranet_endpoint}")
|
|
51
|
-
endpoint = para.web_endpoint(paranet_endpoint)
|
|
52
|
-
|
|
53
|
-
if paranet_access_token and paranet_refresh_token:
|
|
54
|
-
client = await endpoint.paranode(actor, access_token=paranet_access_token, refresh_token=paranet_refresh_token)
|
|
55
|
-
elif paranet_password:
|
|
56
|
-
client = await endpoint.paranode(actor, password=paranet_password)
|
|
57
|
-
elif paranet_cognito_password:
|
|
58
|
-
client = await endpoint.paranode(actor, cognito_password=paranet_cognito_password)
|
|
59
|
-
elif paranet_jwt:
|
|
60
|
-
client = await endpoint.paranode(actor, jwt=paranet_jwt)
|
|
61
|
-
else:
|
|
62
|
-
raise ValueError("No login method provided")
|
|
63
|
-
|
|
64
|
-
print(f"Logged into {paranet_endpoint} as {actor_entity_id}")
|
|
65
|
-
|
|
66
|
-
return client
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def existing_users(paranode):
|
|
70
|
-
actors = paranode.list_base_actors()
|
|
71
|
-
existing = set()
|
|
72
|
-
for actor in actors:
|
|
73
|
-
if (actor['kind'] == "user"):
|
|
74
|
-
existing.add(actor['id'])
|
|
75
|
-
return existing
|
|
76
|
-
|
|
77
|
-
def cognito_add(paranode, cognito_pool_id='us-west-2_N7wvmRxN6', group_name='Playgrounds'):
|
|
78
|
-
region = "us-west-2"
|
|
79
|
-
|
|
80
|
-
existing = existing_users(paranode)
|
|
81
|
-
print("Existing users", existing)
|
|
82
|
-
|
|
83
|
-
client = boto3.client('cognito-idp', region_name=region)
|
|
84
|
-
paginator = client.get_paginator("list_users_in_group")
|
|
85
|
-
|
|
86
|
-
for page in paginator.paginate(UserPoolId=cognito_pool_id, GroupName=group_name):
|
|
87
|
-
for user in page['Users']:
|
|
88
|
-
username = user['Username']
|
|
89
|
-
if username not in existing:
|
|
90
|
-
print(f"Cognito user {username} added")
|
|
91
|
-
paranode.paranode_new_user(username, cognito_id=username)
|
|
92
|
-
else:
|
|
93
|
-
print(f"Cognito user {username} skipped")
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
async def connect_to(parent, name: Optional[str] = None, password: Optional[str] = "fun", **kwargs: Any):
|
|
97
|
-
namespace = parent
|
|
98
|
-
node_name = parent
|
|
99
|
-
endpoint = f"https://{namespace}.paranet.otonoma.com"
|
|
100
|
-
parent_namespace = None
|
|
101
|
-
if name:
|
|
102
|
-
node_name = name
|
|
103
|
-
namespace = f"{namespace}--{name}"
|
|
104
|
-
endpoint = f"https://{name}.{parent}.paranet.otonoma.com"
|
|
105
|
-
parent_namespace = parent
|
|
106
|
-
|
|
107
|
-
env = para.env_version()
|
|
108
|
-
print("Environment versions", env)
|
|
109
|
-
|
|
110
|
-
kwargs.setdefault("platform_channel", env.platform_channel)
|
|
111
|
-
kwargs.setdefault("platform_version", env.platform_version)
|
|
112
|
-
kwargs.setdefault("paranet_version", env.paranet_version)
|
|
113
|
-
kwargs.setdefault("paraflow_version", env.paraflow_version)
|
|
114
|
-
kwargs.setdefault("paralogue_version", env.paralogue_version)
|
|
115
|
-
kwargs.setdefault("python_sdk_version", env.python_sdk_version)
|
|
116
|
-
kwargs.setdefault("paracord_version", env.paracord_version)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
# Defines a new node to create
|
|
120
|
-
node = await para.create_kube(
|
|
121
|
-
node_name,
|
|
122
|
-
namespace=namespace,
|
|
123
|
-
parent_namespace=parent_namespace,
|
|
124
|
-
endpoint=endpoint,
|
|
125
|
-
|
|
126
|
-
cognito_client_id="4b52p19cfsaeobagem34vfe2u9",
|
|
127
|
-
cognito_pool_id="us-west-2_N7wvmRxN6",
|
|
128
|
-
cognito_redirect=f"https://{parent}.paranet.otonoma.com/auth/cognito/",
|
|
129
|
-
|
|
130
|
-
root_password=password,
|
|
131
|
-
await_for=None,
|
|
132
|
-
|
|
133
|
-
**kwargs,
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
deployer = await node.deployer("root", password=password, await_for=None)
|
|
137
|
-
|
|
138
|
-
return deployer
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
para/__init__.py,sha256=x0T6yNZ_K1AJIT5q1mUr4qAq5ozJRs_VOuzVE6R713A,153
|
|
2
|
-
para/__main__.py,sha256=GUDEQZo7PdWXRCYbNZm65kcl0lENtu3AikKs0bflDrM,64
|
|
3
|
-
para/client.py,sha256=-L3BQ54fumiD06vW97etNcPbFgUA6qIjJUu0YF6Ng8A,10141
|
|
4
|
-
para/conversation_panel.py,sha256=cGRdl2ay1BJJ1yOsJTunDgJAY7CD4BczTiWE0VzN3xc,2168
|
|
5
|
-
para/messages.py,sha256=U41mSpPXp9ub5JpUU53hn-yha9dCA9qOxrj9vsGQUHY,6102
|
|
6
|
-
para/notebook_client.py,sha256=EQMTOTgUhW-2n_Z3m0RtIgIakP0mOJggQ42NC2m8f7Y,4599
|
|
7
|
-
para/para.abi3.so,sha256=uYPEnMhmcoIEnA1Zoz6avCeJkWHeU7-iDDY_eDXk_D4,77866416
|
|
8
|
-
para/poller.py,sha256=vmUeA_Gj9xD7O15n9tY8w37QMMHZwfJpbShB9lNHoJ4,1666
|
|
9
|
-
para_sdk-0.24.0a3.dist-info/METADATA,sha256=a3Sqop-M1MvrvsSyouwIhhncATtbivGNrIx1MGpEbgg,174
|
|
10
|
-
para_sdk-0.24.0a3.dist-info/WHEEL,sha256=pUkYIDB1vZX9ZqAclLOB_KP53Hv9iCsStkIScN-dKhw,106
|
|
11
|
-
para_sdk-0.24.0a3.dist-info/RECORD,,
|
|
File without changes
|