Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/messaging/slim-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SLIM supports JWT (JSON Web Tokens) for identity management. Tokens can come
from an external identity provider or can be generated by the SLIM nodes
directly if you provide the necessary private key for signing the tokens and
public key for verification. Check the [Identity
Test](https://github.com/agntcy/slim/blob/slim-v0.6.0/data-plane/python/bindings/tests/test_identity.py)
Test](https://github.com/agntcy/slim/blob/slim-v0.7.0/data-plane/python/bindings/tests/test_identity.py)
for an example of how to use JWT tokens with SLIM if you have your own keys.

If you are running your SLIM clients in a Kubernetes environment, using
Expand Down Expand Up @@ -41,7 +41,7 @@ This section shows how to use SPIRE with SLIM to manage client identities. The f
If you already have a Kubernetes cluster or an existing SPIRE deployment, you
can adapt only the relevant subsections.

This tutorial is based on the [SLIM examples](https://github.com/agntcy/slim/blob/slim-v0.6.0/data-plane/python/bindings/examples).
This tutorial is based on the [SLIM examples](https://github.com/agntcy/slim/blob/slim-v0.7.0/data-plane/python/bindings/examples).

### Prerequisites

Expand Down
14 changes: 11 additions & 3 deletions docs/messaging/slim-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,16 @@ Example config to enable MTLS on Southbound endpoint using [Spire](https://spiff

logging:
level: DEBUG

reconciler:
threads: 3
# Max number of times a failed reconcile will be retried
maxRequeues: 15
# Max number of reconciles that can be run in parallel for different nodes
maxNumOfParallelReconciles: 1000

# Specifies the SQLite database file path for storing control plane data
database:
filePath: controlplane.db

spire:
enabled: false
Expand Down Expand Up @@ -299,7 +307,7 @@ tls:
key_file: "/path/to/client.key"
```

The `server` endpoint should point to a [SLIM Control](https://github.com/agntcy/slim/tree/slim-v0.6.0/control-plane/control-plane) endpoint which is a central service managing SLIM node configurations.
The `server` endpoint should point to a [SLIM Control](https://github.com/agntcy/slim/tree/slim-v0.7.0/control-plane/control-plane) endpoint which is a central service managing SLIM node configurations.

### Commands

Expand Down Expand Up @@ -370,7 +378,7 @@ slimctl controller route add org/default/alice/0 via connection_config.json
slimctl controller route del org/default/alice/0 via http://localhost:46367
```

For full reference of connection_config.json, see the [client-config-schema.json](https://github.com/agntcy/slim/blob/slim-v0.6.0/data-plane/core/config/src/grpc/schema/client-config.schema.json).
For full reference of connection_config.json, see the [client-config-schema.json](https://github.com/agntcy/slim/blob/slim-v0.7.0/data-plane/core/config/src/grpc/schema/client-config.schema.json).

### Managing SLIM Nodes Directly

Expand Down
303 changes: 171 additions & 132 deletions docs/messaging/slim-group-tutorial.md

Large diffs are not rendered by default.

36 changes: 19 additions & 17 deletions docs/messaging/slim-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ of the application logic) or serve solely as a channel moderator.

This section provides the basic
steps to follow, along with Python code snippets, for setting up a group session.
The full code is available in the [group.py](https://github.com/agntcy/slim/blob/slim-v0.6.0/data-plane/python/bindings/examples/src/slim_bindings_examples/group.py) example in the SLIM repository.
The full code is available in the [group.py](https://github.com/agntcy/slim/blob/slim-v0.7.0/data-plane/python/bindings/examples/src/slim_bindings_examples/group.py) example in the SLIM repository.

### Create the Channel

Expand All @@ -34,31 +34,34 @@ In a group session, communication between participants can be encrypted
end-to-end, enabling MLS.

```python
created_session = await local_app.create_session(
slim_bindings.PySessionConfiguration.Group( # type: ignore # Build group session configuration
channel_name=chat_channel, # Logical group channel (PyName) all participants join; acts as group/topic identifier.
max_retries=5, # Max per-message resend attempts upon missing ack before reporting a delivery failure.
timeout=datetime.timedelta(
seconds=5
), # Ack / delivery wait window; after this duration a retry is triggered (until max_retries).
mls_enabled=enable_mls, # Enable Messaging Layer Security for end-to-end encrypted & authenticated group communication.
)
config = slim_bindings.SessionConfiguration.Group(
max_retries=5, # Max per-message resend attempts upon missing ack before reporting a delivery failure.
timeout=datetime.timedelta(
seconds=5
), # Ack / delivery wait window; after this duration a retry is triggered (until max_retries).
mls_enabled=enable_mls, # Enable Messaging Layer Security for end-to-end encrypted & authenticated group communication.
)

created_session, handle = await local_app.create_session(
chat_channel, # Logical group channel (Name) all participants join; acts as group/topic identifier.
config, # session configuration
)

await handle # await for the session to be created
```

### Invite Participants to the Channel

Once the group session is created, new participants can be invited
to join. Not all participants need to be added at the beginning; you can add them later, even after communication has started.
to join. Not all participants need to be added at the beginning;
you can add them later, even after communication has started.

```python
# Invite each provided participant. Route is set before inviting to ensure
# outbound control messages can reach them. For more info see
# https://github.com/agntcy/slim/blob/slim-v0.6.0/data-plane/python/bindings/SESSION.md#invite-a-new-participant
for invite in invites:
invite_name = split_id(invite)
await local_app.set_route(invite_name)
await created_session.invite(invite_name)
handle = await created_session.invite(invite_name) # invite participant
await handle # awit for the invite to be finished
print(f"{local} -> add {invite_name} to the group")
```

Expand All @@ -81,7 +84,7 @@ while True:
try:
# Await next inbound message from the group session.
# The returned parameters are a message context and the raw payload bytes.
# Check session.py for details on PyMessageContext contents.
# Check session.py for details on MessageContext contents.
ctx, payload = await session.get_message()
print_formatted_text(
f"{ctx.source_name} > {payload.decode()}",
Expand All @@ -103,7 +106,6 @@ Each participant can also send messages at any time to the new session, and each
```python
# Send message to the channel_name specified when creating the session.
# As the session is group, all participants will receive it.
# calling publish_with_destination on a group session will raise an error.
await shared_session_container[0].publish(user_input.encode())
```

Expand Down
12 changes: 6 additions & 6 deletions docs/messaging/slim-howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ helm pull oci://ghcr.io/agntcy/slim/helm/slim --version v0.2.0
```

For information about how to use the Helm chart, see the
[values.yaml](https://github.com/agntcy/slim/blob/slim-v0.6.0/charts/slim/values.yaml)
[values.yaml](https://github.com/agntcy/slim/blob/slim-v0.7.0/charts/slim/values.yaml)

### SLIM Controller

Expand Down Expand Up @@ -142,18 +142,18 @@ pip install slim-bindings
```toml
[project]
...
dependencies = ["slim-bindings>=0.6.0"]
dependencies = ["slim-bindings>=0.7.0"]
```

A tutorial on how to use the bindings in an application can be found in the [messaging layer
documentation](./slim-data-plane.md). Otherwise examples are available in the
[SLIM Repository](https://github.com/agntcy/slim/tree/slim-v0.6.0/data-plane/python/bindings/examples/src/slim_bindings_examples).
[SLIM Repository](https://github.com/agntcy/slim/tree/slim-v0.7.0/data-plane/python/bindings/examples/src/slim_bindings_examples).

### Slimctl

`slimctl` is a command-line tool for managing SLIM Nodes and Controllers. It can
be downloaded from the [releases
page](https://github.com/agntcy/slim/releases/tag/slimctl-v0.6.0) in the SLIM repo.
page](https://github.com/agntcy/slim/releases/tag/slimctl-v0.7.0) in the SLIM repo.

#### Installation

Expand All @@ -162,7 +162,7 @@ Choose the appropriate installation method for your operating system:
=== "macOS (Apple Silicon)"

```bash
curl -LO https://github.com/agntcy/slim/releases/download/slimctl-v0.6.0/slimctl-darwin-arm64
curl -LO https://github.com/agntcy/slim/releases/download/slimctl-v0.7.0/slimctl-darwin-arm64
sudo mv slimctl-darwin-arm64 /usr/local/bin/slimctl
sudo chmod +x /usr/local/bin/slimctl
```
Expand All @@ -179,7 +179,7 @@ Choose the appropriate installation method for your operating system:
=== "Linux (AMD64)"

```bash
curl -LO https://github.com/agntcy/slim/releases/download/slimctl-v0.6.0/slimctl-linux-amd64
curl -LO https://github.com/agntcy/slim/releases/download/slimctl-v0.7.0/slimctl-linux-amd64
sudo mv slimctl-linux-amd64 /usr/local/bin/slimctl
sudo chmod +x /usr/local/bin/slimctl
```
Expand Down
4 changes: 2 additions & 2 deletions docs/messaging/slim-mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ architecture.
In this section of the tutorial, we implement and deploy two sample
applications:

- A [LlamaIndex agent](https://github.com/agntcy/slim/tree/slim-v0.6.0/data-plane/python/integrations/slim-mcp/slim_mcp/examples/llamaindex_time_agent)
- A [LlamaIndex agent](https://github.com/agntcy/slim/tree/slim-v0.7.0/data-plane/python/integrations/slim-mcp/slim_mcp/examples/llamaindex_time_agent)
that communicates with an MCP server over SLIM to perform time queries and timezone conversions.
- An [MCP time
server](https://github.com/agntcy/slim/tree/slim-v0.6.0/data-plane/python/integrations/slim-mcp/slim_mcp/examples/mcp_server_time) that implements SLIM as its transport protocol and processes requests from the LlamaIndex agent.
server](https://github.com/agntcy/slim/tree/slim-v0.7.0/data-plane/python/integrations/slim-mcp/slim_mcp/examples/mcp_server_time) that implements SLIM as its transport protocol and processes requests from the LlamaIndex agent.

### Prerequisites

Expand Down
2 changes: 1 addition & 1 deletion docs/messaging/slim-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ session creation is implemented in inside SLIMRPC in
```python
# Create a session
session = await self.local_app.create_session(
slim_bindings.PySessionConfiguration.FireAndForget(
slim_bindings.SessionConfiguration.FireAndForget(
max_retries=10,
timeout=datetime.timedelta(seconds=1),
sticky=True,
Expand Down
Loading
Loading