pagent 0.2.0__tar.gz → 0.3.2__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.
@@ -1,15 +1,20 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pagent
3
- Version: 0.2.0
3
+ Version: 0.3.2
4
4
  Summary: Minimal OpenAI Chat Completions agent (session + tools).
5
5
  Author: gongyulei
6
6
  Author-email: gongyulei <gongyulei@stu.xmu.edu.cn>
7
7
  Requires-Dist: docstring-parser>=0.18.0
8
8
  Requires-Dist: openai>=2.31.0
9
9
  Requires-Dist: tiktoken>=0.7.0
10
+ Requires-Dist: agent-client-protocol>=0.10 ; extra == 'acp'
11
+ Requires-Dist: ddgs>=7 ; extra == 'acp'
10
12
  Requires-Dist: ddgs>=7 ; extra == 'search'
11
13
  Requires-Dist: transformers>=4.40 ; extra == 'tokens'
12
14
  Requires-Python: >=3.11
15
+ Project-URL: Documentation, https://synclionpaw.github.io/pagent/
16
+ Project-URL: Homepage, https://github.com/SyncLionPaw/pagent
17
+ Provides-Extra: acp
13
18
  Provides-Extra: search
14
19
  Provides-Extra: tokens
15
20
  Description-Content-Type: text/markdown
@@ -26,6 +31,10 @@ Language: [中文](./README.zh-CN.md) | [English](./README.en.md) · [Docs](http
26
31
 
27
32
  **pagent** is a small **async** Python library for an **Agent + tools** loop over **OpenAI-compatible Chat Completions**. Good for scripts, experiments, and teaching—transparent message history, your own tools.
28
33
 
34
+ ## Documentation
35
+
36
+ **https://synclionpaw.github.io/pagent/** — install, quick start, tools, events, Wire, providers.
37
+
29
38
  ## Install
30
39
 
31
40
  Requires **Python 3.11+**.
@@ -10,6 +10,10 @@ Language: [中文](./README.zh-CN.md) | [English](./README.en.md) · [Docs](http
10
10
 
11
11
  **pagent** is a small **async** Python library for an **Agent + tools** loop over **OpenAI-compatible Chat Completions**. Good for scripts, experiments, and teaching—transparent message history, your own tools.
12
12
 
13
+ ## Documentation
14
+
15
+ **https://synclionpaw.github.io/pagent/** — install, quick start, tools, events, Wire, providers.
16
+
13
17
  ## Install
14
18
 
15
19
  Requires **Python 3.11+**.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pagent"
3
- version = "0.2.0"
3
+ version = "0.3.2"
4
4
  description = "Minimal OpenAI Chat Completions agent (session + tools)."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -13,9 +13,14 @@ dependencies = [
13
13
  "tiktoken>=0.7.0",
14
14
  ]
15
15
 
16
+ [project.urls]
17
+ Homepage = "https://github.com/SyncLionPaw/pagent"
18
+ Documentation = "https://synclionpaw.github.io/pagent/"
19
+
16
20
  [project.optional-dependencies]
17
21
  search = ["ddgs>=7"]
18
22
  tokens = ["transformers>=4.40"]
23
+ acp = ["agent-client-protocol>=0.10", "ddgs>=7"]
19
24
 
20
25
  [build-system]
21
26
  requires = ["uv_build>=0.8.20,<0.9.0"]
@@ -23,9 +28,11 @@ build-backend = "uv_build"
23
28
 
24
29
  [dependency-groups]
25
30
  dev = [
31
+ "agent-client-protocol>=0.10",
26
32
  "ddgs>=7",
27
33
  "pre-commit>=4",
28
34
  "pytest>=8",
35
+ "pytest-asyncio>=0.24",
29
36
  "ruff>=0.9",
30
37
  ]
31
38
  [tool.pytest.ini_options]
@@ -38,5 +45,10 @@ src = ["src"]
38
45
  [tool.ruff.lint]
39
46
  select = ["E4", "E7", "E9", "F", "I"]
40
47
 
48
+ [tool.ruff.lint.per-file-ignores]
49
+ "examples/demo2/*.py" = ["E402"] # sys.path adjusted before local / sibling imports
50
+ "examples/acp_agent/main.py" = ["E402"]
51
+ "tests/test_acp_tools.py" = ["E402"]
52
+
41
53
  [tool.ruff.format]
42
54
  quote-style = "double"
@@ -11,7 +11,7 @@ from .events import (
11
11
  TurnEnd,
12
12
  )
13
13
  from .llm import RunEnd
14
- from .tool import ToolOutput, to_openai_tools
14
+ from .tool import FunctionTool, ToolOutput, to_openai_tools
15
15
 
16
16
 
17
17
  class AgentStats:
@@ -48,7 +48,7 @@ class Agent:
48
48
  names = [t.name for t in self.tools]
49
49
  if len(names) != len(set(names)):
50
50
  raise ValueError(f"duplicate tool names: {names}")
51
- self.tool_map = {t.name: t for t in self.tools}
51
+ self.tool_map: dict[str, FunctionTool] = {t.name: t for t in self.tools}
52
52
  if max_turns < 1:
53
53
  raise ValueError("max_turns must be >= 1")
54
54
  self.max_turns = max_turns
@@ -1,5 +1,3 @@
1
- from __future__ import annotations
2
-
3
1
  import inspect
4
2
  import json
5
3
  from dataclasses import dataclass
@@ -10,8 +10,6 @@ One JSON object per line (NDJSON) is typical for HTTP/SSE or WebSocket bridges.
10
10
  See ``docs/wire.md``.
11
11
  """
12
12
 
13
- from __future__ import annotations
14
-
15
13
  import json
16
14
  from collections.abc import AsyncIterator, Iterator
17
15
  from dataclasses import fields
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes