unaiverse 0.1.6__cp311-cp311-musllinux_1_2_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 unaiverse might be problematic. Click here for more details.
- unaiverse/__init__.py +19 -0
- unaiverse/agent.py +2008 -0
- unaiverse/agent_basics.py +1846 -0
- unaiverse/clock.py +191 -0
- unaiverse/dataprops.py +1209 -0
- unaiverse/hsm.py +1880 -0
- unaiverse/modules/__init__.py +18 -0
- unaiverse/modules/cnu/__init__.py +17 -0
- unaiverse/modules/cnu/cnus.py +536 -0
- unaiverse/modules/cnu/layers.py +261 -0
- unaiverse/modules/cnu/psi.py +60 -0
- unaiverse/modules/hl/__init__.py +15 -0
- unaiverse/modules/hl/hl_utils.py +411 -0
- unaiverse/modules/networks.py +1509 -0
- unaiverse/modules/utils.py +680 -0
- unaiverse/networking/__init__.py +16 -0
- unaiverse/networking/node/__init__.py +18 -0
- unaiverse/networking/node/connpool.py +1261 -0
- unaiverse/networking/node/node.py +2223 -0
- unaiverse/networking/node/profile.py +446 -0
- unaiverse/networking/node/tokens.py +79 -0
- unaiverse/networking/p2p/__init__.py +198 -0
- unaiverse/networking/p2p/go.mod +127 -0
- unaiverse/networking/p2p/go.sum +548 -0
- unaiverse/networking/p2p/golibp2p.py +18 -0
- unaiverse/networking/p2p/golibp2p.pyi +135 -0
- unaiverse/networking/p2p/lib.go +2714 -0
- unaiverse/networking/p2p/lib.go.sha256 +1 -0
- unaiverse/networking/p2p/lib_types.py +312 -0
- unaiverse/networking/p2p/message_pb2.py +63 -0
- unaiverse/networking/p2p/messages.py +265 -0
- unaiverse/networking/p2p/mylogger.py +77 -0
- unaiverse/networking/p2p/p2p.py +929 -0
- unaiverse/networking/p2p/proto-go/message.pb.go +616 -0
- unaiverse/networking/p2p/unailib.cpython-311-x86_64-linux-musl.so +0 -0
- unaiverse/streamlib/__init__.py +15 -0
- unaiverse/streamlib/streamlib.py +210 -0
- unaiverse/streams.py +770 -0
- unaiverse/utils/__init__.py +16 -0
- unaiverse/utils/ask_lone_wolf.json +27 -0
- unaiverse/utils/lone_wolf.json +19 -0
- unaiverse/utils/misc.py +305 -0
- unaiverse/utils/sandbox.py +293 -0
- unaiverse/utils/server.py +435 -0
- unaiverse/world.py +175 -0
- unaiverse-0.1.6.dist-info/METADATA +365 -0
- unaiverse-0.1.6.dist-info/RECORD +50 -0
- unaiverse-0.1.6.dist-info/WHEEL +5 -0
- unaiverse-0.1.6.dist-info/licenses/LICENSE +43 -0
- unaiverse-0.1.6.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: unaiverse
|
|
3
|
+
Version: 0.1.6
|
|
4
|
+
Summary: UNaIVERSE: A Collectionless AI Project. The new web of humans & AI Agents, built on privacy, control, and reduced energy consumption.
|
|
5
|
+
Author-email: Stefano Melacci <stefano.melacci@unisi.it>, Christian Di Maio <christian.dimaio@phd.unipi.it>, Tommaso Guidi <tommaso.guidi.1998@gmail.com>
|
|
6
|
+
Maintainer-email: Stefano Melacci <stefano.melacci@unisi.it>, Christian Di Maio <christian.dimaio@phd.unipi.it>, Tommaso Guidi <tommaso.guidi.1998@gmail.com>
|
|
7
|
+
Project-URL: A-Homepage, https://unaiverse.io
|
|
8
|
+
Project-URL: B-CollectionlessAI, https://collectionless.ai
|
|
9
|
+
Project-URL: C-Source, https://github.com/collectionlessai/unaiverse-src
|
|
10
|
+
Project-URL: D-Starting, https://github.com/collectionlessai/unaiverse-src/blob/main/README.md
|
|
11
|
+
Project-URL: E-Examples, https://github.com/collectionlessai/unaiverse-examples
|
|
12
|
+
Project-URL: F-Documentation, https://github.com/collectionlessai/unaiverse-src/blob/main/README.md
|
|
13
|
+
Keywords: UNaIVERSE,Collectionless AI,AI,Agentic AI,Agents,Machine Learning,Learning Over Time
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Requires-Python: >3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: opencv-python
|
|
25
|
+
Requires-Dist: Flask
|
|
26
|
+
Requires-Dist: flask_cors
|
|
27
|
+
Requires-Dist: graphviz
|
|
28
|
+
Requires-Dist: ntplib
|
|
29
|
+
Requires-Dist: numpy
|
|
30
|
+
Requires-Dist: Pillow
|
|
31
|
+
Requires-Dist: protobuf
|
|
32
|
+
Requires-Dist: psutil
|
|
33
|
+
Requires-Dist: PyJWT
|
|
34
|
+
Requires-Dist: cryptography
|
|
35
|
+
Requires-Dist: Requests
|
|
36
|
+
Requires-Dist: torch
|
|
37
|
+
Requires-Dist: torchvision
|
|
38
|
+
Requires-Dist: transformers
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
<div align="center">
|
|
42
|
+
<h1 style="text-align: center;">Welcome to UNaIVERSE ~ https://unaiverse.io</h1>
|
|
43
|
+
<img src="./assets/caicat_planets.png" alt="UNaIVERSE Logo" style="width:450px;">
|
|
44
|
+
</div>
|
|
45
|
+
<br>
|
|
46
|
+
|
|
47
|
+
<p align="center">
|
|
48
|
+
<em>Welcome to a new "UN(a)IVERSE," where humans and artificial agents coexist, interact, learn from each other, grow together, in a privacy and low-energy oriented reality.</em>
|
|
49
|
+
</p>
|
|
50
|
+
<br>
|
|
51
|
+
|
|
52
|
+
UNaIVERSE is a project framed in the context of [Collectionless AI](https://collectionless.ai), our perspective on Artificial Intelligence rooted in **privacy**, **low energy consumption**, and, more importantly, a **decentralized** model.
|
|
53
|
+
|
|
54
|
+
UN(a)IVERSE is a **peer-to-peer network**, aiming to become the new incarnation of the Web, combining (in the long run) the principles of Social Networks and AI under a **privacy** lens—a perspective that is crucial given how the Web, especially Social Networks, and AI are used today by both businesses and individual users.
|
|
55
|
+
|
|
56
|
+
- Enter UNaIVERSE: [**UNaIVERSE portal (login/register)**](https://unaiverse.io)
|
|
57
|
+
- Check our presentation of Collectionless AI & UNaIVERSE, to explore [**UNaIVERSE features**](./UNaIVERSE.pdf)
|
|
58
|
+
- Read more on our ideas: [**Collectionless AI website**](https://collectionless.ai)
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 🚀 Features
|
|
63
|
+
|
|
64
|
+
Check our presentation, starting from Collectionless AI and ending up in [**UNaIVERSE and its features**](./UNaIVERSE.pdf).
|
|
65
|
+
|
|
66
|
+
UNaIVERSE is a peer-to-peer network where each node is either a **world** or an **agent**. What can you do?
|
|
67
|
+
- You can create your own **agents**, based on [PyTorch modules](https://pytorch.org/), and, in function of their capabilities, they are ready to join the existing worlds and interact with others. Feel free to join a world, stay there for a while, leave it and join another one! They can also just showcase your technology, hence not join any worlds, becoming what we call **lone wolves**.
|
|
68
|
+
- You can create your own **worlds** as well. Different worlds are about different topics, tasks, whatever (think about a school, a shop, a chat room, an industrial plant, ...), and you don't have to write any code to let your agent participate in a world! It is the world designer that defines the expected **roles** and corresponding agent **behaviors** (special State Machines): join a world, get a role, and you are ready to behave coherently with your role!
|
|
69
|
+
- In UNaIVERSE, you, as **human**, are an agent as the other ones. The browser is your interface to UNaIVERSE, and you are already set up! No need to install anything, just jump into the UNaIVERSE portal, login, and you are a citizen of UNaIVERSE.
|
|
70
|
+
|
|
71
|
+
Remarks:
|
|
72
|
+
- *Are you a researcher?* This is perfect to study models that learn over time (Lifelong/Continual Learning), and social dynamics of different categories of models! Feel free to propose novel ideas to exploit UNaIVERSE in your research!
|
|
73
|
+
- *Are you in the industry or, more generally, business oriented?* **Think about privacy-oriented solutions that we can build over this new UN(a)IVERSE!**
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## ⚡ Status
|
|
78
|
+
|
|
79
|
+
- Very first version: we think it will always stay alpha/beta/whatever 😎, but right now there are many features we plan to add and several parts to improve, **thanks to your feedback!**
|
|
80
|
+
- Missing features (work-in-progress): browser-to-browser communication; agents running on mobile; actual social network features (right now it is very preliminary, not really showcasing where we want to go)
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 📦 Installation
|
|
85
|
+
|
|
86
|
+
Jump to [https://unaiverse.io](https://unaiverse.io), create a new account (free!) or log in with an existing one. If you did not already do it, click on the top-right icon with "a person" on it:
|
|
87
|
+
|
|
88
|
+
<img src="./assets/top_right_icons.png" alt="UNaIVERSE Logo" style="width:80px;">
|
|
89
|
+
|
|
90
|
+
Then click on "Generate a Token":
|
|
91
|
+
|
|
92
|
+
<img src="./assets/generate_token.png" alt="UNaIVERSE Logo" style="width:320px;">
|
|
93
|
+
|
|
94
|
+
**COPY THE TOKEN**, you won't be able to see it twice! Now, let's focus on Python:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip install unaiverse
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
That's it. Of course, if you want to dive into details, you find the source code here in this repo.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 🛠 Mini Tutorial
|
|
105
|
+
|
|
106
|
+
The simplest usage you can think of is the one which does not exploit the real features of UNaIVERSE, but it is so simple that is a good way to put you in touch with UNaIVERSE itself.
|
|
107
|
+
|
|
108
|
+
You can **showcase** your PyTorch networks (actually, it can be every kind of model son of the PyTorch [*torch.nn.Module*](https://docs.pytorch.org/docs/stable/generated/torch.nn.Module.html) class) as follows. Let's focus on ResNet for simplicity.
|
|
109
|
+
|
|
110
|
+
Alright, let's discuss the code in the [assets/tutorial](./assets/tutorial) folder of this repo, composed of numbered scripts.
|
|
111
|
+
|
|
112
|
+
### Step A1. Do you know how to set up a network in PyTorch?
|
|
113
|
+
|
|
114
|
+
Let us set up a ResNet50 in the most basic PyTorch manner. The code is composed of a **generator of tensors** interpreted as pictures (actually, an ugly tensor with randomly colored pixels) and a pretrained **resnet classifier** which classifies the pictures generating a probability distribution over 1,000 classes. Try to run [script 1](./assets/tutorial/A_move_to_unaiverse/1_generator_and_resnet.py) from the [assets/tutorial](./assets/tutorial) folder. We report it here, carefully read the comments!
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
import torch
|
|
118
|
+
import torchvision
|
|
119
|
+
|
|
120
|
+
# Downloading PyTorch module (ResNet)
|
|
121
|
+
net = torchvision.models.resnet50(weights="IMAGENET1K_V1").eval()
|
|
122
|
+
|
|
123
|
+
# Generating a random image (don't care about it, it is just a toy example,
|
|
124
|
+
# think it is a nice image!)
|
|
125
|
+
inp = torch.rand((1, 3, 224, 224), dtype=torch.float32)
|
|
126
|
+
|
|
127
|
+
# Inference: expects as input a tensor of type torch.float32, custom width and
|
|
128
|
+
# height, but 3 channels and batch dimension must be there; the output is a
|
|
129
|
+
# tensor with shape (1, 1000), i.e., a tensor in which batch dimension is
|
|
130
|
+
# present and then 1000 elements.
|
|
131
|
+
out = net(inp)
|
|
132
|
+
|
|
133
|
+
# Print shapes
|
|
134
|
+
print(f"Input shape: {tuple(inp.shape)}, dtype: {inp.dtype}")
|
|
135
|
+
print(f"Output shape: {tuple(out.shape)}, dtype: {out.dtype}")
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Step A2. Let's create UNaIVERSE agents!
|
|
139
|
+
|
|
140
|
+
We are going to create two agents, **independently running and possibly located in different places/machines**.
|
|
141
|
+
- One is based on the **resnet classifier**, waiting to be asked (by some other agents) for a prediction about a given image.
|
|
142
|
+
- The other is the **generator of tensors**, ready to generate a tensor (representation of a picture) and ask another agent to classify it.
|
|
143
|
+
|
|
144
|
+
Here is the **resnet classifier** agent, running forever and waiting for somebody to ask for a prediction, taken from [script 2](./assets/tutorial/A_move_to_unaiverse/2_agent_resnet.py) in the [assets/tutorial](./assets/tutorial) folder:
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
import torch
|
|
148
|
+
import torchvision
|
|
149
|
+
from unaiverse.agent import Agent
|
|
150
|
+
from unaiverse.dataprops import Data4Proc
|
|
151
|
+
from unaiverse.networking.node.node import Node
|
|
152
|
+
|
|
153
|
+
# Downloading PyTorch module (ResNet)
|
|
154
|
+
net = torchvision.models.resnet50(weights="IMAGENET1K_V1").eval()
|
|
155
|
+
|
|
156
|
+
# Agent: we pass the network as "processor".
|
|
157
|
+
# Check the input and output properties of the processor, they are coherent with the
|
|
158
|
+
# input and output shapes of ResNet; here "None" means "whatever, but this axis must be
|
|
159
|
+
# there!". By default, this agent will act as a serving "lone wolf", serving whoever asks for
|
|
160
|
+
# a prediction.
|
|
161
|
+
agent = Agent(proc=net,
|
|
162
|
+
proc_inputs=[Data4Proc(data_type="tensor", tensor_shape=(None, 3, None, None),
|
|
163
|
+
tensor_dtype=torch.float32)],
|
|
164
|
+
proc_outputs=[Data4Proc(data_type="tensor", tensor_shape=(None, 1000),
|
|
165
|
+
tensor_dtype=torch.float32)])
|
|
166
|
+
|
|
167
|
+
# Node hosting agent: a node will be created in your account with this name, if not
|
|
168
|
+
# existing; it is "hidden" meaning that only you can see it in UNaIVERSE (since it is
|
|
169
|
+
# just a test!); the clock speed can be tuned accordingly to your needed and computing
|
|
170
|
+
# power.
|
|
171
|
+
node = Node(node_name="Test0", hosted=agent, hidden=True, clock_delta=1. / 30.)
|
|
172
|
+
|
|
173
|
+
# Running node (forever)
|
|
174
|
+
node.run()
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Run it. Now, here is the agent capable of **generating tensors** (let's say images), which is asked to get in touch with the resnet agent, taken from [script 3](./assets/tutorial/A_move_to_unaiverse/3_agent_generator.py) in the [assets/tutorial](./assets/tutorial) folder:
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
import torch
|
|
181
|
+
from unaiverse.agent import Agent
|
|
182
|
+
from unaiverse.dataprops import Data4Proc
|
|
183
|
+
from unaiverse.networking.node.node import Node
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
# Custom generator network: a module that simpy generates an image with
|
|
187
|
+
# "random" pixel intensities; we will use this as processor of our new agent.
|
|
188
|
+
class Net(torch.nn.Module):
|
|
189
|
+
def __init__(self):
|
|
190
|
+
super().__init__()
|
|
191
|
+
|
|
192
|
+
# The input will be ignored, and a default None value is needed
|
|
193
|
+
def forward(self, x: torch.Tensor | None = None):
|
|
194
|
+
inp = torch.rand((1, 3, 224, 224), dtype=torch.float32)
|
|
195
|
+
print(f"Generated data shape: {tuple(inp.shape)}, dtype: {inp.dtype}")
|
|
196
|
+
return inp
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
# Agent: we use the generator as processor.
|
|
200
|
+
# This agent will still be a "lone wolf", but we will force a different behavior, that is
|
|
201
|
+
# the one of "asking" another agent to handle the generated data, getting back a response.
|
|
202
|
+
agent = Agent(proc=Net(),
|
|
203
|
+
proc_inputs=[Data4Proc(data_type="all")], # Able to get every type of data (since it won't use it :))
|
|
204
|
+
proc_outputs=[Data4Proc(data_type="tensor", tensor_shape=(1, 3, 224, 224),
|
|
205
|
+
tensor_dtype="torch.float32")], # These are the properties of generator output
|
|
206
|
+
behav_lone_wolf="ask") # Setting this behavior: "ask the partner to respond to your generated data"
|
|
207
|
+
|
|
208
|
+
# Node hosting agent
|
|
209
|
+
node = Node(node_name="Test1", hosted=agent, hidden=True, clock_delta=1. / 30.)
|
|
210
|
+
|
|
211
|
+
# Telling this agent to connect to the ResNet one
|
|
212
|
+
node.ask_to_get_in_touch(node_name="Test0")
|
|
213
|
+
|
|
214
|
+
# Running node for 10 seconds
|
|
215
|
+
node.run(max_time=10.0)
|
|
216
|
+
|
|
217
|
+
# Printing the last received data from the ResNet agent
|
|
218
|
+
out = agent.get_last_streamed_data('Test0')[0]
|
|
219
|
+
print(f"Received data shape: {tuple(out.shape)}, dtype: {out.dtype}")
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Run this script as well, and what will happen is that the generator will send its picture through the peer-to-peer network, reaching the resnet agent, and getting back a prediction.
|
|
223
|
+
|
|
224
|
+
### Step B1. Embellishment
|
|
225
|
+
|
|
226
|
+
We can upgrade the **resnet agent** to take real-world images as input, instead of random tensors, and to output class names (text) instead of a probability distribution. All we need to do is to re-define the properties of the inputs/outputs of the agent processor, and add transformations. Dive into [script 4](./assets/tutorial/B_improve_A_and_use_browser/4_agent_resnet_img_text.py):
|
|
227
|
+
|
|
228
|
+
```python
|
|
229
|
+
import torchvision
|
|
230
|
+
import urllib.request
|
|
231
|
+
from unaiverse.agent import Agent
|
|
232
|
+
from unaiverse.dataprops import Data4Proc
|
|
233
|
+
from unaiverse.networking.node.node import Node
|
|
234
|
+
|
|
235
|
+
# Downloading PyTorch module (ResNet)
|
|
236
|
+
net = torchvision.models.resnet50(weights="IMAGENET1K_V1").eval()
|
|
237
|
+
|
|
238
|
+
# Getting input transforms from PyTorch model
|
|
239
|
+
transforms = torchvision.transforms.Compose([
|
|
240
|
+
torchvision.transforms.Lambda(lambda x: x.convert("RGB")),
|
|
241
|
+
torchvision.models.ResNet50_Weights.IMAGENET1K_V1.transforms(),
|
|
242
|
+
torchvision.transforms.Lambda(lambda x: x.unsqueeze(0))
|
|
243
|
+
])
|
|
244
|
+
|
|
245
|
+
# Getting output class names
|
|
246
|
+
with urllib.request.urlopen("https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt") as f:
|
|
247
|
+
c_names = [line.strip().decode('utf-8') for line in f.readlines()]
|
|
248
|
+
|
|
249
|
+
# Agent: we change the data type, to be able to handle stream of images (instead of tensors).
|
|
250
|
+
# We can customize the transformations from the streamed format to the processor inference
|
|
251
|
+
# format (every callable function is fine!). Similarly, we can customize the way we go from
|
|
252
|
+
# the actual output of the processor and what will be streamed (here we go from class
|
|
253
|
+
# probabilities to winning class name).
|
|
254
|
+
agent = Agent(proc=net,
|
|
255
|
+
proc_inputs=[Data4Proc(data_type="img", stream_to_proc_transforms=transforms)],
|
|
256
|
+
proc_outputs=[Data4Proc(data_type="text", proc_to_stream_transforms=lambda p: c_names[p.argmax(1)[0]])])
|
|
257
|
+
|
|
258
|
+
# Node hosting agent
|
|
259
|
+
node = Node(node_name="Test0", hosted=agent, hidden=True, clock_delta=1. / 30.)
|
|
260
|
+
|
|
261
|
+
# Running node
|
|
262
|
+
node.run()
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Now let us promote the **generator** to an agent that downloads and offers a picture of a cat and expects to get back a text description of it (the class name in this case - this is [script 5](./assets/tutorial/B_improve_A_and_use_browser/5_agent_generator_img.py)):
|
|
266
|
+
|
|
267
|
+
```python
|
|
268
|
+
import torch
|
|
269
|
+
import urllib.request
|
|
270
|
+
from PIL import Image
|
|
271
|
+
from io import BytesIO
|
|
272
|
+
from unaiverse.agent import Agent
|
|
273
|
+
from unaiverse.dataprops import Data4Proc
|
|
274
|
+
from unaiverse.networking.node.node import Node
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
# Image offering network: a module that simpy downloads and offers an image as its output
|
|
278
|
+
class Net(torch.nn.Module):
|
|
279
|
+
def __init__(self):
|
|
280
|
+
super().__init__()
|
|
281
|
+
|
|
282
|
+
def forward(self, x: torch.Tensor | None = None):
|
|
283
|
+
with urllib.request.urlopen("https://cataas.com/cat") as response:
|
|
284
|
+
inp = Image.open(BytesIO(response.read()))
|
|
285
|
+
inp.show() # Let's see the pic (watch out: random pic with a cat somewhere)
|
|
286
|
+
print(f"Downloaded image shape {inp.size}, type: {type(inp)}, expected-content: cat")
|
|
287
|
+
return inp
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
# Agent
|
|
291
|
+
agent = Agent(proc=Net(),
|
|
292
|
+
proc_inputs=[Data4Proc(data_type="all")],
|
|
293
|
+
proc_outputs=[Data4Proc(data_type="img")], # A PIL image is being "generated" here
|
|
294
|
+
behav_lone_wolf="ask")
|
|
295
|
+
|
|
296
|
+
# Node hosting agent
|
|
297
|
+
node = Node(node_name="Test1", hosted=agent, hidden=True, clock_delta=1. / 30.)
|
|
298
|
+
|
|
299
|
+
# Telling this agent to connect to the ResNet one
|
|
300
|
+
node.ask_to_get_in_touch(node_name="Test0")
|
|
301
|
+
|
|
302
|
+
# Running node for 10 seconds
|
|
303
|
+
node.run(max_time=10.0)
|
|
304
|
+
|
|
305
|
+
# Printing the last received data from the ResNet agent
|
|
306
|
+
out = agent.get_last_streamed_data('ResNetAgent')[0]
|
|
307
|
+
print(f"Received response: {out}") # Now we expect a textual response
|
|
308
|
+
print("")
|
|
309
|
+
print(f"Notice: instead of using this agent, you can also: search for the ResNet node (ResNetAgent) "
|
|
310
|
+
f"in the UNaIVERSE portal, connect to it using our in-browser agent, select a picture from "
|
|
311
|
+
f"your disk, send it to the agent, get back the text response!")
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Step B2. Connect to your ResNet agent by means of a browser running agent!
|
|
315
|
+
|
|
316
|
+
Instead of using the artificial generator agent, **you can become the generator agent**!
|
|
317
|
+
Search for the ResNet node (ResNetAgent) in the UNaIVERSE portal, connect to it using the in-browser agent, select a picture from your disk, send it to the agent, get back the text response!
|
|
318
|
+
|
|
319
|
+
### Step C. Unleash UNaIVERSE!
|
|
320
|
+
|
|
321
|
+
What you did so far is just to showcase your model. UNaIVERSE is composed of several **worlds** that you can create and customize. Your agent can enter one world at a time, stay there, leave it, enter another, and so on.
|
|
322
|
+
Agents will behave according to what the world indicates, and you don't have to write any extra code to act in worlds you have never been into!
|
|
323
|
+
|
|
324
|
+
Alright, there are so many things to say, but examples are always a good thing!
|
|
325
|
+
We prepared a repository with examples of many worlds and different lone wolves, go there in order to continue your journey into UNaIVERSE!
|
|
326
|
+
|
|
327
|
+
*THE TUTORIAL CONTINUES:* [https://github.com/collectionlessai/unaiverse-examples](https://github.com/collectionlessai/unaiverse-examples)
|
|
328
|
+
|
|
329
|
+
**See you in our UNaIVERSE!**
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## 📄 License
|
|
334
|
+
|
|
335
|
+
This project is licensed under the Polyform Strict License 1.0.0.
|
|
336
|
+
Commercial licenses can be provided.
|
|
337
|
+
See the [LICENSE](./LICENSE) file for details (research, etc.).
|
|
338
|
+
|
|
339
|
+
This project includes third-party libraries. See [THIRD_PARTY_LICENSES.md](./THIRD_PARTY_LICENSES.md) for details.
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## 📚 Documentation
|
|
344
|
+
|
|
345
|
+
You can find an API reference in file [docs.html](./docs.html), that you can visualize here:
|
|
346
|
+
- [API Reference](https://collectionlessai.github.io/unaiverse-docs.github.io/)
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## 🤝 Contributing
|
|
351
|
+
|
|
352
|
+
Contributions are welcome!
|
|
353
|
+
|
|
354
|
+
Please contact us in order to suggest changes, report bugs, and suggest ideas for novel applications based on UNaIVERSE!
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## 👨💻 Main Authors
|
|
359
|
+
|
|
360
|
+
- Stefano Melacci (Project Leader) [stefano.melacci@unisi.it](stefano.melacci@unisi.it)
|
|
361
|
+
- Christian Di Maio [christian.dimaio@phd.unipi.it](christian.dimaio@phd.unipi.it)
|
|
362
|
+
- Tommaso Guidi [tommaso.guidi.1998@gmail.com](tommaso.guidi.1998@gmail.com)
|
|
363
|
+
- Marco Gori (Scientific Advisor) [marco.gori@unisi.it](marco.gori@unisi.it)
|
|
364
|
+
|
|
365
|
+
---
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
unaiverse/__init__.py,sha256=YYNWMcC8LVmLLVaHYQLTc_BDhEOq3OKeIsvsX4MloSQ,2515
|
|
2
|
+
unaiverse/agent.py,sha256=ZB0DA6W6jA6untt0uEdg8evRuygDLGJMdBv31AkZlW0,101782
|
|
3
|
+
unaiverse/agent_basics.py,sha256=3vm51MEErqcNbK_gayF-icRt965MBXviL3vd0IH8Tww,93618
|
|
4
|
+
unaiverse/clock.py,sha256=9KEy8I4PPF0JYT7fnrnn3nVssZXh0QXJJ-hJqNV2Kv0,9434
|
|
5
|
+
unaiverse/dataprops.py,sha256=SYO9tcNu-hXxIaOijiByr2D2ol-NbcMsQ7c6IW-l6oQ,54737
|
|
6
|
+
unaiverse/hsm.py,sha256=IlLcGrKv-_pHd4GKycoA4HA1Mebu-yxvZjggiocHVJ0,87692
|
|
7
|
+
unaiverse/streams.py,sha256=LtfazcfRdBhF2grLQbeZToYF4_B_-3MsBse6F2OolF4,30729
|
|
8
|
+
unaiverse/world.py,sha256=nqoR2mOMZppM3D7VdhRd7DpiORnVGshAJ0irL18ccpk,9992
|
|
9
|
+
unaiverse/modules/__init__.py,sha256=dqddn8Z5cggyU3ZaIC4cZk69Y0Xe7AquEGa9UFOfiKk,2501
|
|
10
|
+
unaiverse/modules/networks.py,sha256=vZdRlA9e31alcM5Tn9pc9v1CtDeKOpaCaVeOUBwEUVA,65944
|
|
11
|
+
unaiverse/modules/utils.py,sha256=R0iWOni5ShWK5FGdAqH-B6CDZ6scH1z0niAUdehBMBE,31611
|
|
12
|
+
unaiverse/modules/cnu/__init__.py,sha256=qOHbNfhk_aJsoCPecPSo5QoWHVEbwaGsyQxXDt2wGho,2481
|
|
13
|
+
unaiverse/modules/cnu/cnus.py,sha256=HjWgeYWCLMowbyRMEPywzewjBEx3OPrThmJQjZkElQA,27614
|
|
14
|
+
unaiverse/modules/cnu/layers.py,sha256=KnZa5_GvAZhCgfB_FpbFj4Ps82mZ1uE_nuKvOIP83gk,13221
|
|
15
|
+
unaiverse/modules/cnu/psi.py,sha256=Kp4sWFtY6howuOdIGWZf0GSyrcr0fQzu3_Jpug7-9ro,3890
|
|
16
|
+
unaiverse/modules/hl/__init__.py,sha256=zG1j2LCuLKOAdOc5csSs52yLSyjHllF96z0hPn-pY1o,2446
|
|
17
|
+
unaiverse/modules/hl/hl_utils.py,sha256=Xt2eWuwak6kDtTy2hQ1Ps8_M_REtte9HA-PzfCovlA8,18292
|
|
18
|
+
unaiverse/networking/__init__.py,sha256=qc3A8KJpTLFM6hefwmqj-wAaUULtzXivaXsr-xKKYGU,2460
|
|
19
|
+
unaiverse/networking/node/__init__.py,sha256=DEXbZzPt7dgall1TZKODuQIXhjq3lr39QCBISGUSWww,2508
|
|
20
|
+
unaiverse/networking/node/connpool.py,sha256=WKH_-Kfk3rB8_THR0ZH1AYrCIfsEpiwg-4N-TpZb29E,52669
|
|
21
|
+
unaiverse/networking/node/node.py,sha256=oCE1TPz27rpw1H9EV7060l6ulVyTKEp5VSxVBsSLOvQ,118841
|
|
22
|
+
unaiverse/networking/node/profile.py,sha256=lbB35MoI20oDxDqb97zH2NNNUCGJs8-8KIGNjjmnTio,20203
|
|
23
|
+
unaiverse/networking/node/tokens.py,sha256=UHyPnl6TDvPitrkP2AYAIegSWq4CpvsjRvmio3T-3nA,5281
|
|
24
|
+
unaiverse/networking/p2p/__init__.py,sha256=QrtiXjeZf8EjTJ8YHhOZMPvDhv2uhXglskSQBo8X_vM,10035
|
|
25
|
+
unaiverse/networking/p2p/go.mod,sha256=ollB3OBhk2ZDAWMEKbV3qcom28paw_I0zXpUlfh8yPg,5867
|
|
26
|
+
unaiverse/networking/p2p/go.sum,sha256=CB9nVc8EeN6-zCBVfPAm5sU4FsoTsYGJ355ed1af0Ro,52011
|
|
27
|
+
unaiverse/networking/p2p/golibp2p.py,sha256=ibVCLERzM2JgPP_A5FTooCoxYW5Zm2HBbzX28aQIFzo,2450
|
|
28
|
+
unaiverse/networking/p2p/golibp2p.pyi,sha256=PcqlPw_6yaRU4Kq7L5dhZXY2Pj33ZP_lztCqATIDu-A,4265
|
|
29
|
+
unaiverse/networking/p2p/lib.go,sha256=lxXaB3cOOXRvWInMJe8wi63ZpI6CzVsVy5jK0kIT2ok,119150
|
|
30
|
+
unaiverse/networking/p2p/lib.go.sha256,sha256=YxphbETlxobpGpadhgExKjKki8ejpkZqNxozCS-qne4,64
|
|
31
|
+
unaiverse/networking/p2p/lib_types.py,sha256=b7NJmN636o-X3TEWdp4YVIJ9Snr8AGT0GUuaYITZ6PY,13956
|
|
32
|
+
unaiverse/networking/p2p/message_pb2.py,sha256=-kEXvIYJZqGOh47i5e7qYHZdsKJ5uQtfDVQrnrAewCg,5697
|
|
33
|
+
unaiverse/networking/p2p/messages.py,sha256=6fN-3INvnUoWu_YwQPfx4WRx8DD7LEOu511nRWKI-fM,12287
|
|
34
|
+
unaiverse/networking/p2p/mylogger.py,sha256=-WW6qT39rptXwUlpQg1BuU7u8o9MKLF_-Cbe7EaQKsc,4773
|
|
35
|
+
unaiverse/networking/p2p/p2p.py,sha256=4w1blNOamgyALjQepef1vaQc1Sd8bBv2kcsJeVTtHiM,45789
|
|
36
|
+
unaiverse/networking/p2p/unailib.cpython-311-x86_64-linux-musl.so,sha256=mRT0U_E3V7O7gqBnaNFILepcEbAArQHDa1k71yJdORg,29779632
|
|
37
|
+
unaiverse/networking/p2p/proto-go/message.pb.go,sha256=-ODwU2dki228W4Nlt4vPeVI3hJD_3jrc93ibhGWTCzc,17312
|
|
38
|
+
unaiverse/streamlib/__init__.py,sha256=VpsL7-gwML7nbrMQumtEDpuEH4g7iNqQaCzd-zX49cQ,2447
|
|
39
|
+
unaiverse/streamlib/streamlib.py,sha256=yz6G8eez3VnF_fvA9G3KS-WCoLvPYlk0IdqdB9dDzOI,10366
|
|
40
|
+
unaiverse/utils/__init__.py,sha256=_iomQ_GviAS5c4ZVBrm1h_rLYWH-f-T9SI-b0697gn0,2464
|
|
41
|
+
unaiverse/utils/ask_lone_wolf.json,sha256=e7zwGQQh9kd8GH-gcQLpfwR4UpCKIP3d7efhmPL8DOo,806
|
|
42
|
+
unaiverse/utils/lone_wolf.json,sha256=_rHfeqV8gqvPc0h-cZF7mPCG0Z4HuVkV-mKoXXwjbNc,440
|
|
43
|
+
unaiverse/utils/misc.py,sha256=4J3HotzosgsnEr9MgeuQmdrrISPuKl85oOAuKAfcz-U,12085
|
|
44
|
+
unaiverse/utils/sandbox.py,sha256=S_eocNIGTyckovYMxmWb56wsCG7M-mxmGHqdLavSWQA,14436
|
|
45
|
+
unaiverse/utils/server.py,sha256=hCxHTNmYGrgGYrwZ5RaQ9kdmmfqWuIVTUdPYLCwpTQU,21974
|
|
46
|
+
unaiverse-0.1.6.dist-info/METADATA,sha256=Fnp_uW7PGUgqfQGo5MQ9EFNHpkMr3CmDWo3stt0dajU,18268
|
|
47
|
+
unaiverse-0.1.6.dist-info/WHEEL,sha256=kA_iIvT-cxTFNl4I8QDfFHN1DAyqZDYakVXCaObxeLo,112
|
|
48
|
+
unaiverse-0.1.6.dist-info/top_level.txt,sha256=0rP09tH9hv17TDQs66OHbJaRSnADpZsDsODy6JVsTtw,10
|
|
49
|
+
unaiverse-0.1.6.dist-info/RECORD,,
|
|
50
|
+
unaiverse-0.1.6.dist-info/licenses/LICENSE,sha256=02v7juVPTazXHV7TG9WtaWrtmeC3BAd49itKH_SiHOs,1396
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
=======
|
|
2
|
+
LICENSE
|
|
3
|
+
=======
|
|
4
|
+
|
|
5
|
+
This software is licensed under the Polyform Strict License 1.0.0.
|
|
6
|
+
Full license text: https://polyformproject.org/licenses/strict/1.0.0/
|
|
7
|
+
|
|
8
|
+
------------------
|
|
9
|
+
Non-Commercial Use
|
|
10
|
+
------------------
|
|
11
|
+
|
|
12
|
+
You may use, copy, and run this software for non-commercial purposes, as
|
|
13
|
+
defined in the Polyform Strict License. This includes use in academic and
|
|
14
|
+
scientific research.
|
|
15
|
+
|
|
16
|
+
You may also create and publish your own software that depends on or
|
|
17
|
+
interfaces with this project (for example, through imports, APIs, or
|
|
18
|
+
integration), provided that:
|
|
19
|
+
|
|
20
|
+
- Your software is used only for non-commercial purposes, and
|
|
21
|
+
- You do not modify or redistribute this software’s source code.
|
|
22
|
+
- You do not alter the hardcoded network communications of this software.
|
|
23
|
+
|
|
24
|
+
You can edit the examples as you prefer.
|
|
25
|
+
|
|
26
|
+
If you find bugs, have suggestions for improvements, or wish to propose
|
|
27
|
+
changes, you are welcome to share them (for example, by opening an issue or
|
|
28
|
+
contacting us).
|
|
29
|
+
|
|
30
|
+
Direct modification and redistribution of the source code of this software,
|
|
31
|
+
however, is not permitted.
|
|
32
|
+
|
|
33
|
+
--------------
|
|
34
|
+
Commercial Use
|
|
35
|
+
--------------
|
|
36
|
+
|
|
37
|
+
Commercial use of this software, or of any software that depends on it, is not
|
|
38
|
+
permitted under the Polyform Strict License.
|
|
39
|
+
|
|
40
|
+
If you would like to obtain a commercial license, please contact:
|
|
41
|
+
|
|
42
|
+
Stefano Melacci, Christian Di Maio, Tommaso Guidi, Marco Gori
|
|
43
|
+
contact@unaiverse.io
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
unaiverse
|