abbenay-client 2026.6.5a0__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.
@@ -0,0 +1,39 @@
1
+ # Build output
2
+ dist/
3
+
4
+ # Bootstrap tools (downloaded by ./bootstrap.sh)
5
+ .build-tools/
6
+
7
+ # Node.js
8
+ node_modules/
9
+ out/
10
+ *.tsbuildinfo
11
+
12
+ # VS Code Extension
13
+ *.vsix
14
+ .vscode-test/
15
+ packages/vscode/bin/
16
+
17
+ # Daemon
18
+ packages/daemon/dist/
19
+
20
+ # OS
21
+ .DS_Store
22
+
23
+ # Coverage
24
+ coverage/
25
+
26
+ # Logs
27
+ *.log
28
+
29
+ # Environment
30
+ .env
31
+ .env.local
32
+
33
+ # Python
34
+ __pycache__/
35
+ *.pyc
36
+ .venv/
37
+ .build-venv/
38
+ *.egg-info/
39
+ .pytest_cache/.superpowers/
@@ -0,0 +1,121 @@
1
+ Metadata-Version: 2.4
2
+ Name: abbenay-client
3
+ Version: 2026.6.5a0
4
+ Summary: Abbenay gRPC client for Python
5
+ Project-URL: Homepage, https://github.com/redhat-developer/abbenay
6
+ Project-URL: Documentation, https://github.com/redhat-developer/abbenay/tree/main/packages/python#readme
7
+ Project-URL: Repository, https://github.com/redhat-developer/abbenay
8
+ Project-URL: Changelog, https://github.com/redhat-developer/abbenay/releases
9
+ Project-URL: Issues, https://github.com/redhat-developer/abbenay/issues
10
+ Author: Abbenay Contributors
11
+ License-Expression: MIT
12
+ Keywords: abbenay,ai,client,grpc,llm
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Requires-Python: >=3.9
23
+ Requires-Dist: grpcio>=1.60.0
24
+ Requires-Dist: protobuf>=4.25.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: grpcio-tools>=1.60.0; extra == 'dev'
27
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
28
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
29
+ Description-Content-Type: text/markdown
30
+
31
+ # Abbenay Python Client
32
+
33
+ A Python gRPC client for the Abbenay daemon.
34
+
35
+ ## Installation
36
+
37
+ Install from [PyPI](https://pypi.org/project/abbenay-client/):
38
+
39
+ ```bash
40
+ pip install abbenay-client
41
+ ```
42
+
43
+ > **Note:** The pip package is `abbenay-client` but the Python import is
44
+ > `abbenay_grpc`:
45
+ >
46
+ > ```python
47
+ > from abbenay_grpc import AbbenayClient
48
+ > ```
49
+
50
+ Cross-platform: works on Linux, macOS, and Windows with Python 3.9+.
51
+
52
+ ## Quick Start
53
+
54
+ ```python
55
+ import asyncio
56
+ from abbenay_grpc import AbbenayClient
57
+
58
+ async def main():
59
+ async with AbbenayClient() as client:
60
+ async for chunk in client.chat("openai/gpt-4o", "Hello!"):
61
+ if chunk.type == "text":
62
+ print(chunk.text, end="")
63
+ print()
64
+
65
+ asyncio.run(main())
66
+ ```
67
+
68
+ ## Event Loop Lifecycle
69
+
70
+ `grpc.aio` channels are bound to the event loop that was active at
71
+ `connect()` time. If you call `asyncio.run()` more than once (which
72
+ creates and destroys loops), call `reconnect()` in the new loop:
73
+
74
+ ```python
75
+ async def preflight():
76
+ async with AbbenayClient() as client:
77
+ await client.health_check()
78
+
79
+ asyncio.run(preflight()) # loop created and closed
80
+
81
+ async def main():
82
+ client = AbbenayClient()
83
+ await client.connect() # auto-detects dead channel, reconnects
84
+ # ... or explicitly: await client.reconnect()
85
+ ```
86
+
87
+ ## Connecting to a Container
88
+
89
+ When the daemon runs in a container, connect via TCP instead of the
90
+ default Unix socket:
91
+
92
+ ```python
93
+ async with AbbenayClient(host="localhost", port=50051) as client:
94
+ async for chunk in client.chat("openrouter/anthropic/claude-sonnet-4", "Hello!"):
95
+ if chunk.text:
96
+ print(chunk.text, end="")
97
+ ```
98
+
99
+ The container must be started with `--grpc-port 50051` (the default
100
+ `Containerfile` CMD does this) and the port published (`-p 50051:50051`).
101
+
102
+ See [docs/CONTAINER.md](../../docs/CONTAINER.md) for full container
103
+ deployment instructions.
104
+
105
+ ## Features
106
+
107
+ - **Chat**: Streaming chat with any configured model
108
+ - **Sessions**: Create, list, fork, and manage chat sessions
109
+ - **Models**: List available models from all providers
110
+ - **Tools**: Dynamic MCP server registration and tool filtering
111
+ - **Secrets**: Manage API keys via keychain
112
+ - **Configuration**: Get/update daemon config
113
+
114
+ ## Requirements
115
+
116
+ - Python 3.9+
117
+ - Abbenay daemon running (`abbenay daemon`)
118
+
119
+ ## License
120
+
121
+ MIT
@@ -0,0 +1,91 @@
1
+ # Abbenay Python Client
2
+
3
+ A Python gRPC client for the Abbenay daemon.
4
+
5
+ ## Installation
6
+
7
+ Install from [PyPI](https://pypi.org/project/abbenay-client/):
8
+
9
+ ```bash
10
+ pip install abbenay-client
11
+ ```
12
+
13
+ > **Note:** The pip package is `abbenay-client` but the Python import is
14
+ > `abbenay_grpc`:
15
+ >
16
+ > ```python
17
+ > from abbenay_grpc import AbbenayClient
18
+ > ```
19
+
20
+ Cross-platform: works on Linux, macOS, and Windows with Python 3.9+.
21
+
22
+ ## Quick Start
23
+
24
+ ```python
25
+ import asyncio
26
+ from abbenay_grpc import AbbenayClient
27
+
28
+ async def main():
29
+ async with AbbenayClient() as client:
30
+ async for chunk in client.chat("openai/gpt-4o", "Hello!"):
31
+ if chunk.type == "text":
32
+ print(chunk.text, end="")
33
+ print()
34
+
35
+ asyncio.run(main())
36
+ ```
37
+
38
+ ## Event Loop Lifecycle
39
+
40
+ `grpc.aio` channels are bound to the event loop that was active at
41
+ `connect()` time. If you call `asyncio.run()` more than once (which
42
+ creates and destroys loops), call `reconnect()` in the new loop:
43
+
44
+ ```python
45
+ async def preflight():
46
+ async with AbbenayClient() as client:
47
+ await client.health_check()
48
+
49
+ asyncio.run(preflight()) # loop created and closed
50
+
51
+ async def main():
52
+ client = AbbenayClient()
53
+ await client.connect() # auto-detects dead channel, reconnects
54
+ # ... or explicitly: await client.reconnect()
55
+ ```
56
+
57
+ ## Connecting to a Container
58
+
59
+ When the daemon runs in a container, connect via TCP instead of the
60
+ default Unix socket:
61
+
62
+ ```python
63
+ async with AbbenayClient(host="localhost", port=50051) as client:
64
+ async for chunk in client.chat("openrouter/anthropic/claude-sonnet-4", "Hello!"):
65
+ if chunk.text:
66
+ print(chunk.text, end="")
67
+ ```
68
+
69
+ The container must be started with `--grpc-port 50051` (the default
70
+ `Containerfile` CMD does this) and the port published (`-p 50051:50051`).
71
+
72
+ See [docs/CONTAINER.md](../../docs/CONTAINER.md) for full container
73
+ deployment instructions.
74
+
75
+ ## Features
76
+
77
+ - **Chat**: Streaming chat with any configured model
78
+ - **Sessions**: Create, list, fork, and manage chat sessions
79
+ - **Models**: List available models from all providers
80
+ - **Tools**: Dynamic MCP server registration and tool filtering
81
+ - **Secrets**: Manage API keys via keychain
82
+ - **Configuration**: Get/update daemon config
83
+
84
+ ## Requirements
85
+
86
+ - Python 3.9+
87
+ - Abbenay daemon running (`abbenay daemon`)
88
+
89
+ ## License
90
+
91
+ MIT
@@ -0,0 +1,55 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "abbenay-client"
7
+ version = "2026.6.5a0"
8
+ description = "Abbenay gRPC client for Python"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.9"
12
+ keywords = ["abbenay", "llm", "grpc", "ai", "client"]
13
+ authors = [
14
+ { name = "Abbenay Contributors" }
15
+ ]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.9",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
26
+ ]
27
+ dependencies = [
28
+ "grpcio>=1.60.0",
29
+ "protobuf>=4.25.0",
30
+ ]
31
+
32
+ [project.optional-dependencies]
33
+ dev = [
34
+ "grpcio-tools>=1.60.0",
35
+ "pytest>=8.0.0",
36
+ "pytest-asyncio>=0.23.0",
37
+ ]
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/redhat-developer/abbenay"
41
+ Documentation = "https://github.com/redhat-developer/abbenay/tree/main/packages/python#readme"
42
+ Repository = "https://github.com/redhat-developer/abbenay"
43
+ Changelog = "https://github.com/redhat-developer/abbenay/releases"
44
+ Issues = "https://github.com/redhat-developer/abbenay/issues"
45
+
46
+ [tool.hatch.build.targets.sdist]
47
+ include = [
48
+ "/src",
49
+ ]
50
+
51
+ [tool.hatch.build.targets.wheel]
52
+ packages = ["src/abbenay_grpc"]
53
+
54
+ [tool.pytest.ini_options]
55
+ asyncio_mode = "auto"
@@ -0,0 +1,51 @@
1
+ """Abbenay gRPC Client for Python.
2
+
3
+ This module provides a Python client for communicating with the Abbenay daemon
4
+ via gRPC over Unix Domain Sockets.
5
+
6
+ Daemon paths:
7
+ Socket: $XDG_RUNTIME_DIR/abbenay/daemon.sock (or ~/.abbenay/daemon.sock)
8
+ PID file: $XDG_RUNTIME_DIR/abbenay/abbenay.pid (or ~/.abbenay/abbenay.pid)
9
+
10
+ Example usage:
11
+
12
+ from abbenay_grpc import AbbenayClient
13
+
14
+ # Check if daemon is running
15
+ if not AbbenayClient.is_daemon_running():
16
+ print("Start the daemon: abbenay daemon")
17
+
18
+ async with AbbenayClient() as client:
19
+ # Chat with a model
20
+ async for chunk in client.chat("openai/gpt-4o", "Hello!"):
21
+ print(chunk.text, end="")
22
+
23
+ # Create a session
24
+ session = await client.create_session("openai/gpt-4o")
25
+
26
+ # List sessions
27
+ sessions = await client.list_sessions()
28
+ for s in sessions:
29
+ print(f"{s.id}: {s.topic}")
30
+ """
31
+
32
+ from .client import (
33
+ AbbenayClient,
34
+ AbbenayError,
35
+ ConnectionError,
36
+ NotFoundError,
37
+ ChatChunk,
38
+ Session,
39
+ Model,
40
+ )
41
+
42
+ __all__ = [
43
+ "AbbenayClient",
44
+ "AbbenayError",
45
+ "ConnectionError",
46
+ "NotFoundError",
47
+ "ChatChunk",
48
+ "Session",
49
+ "Model",
50
+ ]
51
+ __version__ = "2026.6.5a0"