swarmauri_tool_jupytergetshellmessage 0.9.0.dev4__tar.gz → 0.9.2.dev6__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.
- swarmauri_tool_jupytergetshellmessage-0.9.2.dev6/PKG-INFO +97 -0
- swarmauri_tool_jupytergetshellmessage-0.9.2.dev6/README.md +70 -0
- {swarmauri_tool_jupytergetshellmessage-0.9.0.dev4 → swarmauri_tool_jupytergetshellmessage-0.9.2.dev6}/pyproject.toml +22 -1
- swarmauri_tool_jupytergetshellmessage-0.9.0.dev4/PKG-INFO +0 -107
- swarmauri_tool_jupytergetshellmessage-0.9.0.dev4/README.md +0 -86
- {swarmauri_tool_jupytergetshellmessage-0.9.0.dev4 → swarmauri_tool_jupytergetshellmessage-0.9.2.dev6}/LICENSE +0 -0
- {swarmauri_tool_jupytergetshellmessage-0.9.0.dev4 → swarmauri_tool_jupytergetshellmessage-0.9.2.dev6}/swarmauri_tool_jupytergetshellmessage/JupyterGetShellMessageTool.py +0 -0
- {swarmauri_tool_jupytergetshellmessage-0.9.0.dev4 → swarmauri_tool_jupytergetshellmessage-0.9.2.dev6}/swarmauri_tool_jupytergetshellmessage/__init__.py +0 -0
- {swarmauri_tool_jupytergetshellmessage-0.9.0.dev4 → swarmauri_tool_jupytergetshellmessage-0.9.2.dev6}/swarmauri_tool_jupytergetshellmessage/install_kernel.py +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: swarmauri_tool_jupytergetshellmessage
|
|
3
|
+
Version: 0.9.2.dev6
|
|
4
|
+
Summary: A tool designed to retrieve shell messages from a running Jupyter kernel using jupyter_client, useful for debugging execution responses.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: swarmauri,tool,jupytergetshellmessage,designed,retrieve,shell,messages,running,jupyter,kernel,client,useful,debugging,execution,responses
|
|
8
|
+
Author: Jacob Stewart
|
|
9
|
+
Author-email: jacob@swarmauri.com
|
|
10
|
+
Requires-Python: >=3.10,<3.13
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Natural Language :: English
|
|
17
|
+
Classifier: Development Status :: 3 - Alpha
|
|
18
|
+
Classifier: Intended Audience :: Developers
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
20
|
+
Requires-Dist: ipykernel (>=6.29.5)
|
|
21
|
+
Requires-Dist: jupyter_client (>=8.6.3)
|
|
22
|
+
Requires-Dist: swarmauri_base
|
|
23
|
+
Requires-Dist: swarmauri_core
|
|
24
|
+
Requires-Dist: swarmauri_standard
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
<p align="center">
|
|
30
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
31
|
+
<img src="https://img.shields.io/pypi/dm/swarmauri_tool_jupytergetshellmessage" alt="PyPI - Downloads"/></a>
|
|
32
|
+
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupytergetshellmessage/">
|
|
33
|
+
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupytergetshellmessage.svg"/></a>
|
|
34
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
35
|
+
<img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_jupytergetshellmessage" alt="PyPI - Python Version"/></a>
|
|
36
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
37
|
+
<img src="https://img.shields.io/pypi/l/swarmauri_tool_jupytergetshellmessage" alt="PyPI - License"/></a>
|
|
38
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
39
|
+
<img src="https://img.shields.io/pypi/v/swarmauri_tool_jupytergetshellmessage?label=swarmauri_tool_jupytergetshellmessage&color=green" alt="PyPI - swarmauri_tool_jupytergetshellmessage"/></a>
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
# Swarmauri Tool Jupyter Get Shell Message
|
|
45
|
+
|
|
46
|
+
Retrieves shell-channel messages from a running Jupyter kernel using `jupyter_client`.
|
|
47
|
+
|
|
48
|
+
## Features
|
|
49
|
+
|
|
50
|
+
- Listens on the Jupyter kernel shell channel and captures raw message dicts.
|
|
51
|
+
- Returns a dict containing `messages` or an `error` key.
|
|
52
|
+
- Helpful for debugging live kernel communication during automated notebook workflows.
|
|
53
|
+
|
|
54
|
+
## Prerequisites
|
|
55
|
+
|
|
56
|
+
- Python 3.10 or newer.
|
|
57
|
+
- Access to a running Jupyter kernel (Notebook server, JupyterLab, etc.).
|
|
58
|
+
- `jupyter_client` and `websocket-client` (installed automatically).
|
|
59
|
+
|
|
60
|
+
## Installation
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# pip
|
|
64
|
+
pip install swarmauri_tool_jupytergetshellmessage
|
|
65
|
+
|
|
66
|
+
# poetry
|
|
67
|
+
poetry add swarmauri_tool_jupytergetshellmessage
|
|
68
|
+
|
|
69
|
+
# uv (pyproject-based projects)
|
|
70
|
+
uv add swarmauri_tool_jupytergetshellmessage
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Quickstart
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from swarmauri_tool_jupytergetshellmessage import JupyterGetShellMessageTool
|
|
77
|
+
|
|
78
|
+
channels_url = "ws://localhost:8888/api/kernels/<kernel-id>/channels"
|
|
79
|
+
result = JupyterGetIOPubMessageTool()(channels_url, timeout=5.0)
|
|
80
|
+
|
|
81
|
+
if "messages" in result:
|
|
82
|
+
for msg in result["messages"]:
|
|
83
|
+
print(msg)
|
|
84
|
+
else:
|
|
85
|
+
print("Error:", result.get("error"))
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Tips
|
|
89
|
+
|
|
90
|
+
- Ensure you pass the correct kernel channels URL (including security tokens/cookies if your server requires them).
|
|
91
|
+
- Increase `timeout` if you expect long-running cells before shell replies are sent.
|
|
92
|
+
- Combine with notebook execution tools to capture both SHELL and IOPub messages for full observability.
|
|
93
|
+
|
|
94
|
+
## Want to help?
|
|
95
|
+
|
|
96
|
+
If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
|
|
97
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
5
|
+
<img src="https://img.shields.io/pypi/dm/swarmauri_tool_jupytergetshellmessage" alt="PyPI - Downloads"/></a>
|
|
6
|
+
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupytergetshellmessage/">
|
|
7
|
+
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupytergetshellmessage.svg"/></a>
|
|
8
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
9
|
+
<img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_jupytergetshellmessage" alt="PyPI - Python Version"/></a>
|
|
10
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
11
|
+
<img src="https://img.shields.io/pypi/l/swarmauri_tool_jupytergetshellmessage" alt="PyPI - License"/></a>
|
|
12
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
13
|
+
<img src="https://img.shields.io/pypi/v/swarmauri_tool_jupytergetshellmessage?label=swarmauri_tool_jupytergetshellmessage&color=green" alt="PyPI - swarmauri_tool_jupytergetshellmessage"/></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Swarmauri Tool Jupyter Get Shell Message
|
|
19
|
+
|
|
20
|
+
Retrieves shell-channel messages from a running Jupyter kernel using `jupyter_client`.
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- Listens on the Jupyter kernel shell channel and captures raw message dicts.
|
|
25
|
+
- Returns a dict containing `messages` or an `error` key.
|
|
26
|
+
- Helpful for debugging live kernel communication during automated notebook workflows.
|
|
27
|
+
|
|
28
|
+
## Prerequisites
|
|
29
|
+
|
|
30
|
+
- Python 3.10 or newer.
|
|
31
|
+
- Access to a running Jupyter kernel (Notebook server, JupyterLab, etc.).
|
|
32
|
+
- `jupyter_client` and `websocket-client` (installed automatically).
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# pip
|
|
38
|
+
pip install swarmauri_tool_jupytergetshellmessage
|
|
39
|
+
|
|
40
|
+
# poetry
|
|
41
|
+
poetry add swarmauri_tool_jupytergetshellmessage
|
|
42
|
+
|
|
43
|
+
# uv (pyproject-based projects)
|
|
44
|
+
uv add swarmauri_tool_jupytergetshellmessage
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Quickstart
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from swarmauri_tool_jupytergetshellmessage import JupyterGetShellMessageTool
|
|
51
|
+
|
|
52
|
+
channels_url = "ws://localhost:8888/api/kernels/<kernel-id>/channels"
|
|
53
|
+
result = JupyterGetIOPubMessageTool()(channels_url, timeout=5.0)
|
|
54
|
+
|
|
55
|
+
if "messages" in result:
|
|
56
|
+
for msg in result["messages"]:
|
|
57
|
+
print(msg)
|
|
58
|
+
else:
|
|
59
|
+
print("Error:", result.get("error"))
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Tips
|
|
63
|
+
|
|
64
|
+
- Ensure you pass the correct kernel channels URL (including security tokens/cookies if your server requires them).
|
|
65
|
+
- Increase `timeout` if you expect long-running cells before shell replies are sent.
|
|
66
|
+
- Combine with notebook execution tools to capture both SHELL and IOPub messages for full observability.
|
|
67
|
+
|
|
68
|
+
## Want to help?
|
|
69
|
+
|
|
70
|
+
If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "swarmauri_tool_jupytergetshellmessage"
|
|
3
|
-
version = "0.9.
|
|
3
|
+
version = "0.9.2.dev6"
|
|
4
4
|
description = "A tool designed to retrieve shell messages from a running Jupyter kernel using jupyter_client, useful for debugging execution responses."
|
|
5
5
|
license = "Apache-2.0"
|
|
6
6
|
readme = "README.md"
|
|
@@ -12,6 +12,10 @@ classifiers = [
|
|
|
12
12
|
"Programming Language :: Python :: 3.11",
|
|
13
13
|
"Programming Language :: Python :: 3.12",
|
|
14
14
|
"Programming Language :: Python :: 3.13",
|
|
15
|
+
"Natural Language :: English",
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
15
19
|
]
|
|
16
20
|
authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
|
|
17
21
|
dependencies = [
|
|
@@ -21,6 +25,23 @@ dependencies = [
|
|
|
21
25
|
"swarmauri_base",
|
|
22
26
|
"swarmauri_standard",
|
|
23
27
|
]
|
|
28
|
+
keywords = [
|
|
29
|
+
"swarmauri",
|
|
30
|
+
"tool",
|
|
31
|
+
"jupytergetshellmessage",
|
|
32
|
+
"designed",
|
|
33
|
+
"retrieve",
|
|
34
|
+
"shell",
|
|
35
|
+
"messages",
|
|
36
|
+
"running",
|
|
37
|
+
"jupyter",
|
|
38
|
+
"kernel",
|
|
39
|
+
"client",
|
|
40
|
+
"useful",
|
|
41
|
+
"debugging",
|
|
42
|
+
"execution",
|
|
43
|
+
"responses",
|
|
44
|
+
]
|
|
24
45
|
|
|
25
46
|
[tool.uv.sources]
|
|
26
47
|
swarmauri_core = { workspace = true }
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: swarmauri_tool_jupytergetshellmessage
|
|
3
|
-
Version: 0.9.0.dev4
|
|
4
|
-
Summary: A tool designed to retrieve shell messages from a running Jupyter kernel using jupyter_client, useful for debugging execution responses.
|
|
5
|
-
License: Apache-2.0
|
|
6
|
-
Author: Jacob Stewart
|
|
7
|
-
Author-email: jacob@swarmauri.com
|
|
8
|
-
Requires-Python: >=3.10,<3.13
|
|
9
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
-
Requires-Dist: ipykernel (>=6.29.5)
|
|
15
|
-
Requires-Dist: jupyter_client (>=8.6.3)
|
|
16
|
-
Requires-Dist: swarmauri_base
|
|
17
|
-
Requires-Dist: swarmauri_core
|
|
18
|
-
Requires-Dist: swarmauri_standard
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-

|
|
23
|
-
|
|
24
|
-
<p align="center">
|
|
25
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
26
|
-
<img src="https://img.shields.io/pypi/dm/swarmauri_tool_jupytergetshellmessage" alt="PyPI - Downloads"/></a>
|
|
27
|
-
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupytergetshellmessage/">
|
|
28
|
-
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupytergetshellmessage.svg"/></a>
|
|
29
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
30
|
-
<img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_jupytergetshellmessage" alt="PyPI - Python Version"/></a>
|
|
31
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
32
|
-
<img src="https://img.shields.io/pypi/l/swarmauri_tool_jupytergetshellmessage" alt="PyPI - License"/></a>
|
|
33
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
34
|
-
<img src="https://img.shields.io/pypi/v/swarmauri_tool_jupytergetshellmessage?label=swarmauri_tool_jupytergetshellmessage&color=green" alt="PyPI - swarmauri_tool_jupytergetshellmessage"/></a>
|
|
35
|
-
</p>
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
# Swarmauri Tool Jupyter Get Shell Message
|
|
40
|
-
|
|
41
|
-
A dedicated Python package providing a tool to retrieve shell messages from a running Jupyter kernel using jupyter_client. Built on the swarmauri framework, JupyterGetShellMessageTool is suitable for debugging, logging, and diagnostic purposes.
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Installation
|
|
46
|
-
|
|
47
|
-
To install this package from PyPI, use the following command:
|
|
48
|
-
|
|
49
|
-
pip install swarmauri_tool_jupytergetshellmessage
|
|
50
|
-
|
|
51
|
-
If you are using Poetry for dependency management, add it to your project by specifying the package name in your pyproject.toml under [tool.poetry.dependencies]:
|
|
52
|
-
|
|
53
|
-
[tool.poetry.dependencies]
|
|
54
|
-
swarmauri_tool_jupytergetshellmessage = "^0.1.0.dev1"
|
|
55
|
-
|
|
56
|
-
Once installed, the package automatically brings in its required dependencies:
|
|
57
|
-
• swarmauri_core
|
|
58
|
-
• swarmauri_base
|
|
59
|
-
• jupyter_client
|
|
60
|
-
|
|
61
|
-
No specialized steps beyond a standard Python environment with pip or Poetry are necessary.
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## Usage
|
|
66
|
-
|
|
67
|
-
Below is a simple example illustrating how to retrieve shell messages from a currently running Jupyter kernel. Make sure you have an active Jupyter kernel in the environment you are running this code from (for instance, a notebook server launched via "jupyter notebook" or "jupyter lab").
|
|
68
|
-
|
|
69
|
-
1. Import JupyterGetShellMessageTool:
|
|
70
|
-
|
|
71
|
-
from swarmauri_tool_jupytergetshellmessage import JupyterGetShellMessageTool
|
|
72
|
-
|
|
73
|
-
2. Instantiate the tool and call it:
|
|
74
|
-
|
|
75
|
-
tool = JupyterGetShellMessageTool()
|
|
76
|
-
result = tool(timeout=10.0) # Wait up to 10 seconds for shell messages
|
|
77
|
-
|
|
78
|
-
3. Inspect the result:
|
|
79
|
-
|
|
80
|
-
if "messages" in result:
|
|
81
|
-
for msg in result["messages"]:
|
|
82
|
-
print("Shell Message:", msg)
|
|
83
|
-
else:
|
|
84
|
-
print("No messages or error:", result.get("error", "No details"))
|
|
85
|
-
|
|
86
|
-
The tool attempts to connect to the active Jupyter kernel, retrieve available shell messages, and return them in a structured dictionary. If no messages are found within the specified timeout, it returns an error message indicating the timeout event.
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## Dependencies
|
|
91
|
-
|
|
92
|
-
• swarmauri_core and swarmauri_base provide the core classes (ComponentBase, ToolBase) for building and integrating tools across the swarmauri ecosystem.
|
|
93
|
-
• jupyter_client is leveraged to interface with the running Jupyter kernel, enabling retrieval of shell-based IPC messages.
|
|
94
|
-
|
|
95
|
-
These dependencies are automatically installed when installing this package via pip or Poetry.
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## Contributing
|
|
100
|
-
|
|
101
|
-
Issues and feature requests for swarmauri_tool_jupytergetshellmessage are always welcome. Although direct repository interaction details are not included here, feel free to suggest improvements or report problems using the relevant issue tracker.
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
© 2023 Swarmauri. Licensed under the Apache License, Version 2.0.
|
|
106
|
-
See the LICENSE file for details.
|
|
107
|
-
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-

|
|
3
|
-
|
|
4
|
-
<p align="center">
|
|
5
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
6
|
-
<img src="https://img.shields.io/pypi/dm/swarmauri_tool_jupytergetshellmessage" alt="PyPI - Downloads"/></a>
|
|
7
|
-
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupytergetshellmessage/">
|
|
8
|
-
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupytergetshellmessage.svg"/></a>
|
|
9
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
10
|
-
<img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_jupytergetshellmessage" alt="PyPI - Python Version"/></a>
|
|
11
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
12
|
-
<img src="https://img.shields.io/pypi/l/swarmauri_tool_jupytergetshellmessage" alt="PyPI - License"/></a>
|
|
13
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupytergetshellmessage/">
|
|
14
|
-
<img src="https://img.shields.io/pypi/v/swarmauri_tool_jupytergetshellmessage?label=swarmauri_tool_jupytergetshellmessage&color=green" alt="PyPI - swarmauri_tool_jupytergetshellmessage"/></a>
|
|
15
|
-
</p>
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# Swarmauri Tool Jupyter Get Shell Message
|
|
20
|
-
|
|
21
|
-
A dedicated Python package providing a tool to retrieve shell messages from a running Jupyter kernel using jupyter_client. Built on the swarmauri framework, JupyterGetShellMessageTool is suitable for debugging, logging, and diagnostic purposes.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Installation
|
|
26
|
-
|
|
27
|
-
To install this package from PyPI, use the following command:
|
|
28
|
-
|
|
29
|
-
pip install swarmauri_tool_jupytergetshellmessage
|
|
30
|
-
|
|
31
|
-
If you are using Poetry for dependency management, add it to your project by specifying the package name in your pyproject.toml under [tool.poetry.dependencies]:
|
|
32
|
-
|
|
33
|
-
[tool.poetry.dependencies]
|
|
34
|
-
swarmauri_tool_jupytergetshellmessage = "^0.1.0.dev1"
|
|
35
|
-
|
|
36
|
-
Once installed, the package automatically brings in its required dependencies:
|
|
37
|
-
• swarmauri_core
|
|
38
|
-
• swarmauri_base
|
|
39
|
-
• jupyter_client
|
|
40
|
-
|
|
41
|
-
No specialized steps beyond a standard Python environment with pip or Poetry are necessary.
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Usage
|
|
46
|
-
|
|
47
|
-
Below is a simple example illustrating how to retrieve shell messages from a currently running Jupyter kernel. Make sure you have an active Jupyter kernel in the environment you are running this code from (for instance, a notebook server launched via "jupyter notebook" or "jupyter lab").
|
|
48
|
-
|
|
49
|
-
1. Import JupyterGetShellMessageTool:
|
|
50
|
-
|
|
51
|
-
from swarmauri_tool_jupytergetshellmessage import JupyterGetShellMessageTool
|
|
52
|
-
|
|
53
|
-
2. Instantiate the tool and call it:
|
|
54
|
-
|
|
55
|
-
tool = JupyterGetShellMessageTool()
|
|
56
|
-
result = tool(timeout=10.0) # Wait up to 10 seconds for shell messages
|
|
57
|
-
|
|
58
|
-
3. Inspect the result:
|
|
59
|
-
|
|
60
|
-
if "messages" in result:
|
|
61
|
-
for msg in result["messages"]:
|
|
62
|
-
print("Shell Message:", msg)
|
|
63
|
-
else:
|
|
64
|
-
print("No messages or error:", result.get("error", "No details"))
|
|
65
|
-
|
|
66
|
-
The tool attempts to connect to the active Jupyter kernel, retrieve available shell messages, and return them in a structured dictionary. If no messages are found within the specified timeout, it returns an error message indicating the timeout event.
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## Dependencies
|
|
71
|
-
|
|
72
|
-
• swarmauri_core and swarmauri_base provide the core classes (ComponentBase, ToolBase) for building and integrating tools across the swarmauri ecosystem.
|
|
73
|
-
• jupyter_client is leveraged to interface with the running Jupyter kernel, enabling retrieval of shell-based IPC messages.
|
|
74
|
-
|
|
75
|
-
These dependencies are automatically installed when installing this package via pip or Poetry.
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## Contributing
|
|
80
|
-
|
|
81
|
-
Issues and feature requests for swarmauri_tool_jupytergetshellmessage are always welcome. Although direct repository interaction details are not included here, feel free to suggest improvements or report problems using the relevant issue tracker.
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
© 2023 Swarmauri. Licensed under the Apache License, Version 2.0.
|
|
86
|
-
See the LICENSE file for details.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|