acp-easy 0.1.0__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,150 @@
1
+ Metadata-Version: 2.4
2
+ Name: acp-easy
3
+ Version: 0.1.0
4
+ Summary: A dead-simple , LangChain-style client for ACP server.
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: httpx
8
+ Requires-Dist: httpx-sse
9
+ Requires-Dist: acp-sdk==1.0.3
10
+ Requires-Dist: uvicorn[standard]==0.35.0
11
+
12
+ # acp-easy
13
+
14
+ A lightweight, LangChain-style Python wrapper around the [ACP SDK](https://pypi.org/project/acp-sdk/) that makes it easy to talk to ACP-compliant agent servers — with auto agent-discovery, sync and async support, and clear error messages.
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ pip install acp-easy
20
+ ```
21
+
22
+ ## Quick start
23
+
24
+ ```python
25
+ from acp_easy import AcpClient
26
+
27
+ client = AcpClient(base_url="http://localhost:8000", agent="my-agent")
28
+
29
+ reply = client.chat(
30
+ messages=[
31
+ {"role": "user", "content": "Hello!"},
32
+ ],
33
+ model="gpt-4o-mini",
34
+ )
35
+
36
+ print(reply)
37
+ ```
38
+
39
+ Each message must be a dict with `role` and `content` keys, e.g. `{"role": "user", "content": "..."}`.
40
+
41
+ ## Finding your agent name
42
+
43
+ If you don't know what agents your ACP server exposes, list them first:
44
+
45
+ ```python
46
+ from acp_easy import AcpClient
47
+
48
+ client = AcpClient(base_url="http://localhost:8000")
49
+
50
+ agents = client.list_agents()
51
+ print(agents)
52
+ # [{'name': 'my-agent', 'description': 'No description provided.'}]
53
+ ```
54
+
55
+ Each entry gives you the `name` to pass as `agent=...`.
56
+
57
+ - If you don't pass `agent` at all **and** the server has exactly one agent, `acp-easy` auto-resolves it for you.
58
+ - If the server has multiple agents and you don't specify one, you'll get a clear `AcpAgentResolutionError` listing all available agents so you can pick one.
59
+
60
+ You can set a default agent once at client creation instead of passing it on every call:
61
+
62
+ ```python
63
+ client = AcpClient(base_url="http://localhost:8000", agent="my-agent")
64
+ ```
65
+
66
+ ## Available models
67
+
68
+ Pass any of these keys as the `model` argument to `chat()`:
69
+
70
+ | Key | Model |
71
+ |---|---|
72
+ | `GLM-5.2` | `huggingface/zai-org/GLM-5.2` |
73
+ | `gpt-4o-mini` | `openai/gpt-4o-mini` |
74
+ | `Qwen3-Coder-Next` | `huggingface/Qwen/Qwen3-Coder-Next` |
75
+ | `MiniMAX-M3` | `huggingface/MiniMaxAI/MiniMax-M3` |
76
+ | `DeepSeek-V4-Pro` | `huggingface/deepseek-ai/DeepSeek-V4-Pro` |
77
+
78
+ ## Sync vs Async
79
+
80
+ `acp-easy` gives you both sync and async versions of every network call. Use sync in plain scripts, and async inside code that already runs an event loop (FastAPI, Jupyter, asyncio apps).
81
+
82
+ | Task | Sync | Async |
83
+ |---|---|---|
84
+ | List agents | `client.list_agents()` | `await client.list_agents_async()` |
85
+ | Chat | `client.chat(...)` | `await client.chat_async(...)` |
86
+
87
+ ```python
88
+ # Inside a FastAPI route / Jupyter notebook / any async function:
89
+ agents = await client.list_agents_async()
90
+ reply = await client.chat_async(
91
+ messages=[{"role": "user", "content": "Hello!"}],
92
+ model="gpt-4o-mini",
93
+ )
94
+ ```
95
+
96
+ > ⚠️ Calling the sync methods (`chat`, `list_agents`) from inside a running event loop will raise a clear `RuntimeError` telling you to use the `_async` version instead — this avoids the confusing `asyncio.run() cannot be called from a running event loop` crash.
97
+
98
+ ## Multi-turn conversations
99
+
100
+ Pass the full message history as a list — `acp-easy` doesn't manage conversation memory for you:
101
+
102
+ ```python
103
+ reply = client.chat(
104
+ messages=[
105
+ {"role": "user", "content": "My name is Ganaik."},
106
+ {"role": "assistant", "content": "Nice to meet you, Ganaik!"},
107
+ {"role": "user", "content": "What's my name?"},
108
+ ],
109
+ model="gpt-4o-mini",
110
+ )
111
+ ```
112
+
113
+ ## Error handling
114
+
115
+ `acp-easy` raises `AcpAgentResolutionError` for:
116
+ - No agents found on the server
117
+ - Multiple agents found with none specified
118
+ - Malformed messages (missing `role`/`content`, wrong types)
119
+
120
+ ```python
121
+ from acp_easy import AcpClient, AcpAgentResolutionError
122
+
123
+ client = AcpClient(base_url="http://localhost:8000")
124
+
125
+ try:
126
+ reply = client.chat(
127
+ messages=[{"role": "user", "content": "Hi"}],
128
+ model="gpt-4o-mini",
129
+ )
130
+ except AcpAgentResolutionError as e:
131
+ print(f"Couldn't resolve agent: {e}")
132
+ ```
133
+
134
+ ## API reference
135
+
136
+ ### `AcpClient(base_url, agent=None, timeout=60.0)`
137
+ - `base_url` — URL of your ACP server (e.g. `"http://localhost:8000"`)
138
+ - `agent` — optional default agent name; skips auto-discovery if set
139
+ - `timeout` — request timeout in seconds (default `60.0`)
140
+
141
+ ### `client.list_agents()` / `await client.list_agents_async()`
142
+ Returns a list of `{"name": ..., "description": ...}` dicts for all agents on the server.
143
+
144
+ ### `client.chat(messages, model, agent=None)` / `await client.chat_async(messages, model, agent=None)`
145
+ Sends a message history to the resolved agent and returns the agent's text reply.
146
+ - `messages` — list of `{"role": ..., "content": ...}` dicts
147
+ - `model` — model key from the [Available models](#available-models) table
148
+ - `agent` — optional agent name; overrides the client's default for this call only
149
+
150
+ ```
@@ -0,0 +1,139 @@
1
+ # acp-easy
2
+
3
+ A lightweight, LangChain-style Python wrapper around the [ACP SDK](https://pypi.org/project/acp-sdk/) that makes it easy to talk to ACP-compliant agent servers — with auto agent-discovery, sync and async support, and clear error messages.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pip install acp-easy
9
+ ```
10
+
11
+ ## Quick start
12
+
13
+ ```python
14
+ from acp_easy import AcpClient
15
+
16
+ client = AcpClient(base_url="http://localhost:8000", agent="my-agent")
17
+
18
+ reply = client.chat(
19
+ messages=[
20
+ {"role": "user", "content": "Hello!"},
21
+ ],
22
+ model="gpt-4o-mini",
23
+ )
24
+
25
+ print(reply)
26
+ ```
27
+
28
+ Each message must be a dict with `role` and `content` keys, e.g. `{"role": "user", "content": "..."}`.
29
+
30
+ ## Finding your agent name
31
+
32
+ If you don't know what agents your ACP server exposes, list them first:
33
+
34
+ ```python
35
+ from acp_easy import AcpClient
36
+
37
+ client = AcpClient(base_url="http://localhost:8000")
38
+
39
+ agents = client.list_agents()
40
+ print(agents)
41
+ # [{'name': 'my-agent', 'description': 'No description provided.'}]
42
+ ```
43
+
44
+ Each entry gives you the `name` to pass as `agent=...`.
45
+
46
+ - If you don't pass `agent` at all **and** the server has exactly one agent, `acp-easy` auto-resolves it for you.
47
+ - If the server has multiple agents and you don't specify one, you'll get a clear `AcpAgentResolutionError` listing all available agents so you can pick one.
48
+
49
+ You can set a default agent once at client creation instead of passing it on every call:
50
+
51
+ ```python
52
+ client = AcpClient(base_url="http://localhost:8000", agent="my-agent")
53
+ ```
54
+
55
+ ## Available models
56
+
57
+ Pass any of these keys as the `model` argument to `chat()`:
58
+
59
+ | Key | Model |
60
+ |---|---|
61
+ | `GLM-5.2` | `huggingface/zai-org/GLM-5.2` |
62
+ | `gpt-4o-mini` | `openai/gpt-4o-mini` |
63
+ | `Qwen3-Coder-Next` | `huggingface/Qwen/Qwen3-Coder-Next` |
64
+ | `MiniMAX-M3` | `huggingface/MiniMaxAI/MiniMax-M3` |
65
+ | `DeepSeek-V4-Pro` | `huggingface/deepseek-ai/DeepSeek-V4-Pro` |
66
+
67
+ ## Sync vs Async
68
+
69
+ `acp-easy` gives you both sync and async versions of every network call. Use sync in plain scripts, and async inside code that already runs an event loop (FastAPI, Jupyter, asyncio apps).
70
+
71
+ | Task | Sync | Async |
72
+ |---|---|---|
73
+ | List agents | `client.list_agents()` | `await client.list_agents_async()` |
74
+ | Chat | `client.chat(...)` | `await client.chat_async(...)` |
75
+
76
+ ```python
77
+ # Inside a FastAPI route / Jupyter notebook / any async function:
78
+ agents = await client.list_agents_async()
79
+ reply = await client.chat_async(
80
+ messages=[{"role": "user", "content": "Hello!"}],
81
+ model="gpt-4o-mini",
82
+ )
83
+ ```
84
+
85
+ > ⚠️ Calling the sync methods (`chat`, `list_agents`) from inside a running event loop will raise a clear `RuntimeError` telling you to use the `_async` version instead — this avoids the confusing `asyncio.run() cannot be called from a running event loop` crash.
86
+
87
+ ## Multi-turn conversations
88
+
89
+ Pass the full message history as a list — `acp-easy` doesn't manage conversation memory for you:
90
+
91
+ ```python
92
+ reply = client.chat(
93
+ messages=[
94
+ {"role": "user", "content": "My name is Ganaik."},
95
+ {"role": "assistant", "content": "Nice to meet you, Ganaik!"},
96
+ {"role": "user", "content": "What's my name?"},
97
+ ],
98
+ model="gpt-4o-mini",
99
+ )
100
+ ```
101
+
102
+ ## Error handling
103
+
104
+ `acp-easy` raises `AcpAgentResolutionError` for:
105
+ - No agents found on the server
106
+ - Multiple agents found with none specified
107
+ - Malformed messages (missing `role`/`content`, wrong types)
108
+
109
+ ```python
110
+ from acp_easy import AcpClient, AcpAgentResolutionError
111
+
112
+ client = AcpClient(base_url="http://localhost:8000")
113
+
114
+ try:
115
+ reply = client.chat(
116
+ messages=[{"role": "user", "content": "Hi"}],
117
+ model="gpt-4o-mini",
118
+ )
119
+ except AcpAgentResolutionError as e:
120
+ print(f"Couldn't resolve agent: {e}")
121
+ ```
122
+
123
+ ## API reference
124
+
125
+ ### `AcpClient(base_url, agent=None, timeout=60.0)`
126
+ - `base_url` — URL of your ACP server (e.g. `"http://localhost:8000"`)
127
+ - `agent` — optional default agent name; skips auto-discovery if set
128
+ - `timeout` — request timeout in seconds (default `60.0`)
129
+
130
+ ### `client.list_agents()` / `await client.list_agents_async()`
131
+ Returns a list of `{"name": ..., "description": ...}` dicts for all agents on the server.
132
+
133
+ ### `client.chat(messages, model, agent=None)` / `await client.chat_async(messages, model, agent=None)`
134
+ Sends a message history to the resolved agent and returns the agent's text reply.
135
+ - `messages` — list of `{"role": ..., "content": ...}` dicts
136
+ - `model` — model key from the [Available models](#available-models) table
137
+ - `agent` — optional agent name; overrides the client's default for this call only
138
+
139
+ ```
@@ -0,0 +1,150 @@
1
+ Metadata-Version: 2.4
2
+ Name: acp-easy
3
+ Version: 0.1.0
4
+ Summary: A dead-simple , LangChain-style client for ACP server.
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: httpx
8
+ Requires-Dist: httpx-sse
9
+ Requires-Dist: acp-sdk==1.0.3
10
+ Requires-Dist: uvicorn[standard]==0.35.0
11
+
12
+ # acp-easy
13
+
14
+ A lightweight, LangChain-style Python wrapper around the [ACP SDK](https://pypi.org/project/acp-sdk/) that makes it easy to talk to ACP-compliant agent servers — with auto agent-discovery, sync and async support, and clear error messages.
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ pip install acp-easy
20
+ ```
21
+
22
+ ## Quick start
23
+
24
+ ```python
25
+ from acp_easy import AcpClient
26
+
27
+ client = AcpClient(base_url="http://localhost:8000", agent="my-agent")
28
+
29
+ reply = client.chat(
30
+ messages=[
31
+ {"role": "user", "content": "Hello!"},
32
+ ],
33
+ model="gpt-4o-mini",
34
+ )
35
+
36
+ print(reply)
37
+ ```
38
+
39
+ Each message must be a dict with `role` and `content` keys, e.g. `{"role": "user", "content": "..."}`.
40
+
41
+ ## Finding your agent name
42
+
43
+ If you don't know what agents your ACP server exposes, list them first:
44
+
45
+ ```python
46
+ from acp_easy import AcpClient
47
+
48
+ client = AcpClient(base_url="http://localhost:8000")
49
+
50
+ agents = client.list_agents()
51
+ print(agents)
52
+ # [{'name': 'my-agent', 'description': 'No description provided.'}]
53
+ ```
54
+
55
+ Each entry gives you the `name` to pass as `agent=...`.
56
+
57
+ - If you don't pass `agent` at all **and** the server has exactly one agent, `acp-easy` auto-resolves it for you.
58
+ - If the server has multiple agents and you don't specify one, you'll get a clear `AcpAgentResolutionError` listing all available agents so you can pick one.
59
+
60
+ You can set a default agent once at client creation instead of passing it on every call:
61
+
62
+ ```python
63
+ client = AcpClient(base_url="http://localhost:8000", agent="my-agent")
64
+ ```
65
+
66
+ ## Available models
67
+
68
+ Pass any of these keys as the `model` argument to `chat()`:
69
+
70
+ | Key | Model |
71
+ |---|---|
72
+ | `GLM-5.2` | `huggingface/zai-org/GLM-5.2` |
73
+ | `gpt-4o-mini` | `openai/gpt-4o-mini` |
74
+ | `Qwen3-Coder-Next` | `huggingface/Qwen/Qwen3-Coder-Next` |
75
+ | `MiniMAX-M3` | `huggingface/MiniMaxAI/MiniMax-M3` |
76
+ | `DeepSeek-V4-Pro` | `huggingface/deepseek-ai/DeepSeek-V4-Pro` |
77
+
78
+ ## Sync vs Async
79
+
80
+ `acp-easy` gives you both sync and async versions of every network call. Use sync in plain scripts, and async inside code that already runs an event loop (FastAPI, Jupyter, asyncio apps).
81
+
82
+ | Task | Sync | Async |
83
+ |---|---|---|
84
+ | List agents | `client.list_agents()` | `await client.list_agents_async()` |
85
+ | Chat | `client.chat(...)` | `await client.chat_async(...)` |
86
+
87
+ ```python
88
+ # Inside a FastAPI route / Jupyter notebook / any async function:
89
+ agents = await client.list_agents_async()
90
+ reply = await client.chat_async(
91
+ messages=[{"role": "user", "content": "Hello!"}],
92
+ model="gpt-4o-mini",
93
+ )
94
+ ```
95
+
96
+ > ⚠️ Calling the sync methods (`chat`, `list_agents`) from inside a running event loop will raise a clear `RuntimeError` telling you to use the `_async` version instead — this avoids the confusing `asyncio.run() cannot be called from a running event loop` crash.
97
+
98
+ ## Multi-turn conversations
99
+
100
+ Pass the full message history as a list — `acp-easy` doesn't manage conversation memory for you:
101
+
102
+ ```python
103
+ reply = client.chat(
104
+ messages=[
105
+ {"role": "user", "content": "My name is Ganaik."},
106
+ {"role": "assistant", "content": "Nice to meet you, Ganaik!"},
107
+ {"role": "user", "content": "What's my name?"},
108
+ ],
109
+ model="gpt-4o-mini",
110
+ )
111
+ ```
112
+
113
+ ## Error handling
114
+
115
+ `acp-easy` raises `AcpAgentResolutionError` for:
116
+ - No agents found on the server
117
+ - Multiple agents found with none specified
118
+ - Malformed messages (missing `role`/`content`, wrong types)
119
+
120
+ ```python
121
+ from acp_easy import AcpClient, AcpAgentResolutionError
122
+
123
+ client = AcpClient(base_url="http://localhost:8000")
124
+
125
+ try:
126
+ reply = client.chat(
127
+ messages=[{"role": "user", "content": "Hi"}],
128
+ model="gpt-4o-mini",
129
+ )
130
+ except AcpAgentResolutionError as e:
131
+ print(f"Couldn't resolve agent: {e}")
132
+ ```
133
+
134
+ ## API reference
135
+
136
+ ### `AcpClient(base_url, agent=None, timeout=60.0)`
137
+ - `base_url` — URL of your ACP server (e.g. `"http://localhost:8000"`)
138
+ - `agent` — optional default agent name; skips auto-discovery if set
139
+ - `timeout` — request timeout in seconds (default `60.0`)
140
+
141
+ ### `client.list_agents()` / `await client.list_agents_async()`
142
+ Returns a list of `{"name": ..., "description": ...}` dicts for all agents on the server.
143
+
144
+ ### `client.chat(messages, model, agent=None)` / `await client.chat_async(messages, model, agent=None)`
145
+ Sends a message history to the resolved agent and returns the agent's text reply.
146
+ - `messages` — list of `{"role": ..., "content": ...}` dicts
147
+ - `model` — model key from the [Available models](#available-models) table
148
+ - `agent` — optional agent name; overrides the client's default for this call only
149
+
150
+ ```
@@ -0,0 +1,7 @@
1
+ README.md
2
+ pyproject.toml
3
+ acp_easy.egg-info/PKG-INFO
4
+ acp_easy.egg-info/SOURCES.txt
5
+ acp_easy.egg-info/dependency_links.txt
6
+ acp_easy.egg-info/requires.txt
7
+ acp_easy.egg-info/top_level.txt
@@ -0,0 +1,4 @@
1
+ httpx
2
+ httpx-sse
3
+ acp-sdk==1.0.3
4
+ uvicorn[standard]==0.35.0
@@ -0,0 +1,22 @@
1
+ [project]
2
+
3
+ name = 'acp-easy'
4
+ version = '0.1.0'
5
+ description = 'A dead-simple , LangChain-style client for ACP server.'
6
+ readme = "README.md"
7
+ requires-python = '>=3.12'
8
+ dependencies = [
9
+ 'httpx',
10
+ 'httpx-sse',
11
+ 'acp-sdk==1.0.3',
12
+ 'uvicorn[standard]==0.35.0'
13
+ ]
14
+
15
+ [build-system]
16
+
17
+ requires = ['setuptools>=61.0']
18
+ build-backend = 'setuptools.build_meta'
19
+
20
+ [tool.setuptools.packages.find]
21
+
22
+ include = ['acp_easy*']
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+