agentcamp 0.1.0__py3-none-any.whl

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.
agentcamp/__init__.py ADDED
@@ -0,0 +1,24 @@
1
+ """AgentCamp SDK.
2
+
3
+ Where agents train their own experts. This is the public client surface for
4
+ AgentCamp. v0.1.0 ships a lightweight client stub plus the ``wrap_langgraph``
5
+ entrypoint so integrations can be wired up before the training backend lands.
6
+ """
7
+
8
+ __author__ = "FintorAI"
9
+ __version__ = "0.1.0"
10
+
11
+ from agentcamp.client import (
12
+ AgentCampClient,
13
+ AgentCampError,
14
+ Mode,
15
+ wrap_langgraph,
16
+ )
17
+
18
+ __all__ = [
19
+ "AgentCampClient",
20
+ "AgentCampError",
21
+ "Mode",
22
+ "__version__",
23
+ "wrap_langgraph",
24
+ ]
agentcamp/client.py ADDED
@@ -0,0 +1,96 @@
1
+ """Core AgentCamp client.
2
+
3
+ This is the v0.1.0 placeholder surface. It establishes the public API shape
4
+ (client + ``wrap_langgraph`` + modes) without depending on the training
5
+ backend yet, so downstream code can integrate against a stable import path.
6
+ Calls are no-ops today and will start emitting traces once the backend is wired.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import os
12
+ from enum import Enum
13
+ from typing import Any, Optional
14
+
15
+ __all__ = [
16
+ "AgentCampClient",
17
+ "AgentCampError",
18
+ "Mode",
19
+ "wrap_langgraph",
20
+ ]
21
+
22
+
23
+ class AgentCampError(Exception):
24
+ """Base error for all AgentCamp client failures."""
25
+
26
+
27
+ class Mode(str, Enum):
28
+ """AgentCamp operating modes for a wrapped agent.
29
+
30
+ OBSERVE collect traces from the teacher agent only.
31
+ TRAIN build a fine-tuned expert from collected traces.
32
+ SHADOW run the expert alongside the teacher without serving it.
33
+ ACTIVATE serve the expert, falling back to the teacher when needed.
34
+ """
35
+
36
+ OBSERVE = "observe"
37
+ TRAIN = "train"
38
+ SHADOW = "shadow"
39
+ ACTIVATE = "activate"
40
+
41
+
42
+ class AgentCampClient:
43
+ """Lightweight AgentCamp client.
44
+
45
+ Args:
46
+ project: Project slug that traces and experts are grouped under.
47
+ api_key: AgentCamp API key. Falls back to ``AGENTCAMP_API_KEY``.
48
+ mode: Operating mode for this client. Defaults to ``Mode.OBSERVE``.
49
+ base_url: AgentCamp API base URL. Falls back to ``AGENTCAMP_BASE_URL``.
50
+ """
51
+
52
+ def __init__(
53
+ self,
54
+ project: str,
55
+ api_key: Optional[str] = None,
56
+ mode: Mode = Mode.OBSERVE,
57
+ base_url: Optional[str] = None,
58
+ ) -> None:
59
+ if not project:
60
+ raise AgentCampError("`project` is required.")
61
+ self.project = project
62
+ self.api_key = api_key or os.getenv("AGENTCAMP_API_KEY")
63
+ self.mode = Mode(mode)
64
+ self.base_url = base_url or os.getenv(
65
+ "AGENTCAMP_BASE_URL", "https://api.agentcamp.ai"
66
+ )
67
+
68
+ def __repr__(self) -> str:
69
+ return (
70
+ f"AgentCampClient(project={self.project!r}, mode={self.mode.value!r})"
71
+ )
72
+
73
+ def wrap_langgraph(self, graph: Any, mode: Optional[Mode] = None) -> Any:
74
+ """Wrap a LangGraph graph so AgentCamp can observe/train on its runs.
75
+
76
+ v0.1.0 is a no-op that returns the graph unchanged so integrations can
77
+ be wired ahead of the training backend.
78
+ """
79
+ _ = mode or self.mode
80
+ return graph
81
+
82
+
83
+ def wrap_langgraph(
84
+ graph: Any,
85
+ project: str,
86
+ api_key: Optional[str] = None,
87
+ mode: Mode = Mode.OBSERVE,
88
+ ) -> Any:
89
+ """Convenience wrapper around :class:`AgentCampClient`.
90
+
91
+ Example:
92
+ >>> import agentcamp
93
+ >>> graph = agentcamp.wrap_langgraph(graph, project="support-agent")
94
+ """
95
+ client = AgentCampClient(project=project, api_key=api_key, mode=mode)
96
+ return client.wrap_langgraph(graph)
agentcamp/py.typed ADDED
File without changes
@@ -0,0 +1,96 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentcamp
3
+ Version: 0.1.0
4
+ Summary: AgentCamp SDK — where agents train their own experts. Observe, train, shadow, and activate cheaper expert models behind your existing agents.
5
+ Author: FintorAI
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://agentcamp.ai
8
+ Project-URL: Repository, https://github.com/FintorAI/agentcamp
9
+ Project-URL: Changelog, https://github.com/FintorAI/agentcamp/blob/main/CHANGELOG.md
10
+ Keywords: agents,langgraph,llm,fine-tuning,agentcamp,distillation
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: <4.0,>=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest; extra == "dev"
24
+ Requires-Dist: pytest-cov; extra == "dev"
25
+ Requires-Dist: build; extra == "dev"
26
+ Requires-Dist: twine; extra == "dev"
27
+ Dynamic: license-file
28
+
29
+ # AgentCamp
30
+
31
+ [![PyPI version](https://img.shields.io/pypi/v/agentcamp.svg)](https://pypi.org/project/agentcamp/)
32
+ [![Python versions](https://img.shields.io/pypi/pyversions/agentcamp.svg)](https://pypi.org/project/agentcamp/)
33
+
34
+ **Where agents train their own experts. Same results, dramatically cheaper.**
35
+
36
+ AgentCamp observes your existing agents in production, trains a fine-tuned
37
+ expert from the traces, shadows it for safety, and then activates it behind
38
+ your stack — with automatic fallback to the teacher model.
39
+
40
+ > v0.1.0 is an early placeholder release. It ships a stable public client
41
+ > surface (`AgentCampClient`, `wrap_langgraph`, and `Mode`) so you can wire up
42
+ > integrations now. Calls are currently no-ops and will begin emitting traces
43
+ > once the training backend lands.
44
+
45
+ ## Installation
46
+
47
+ ```bash
48
+ pip install agentcamp
49
+ ```
50
+
51
+ ## Quick start
52
+
53
+ ```python
54
+ import agentcamp
55
+
56
+ # Wrap an existing LangGraph graph so AgentCamp can observe its runs.
57
+ graph = agentcamp.wrap_langgraph(graph, project="support-agent")
58
+ ```
59
+
60
+ Or use the client directly:
61
+
62
+ ```python
63
+ from agentcamp import AgentCampClient, Mode
64
+
65
+ client = AgentCampClient(project="support-agent", mode=Mode.OBSERVE)
66
+ graph = client.wrap_langgraph(graph)
67
+ ```
68
+
69
+ ## Modes
70
+
71
+ | Mode | What it does |
72
+ | ---------- | ------------------------------------------------------------------- |
73
+ | `OBSERVE` | Collect traces from the teacher agent only. |
74
+ | `TRAIN` | Build a fine-tuned expert from collected traces. |
75
+ | `SHADOW` | Run the expert alongside the teacher without serving it. |
76
+ | `ACTIVATE` | Serve the expert, falling back to the teacher when needed. |
77
+
78
+ ## Configuration
79
+
80
+ | Environment variable | Purpose |
81
+ | -------------------- | ---------------------------------------- |
82
+ | `AGENTCAMP_API_KEY` | API key used to authenticate the client. |
83
+ | `AGENTCAMP_BASE_URL` | Override the AgentCamp API base URL. |
84
+
85
+ ## Development
86
+
87
+ ```bash
88
+ python -m venv .venv
89
+ source .venv/bin/activate
90
+ pip install -e '.[dev]'
91
+ pytest
92
+ ```
93
+
94
+ ## License
95
+
96
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,8 @@
1
+ agentcamp/__init__.py,sha256=68dH3PjJd1Hv9fiWX2J6tAbG4BKSUNr8p65IeLBilBU,520
2
+ agentcamp/client.py,sha256=9zbpsZ4bxlyJWpN-I-MBe2oV5S-g6Wg-3lSulpNSPYo,2888
3
+ agentcamp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ agentcamp-0.1.0.dist-info/licenses/LICENSE,sha256=6CKEkOHQeDUgXEbDMSji7GhwvnwiKa0pkfBwpCf0WR8,1065
5
+ agentcamp-0.1.0.dist-info/METADATA,sha256=kw9MAuzPgjUS8JJPESkfyVCuYqem-PWWh5c5M4b2Teg,3338
6
+ agentcamp-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
7
+ agentcamp-0.1.0.dist-info/top_level.txt,sha256=Xjidft2W2qB_8QrzI7SJWVfxHWow0jSZJZgejBFQKQI,10
8
+ agentcamp-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FintorAI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ agentcamp