Skip to content

Commit e3a8ddd

Browse files
committed
added code to convert model to base64, fixed URL hooks
1 parent 808674b commit e3a8ddd

File tree

2 files changed

+171
-78
lines changed

2 files changed

+171
-78
lines changed

projects/aries-fl/notebooks/hospital/Hospital.ipynb

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"cell_type": "code",
55
"execution_count": 1,
6-
"id": "incredible-yemen",
6+
"id": "voluntary-psychiatry",
77
"metadata": {},
88
"outputs": [
99
{
@@ -12,17 +12,6 @@
1212
"text": [
1313
"IPython autoawait is `on`, and set to use `asyncio`\n"
1414
]
15-
},
16-
{
17-
"ename": "ModuleNotFoundError",
18-
"evalue": "No module named 'aries_basic_controller'",
19-
"output_type": "error",
20-
"traceback": [
21-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
22-
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
23-
"\u001b[0;32m<ipython-input-1-cf8eac349ea5>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mtime\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0masyncio\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0maries_basic_controller\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0maries_controller\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mAriesAgentController\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0mWEBHOOK_HOST\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"0.0.0.0\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
24-
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'aries_basic_controller'"
25-
]
2615
}
2716
],
2817
"source": [
@@ -34,16 +23,17 @@
3423
"WEBHOOK_HOST = \"0.0.0.0\"\n",
3524
"WEBHOOK_PORT = 8052\n",
3625
"WEBHOOK_BASE = \"\"\n",
37-
"ADMIN_URL = \"http://hospital1-agent:8051\"\n",
26+
"# ADMIN_URL = \"http://hospital1-agent:8051\"\n",
27+
"ADMIN_URL = \"http://0.0.0.0:8051\"\n",
3828
"\n",
3929
"agent_controller = AriesAgentController(webhook_host=WEBHOOK_HOST, webhook_port=WEBHOOK_PORT,\n",
4030
" webhook_base=WEBHOOK_BASE, admin_url=ADMIN_URL)"
4131
]
4232
},
4333
{
4434
"cell_type": "code",
45-
"execution_count": 4,
46-
"id": "adaptive-monte",
35+
"execution_count": 2,
36+
"id": "hairy-richardson",
4737
"metadata": {},
4838
"outputs": [],
4939
"source": [
@@ -77,42 +67,34 @@
7767
},
7868
{
7969
"cell_type": "markdown",
80-
"id": "quick-shanghai",
70+
"id": "potential-satellite",
8171
"metadata": {},
8272
"source": [
8373
"## Copy Invite from Researcher"
8474
]
8575
},
8676
{
8777
"cell_type": "code",
88-
"execution_count": 5,
89-
"id": "rubber-thirty",
78+
"execution_count": 3,
79+
"id": "charming-newton",
9080
"metadata": {},
9181
"outputs": [],
9282
"source": [
9383
"#Paste in invitation from researcher agent\n",
94-
"invitation = {'@type': 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation', '@id': '31d22c96-b531-467a-8637-867f0e9199ac', 'label': 'Health Researcher', 'serviceEndpoint': 'http://172.17.0.1:8040', 'recipientKeys': ['Hu8va1kwBxycxKa731q6FeenAmhk5s3x2X3MXXR7CckE']}"
84+
"invitation = {'@type': 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation', '@id': '0ffe0480-5b18-432e-869d-a8d0b44e1095', 'serviceEndpoint': 'http://192.168.65.3:8040', 'recipientKeys': ['9unc3yUPfSsTxM9FsrDmVwFWe3icW3qokVFwiNzNKbhs'], 'label': 'Health Researcher'}"
9585
]
9686
},
9787
{
9888
"cell_type": "code",
99-
"execution_count": 6,
100-
"id": "micro-attraction",
89+
"execution_count": 4,
90+
"id": "religious-xerox",
10191
"metadata": {},
10292
"outputs": [
10393
{
10494
"name": "stdout",
10595
"output_type": "stream",
10696
"text": [
107-
"Connection Handler Called\n",
108-
"Connection ec35bfc5-68ef-45c4-87c6-5d9f63819c77 in State invitation\n",
109-
"Connection Handler Called\n",
110-
"Connection ec35bfc5-68ef-45c4-87c6-5d9f63819c77 in State request\n",
111-
"Connection {'invitation_key': 'Hu8va1kwBxycxKa731q6FeenAmhk5s3x2X3MXXR7CckE', 'state': 'request', 'connection_id': 'ec35bfc5-68ef-45c4-87c6-5d9f63819c77', 'routing_state': 'none', 'updated_at': '2021-01-23 14:22:15.871577Z', 'initiator': 'external', 'invitation_mode': 'once', 'created_at': '2021-01-23 14:22:15.851490Z', 'accept': 'manual', 'their_label': 'Health Researcher', 'my_did': 'ALrPXCqEuqa5wYFUDDkfeo', 'request_id': 'b9560178-dc00-4496-9a8c-2da146166b4d'}\n",
112-
"Connection Handler Called\n",
113-
"Connection ec35bfc5-68ef-45c4-87c6-5d9f63819c77 in State response\n",
114-
"Connection Handler Called\n",
115-
"Connection ec35bfc5-68ef-45c4-87c6-5d9f63819c77 in State active\n"
97+
"Connection {'routing_state': 'none', 'request_id': '4daeee1e-55f7-4595-abf3-9d3415c87062', 'their_label': 'Health Researcher', 'invitation_key': '9unc3yUPfSsTxM9FsrDmVwFWe3icW3qokVFwiNzNKbhs', 'accept': 'manual', 'initiator': 'external', 'invitation_mode': 'once', 'created_at': '2021-01-25 11:03:59.525988Z', 'connection_id': 'c10446d0-7783-4db2-8817-02162115162c', 'my_did': '7vWuaxg22g8mo7WBS1e8vn', 'state': 'request', 'updated_at': '2021-01-25 11:03:59.560705Z'}\n"
11698
]
11799
}
118100
],
@@ -126,10 +108,20 @@
126108
},
127109
{
128110
"cell_type": "code",
129-
"execution_count": null,
130-
"id": "civilian-exhibit",
111+
"execution_count": 5,
112+
"id": "boxed-scott",
131113
"metadata": {},
132-
"outputs": [],
114+
"outputs": [
115+
{
116+
"name": "stdout",
117+
"output_type": "stream",
118+
"text": [
119+
"Alice AGENT CONNECTION\n",
120+
"{'routing_state': 'none', 'request_id': '4daeee1e-55f7-4595-abf3-9d3415c87062', 'their_label': 'Health Researcher', 'invitation_key': '9unc3yUPfSsTxM9FsrDmVwFWe3icW3qokVFwiNzNKbhs', 'accept': 'manual', 'initiator': 'external', 'invitation_mode': 'once', 'created_at': '2021-01-25 11:03:59.525988Z', 'connection_id': 'c10446d0-7783-4db2-8817-02162115162c', 'my_did': '7vWuaxg22g8mo7WBS1e8vn', 'state': 'request', 'updated_at': '2021-01-25 11:03:59.560705Z'}\n",
121+
"State: request\n"
122+
]
123+
}
124+
],
133125
"source": [
134126
"# Print connection list\n",
135127
"connection = await agent_controller.connections.get_connection(alice_id)\n",
@@ -141,7 +133,7 @@
141133
{
142134
"cell_type": "code",
143135
"execution_count": 6,
144-
"id": "external-compact",
136+
"id": "considerable-consequence",
145137
"metadata": {},
146138
"outputs": [
147139
{
@@ -297,15 +289,15 @@
297289
},
298290
{
299291
"cell_type": "markdown",
300-
"id": "numerous-fruit",
292+
"id": "peaceful-thousand",
301293
"metadata": {},
302294
"source": [
303295
"# For the Training follow the Number's Sequence"
304296
]
305297
},
306298
{
307299
"cell_type": "markdown",
308-
"id": "instructional-feelings",
300+
"id": "copyrighted-charger",
309301
"metadata": {},
310302
"source": [
311303
"## 2. The Hospital receives the model from the Researcher, Trains it using its own dataset, and saves it as \"/../trained_model.pt\""
@@ -314,7 +306,7 @@
314306
{
315307
"cell_type": "code",
316308
"execution_count": 7,
317-
"id": "black-boards",
309+
"id": "binary-indonesian",
318310
"metadata": {
319311
"scrolled": true
320312
},
@@ -416,7 +408,7 @@
416408
{
417409
"cell_type": "code",
418410
"execution_count": null,
419-
"id": "dependent-increase",
411+
"id": "familiar-conspiracy",
420412
"metadata": {},
421413
"outputs": [],
422414
"source": [
@@ -428,7 +420,7 @@
428420
{
429421
"cell_type": "code",
430422
"execution_count": null,
431-
"id": "nearby-advocate",
423+
"id": "medical-philosophy",
432424
"metadata": {},
433425
"outputs": [],
434426
"source": [

0 commit comments

Comments
 (0)