redlineai-sdk 0.2.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.
- redlineai_sdk-0.2.0/LICENSE +21 -0
- redlineai_sdk-0.2.0/PKG-INFO +187 -0
- redlineai_sdk-0.2.0/README.md +134 -0
- redlineai_sdk-0.2.0/pyproject.toml +55 -0
- redlineai_sdk-0.2.0/redline/__init__.py +38 -0
- redlineai_sdk-0.2.0/redline/cli.py +392 -0
- redlineai_sdk-0.2.0/redline/inject.py +187 -0
- redlineai_sdk-0.2.0/redline/py.typed +0 -0
- redlineai_sdk-0.2.0/redline/telemetry.py +127 -0
- redlineai_sdk-0.2.0/redline/tools.py +249 -0
- redlineai_sdk-0.2.0/redline/types.py +98 -0
- redlineai_sdk-0.2.0/redlineai_sdk.egg-info/PKG-INFO +187 -0
- redlineai_sdk-0.2.0/redlineai_sdk.egg-info/SOURCES.txt +16 -0
- redlineai_sdk-0.2.0/redlineai_sdk.egg-info/dependency_links.txt +1 -0
- redlineai_sdk-0.2.0/redlineai_sdk.egg-info/entry_points.txt +2 -0
- redlineai_sdk-0.2.0/redlineai_sdk.egg-info/requires.txt +6 -0
- redlineai_sdk-0.2.0/redlineai_sdk.egg-info/top_level.txt +1 -0
- redlineai_sdk-0.2.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Redline AI
|
|
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,187 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: redlineai-sdk
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Run your own agents inside Redline AI experiments — from your repo, with `redline dev`.
|
|
5
|
+
Author: Redline AI
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Redline AI
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://tryredlineai.co
|
|
29
|
+
Project-URL: Documentation, https://tryredlineai.co/docs/agents/your-agent
|
|
30
|
+
Project-URL: Source, https://github.com/hritvikgupta/redlineai
|
|
31
|
+
Project-URL: Issues, https://github.com/hritvikgupta/redlineai/issues
|
|
32
|
+
Keywords: agents,evaluation,benchmark,llm,ai,pydantic-ai,langchain,opentelemetry
|
|
33
|
+
Classifier: Development Status :: 4 - Beta
|
|
34
|
+
Classifier: Intended Audience :: Developers
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
42
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
43
|
+
Classifier: Topic :: Software Development :: Testing
|
|
44
|
+
Classifier: Typing :: Typed
|
|
45
|
+
Requires-Python: >=3.9
|
|
46
|
+
Description-Content-Type: text/markdown
|
|
47
|
+
License-File: LICENSE
|
|
48
|
+
Provides-Extra: otel
|
|
49
|
+
Requires-Dist: opentelemetry-sdk>=1.20; extra == "otel"
|
|
50
|
+
Provides-Extra: mcp
|
|
51
|
+
Requires-Dist: mcp>=1.9; extra == "mcp"
|
|
52
|
+
Dynamic: license-file
|
|
53
|
+
|
|
54
|
+
# redlineai-sdk
|
|
55
|
+
|
|
56
|
+
Run **your own agent** inside a [Redline](https://tryredlineai.co) experiment — from your
|
|
57
|
+
repository, on your machine, against the same tasks and rubrics as the agents in
|
|
58
|
+
the catalog.
|
|
59
|
+
|
|
60
|
+
Your agent does not move. It stays where it is, keeps its own dependencies and
|
|
61
|
+
its own model keys, and Redline sends it work.
|
|
62
|
+
|
|
63
|
+
## Install
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
pip install redlineai-sdk
|
|
67
|
+
redline init
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`init` writes `agents.py` — one file, holding one TODO.
|
|
71
|
+
|
|
72
|
+
## Wrap what you already wrote
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from redline import agent
|
|
76
|
+
from myapp.agent import your_agent # ← your existing code, unchanged
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@agent(id="my-agent", name="My Agent", description="Describe what it is good at.")
|
|
80
|
+
def run(task, ctx):
|
|
81
|
+
ctx.thinking("Working out what the task needs…")
|
|
82
|
+
return your_agent(task.prompt) # ← the one line that is yours
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Then:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
export REDLINE_API_KEY=rl_… # Agents page → Connect your agent
|
|
89
|
+
redline dev
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
That registers the agent with your project and holds a connection open. It now
|
|
93
|
+
appears on the Agents page, can be selected in an experiment, and runs on your
|
|
94
|
+
machine when one is launched.
|
|
95
|
+
|
|
96
|
+
There is no endpoint to expose and nothing deployed to us — `redline dev`
|
|
97
|
+
connects **outbound** and pulls its work, so it runs from a laptop behind NAT.
|
|
98
|
+
|
|
99
|
+
## Telemetry you do not have to write
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
pip install "redlineai-sdk[otel]"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Any framework that speaks OpenTelemetry — Pydantic AI, LangChain's
|
|
106
|
+
instrumentation, anything on the global tracer — has its LLM and tool spans land
|
|
107
|
+
in the run's transcript by itself. `ctx.thinking(...)` is there for what the
|
|
108
|
+
spans do not say.
|
|
109
|
+
|
|
110
|
+
## What an experiment gives your agent
|
|
111
|
+
|
|
112
|
+
An experiment can attach MCP servers, skills, CLIs and repositories. Those
|
|
113
|
+
arrive as **real tools**, not as prose in the prompt:
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
pip install "redlineai-sdk[mcp]"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
import asyncio
|
|
121
|
+
from redline import agent, redline_tools
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
@agent(id="my-agent", name="My Agent")
|
|
125
|
+
def run(task, ctx):
|
|
126
|
+
attached = asyncio.run(redline_tools(task)) # MCP tools + machine_run
|
|
127
|
+
return your_agent(task.prompt, tools=attached.as_openai_schema())
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`AttachedTools` also hands them over ready-shaped: `for_pydantic_ai()` returns
|
|
131
|
+
Pydantic AI `Tool`s, `for_langchain()` returns `StructuredTool`s.
|
|
132
|
+
|
|
133
|
+
If your agent uses Pydantic AI or LangChain, you can skip even that. `redline
|
|
134
|
+
dev` patches `pydantic_ai.Agent`, `langgraph.prebuilt.create_react_agent` and
|
|
135
|
+
`langchain.agents.create_tool_calling_agent` as they are constructed, so the
|
|
136
|
+
experiment's tools are already on your agent without a line of yours changing.
|
|
137
|
+
|
|
138
|
+
`machine_run` is the interesting one. An experiment that attaches a repository
|
|
139
|
+
clones it onto the project's machine, and your agent — running on your laptop —
|
|
140
|
+
reaches that machine through the tool. It is a computer with your task's
|
|
141
|
+
materials already on it.
|
|
142
|
+
|
|
143
|
+
## Your repo's environment
|
|
144
|
+
|
|
145
|
+
`redline dev` is a second entry point into your app, and your real one almost
|
|
146
|
+
always loads a `.env` first — so this one does too, searching the root and one
|
|
147
|
+
level down. Shell variables always win. `REDLINE_ENV_FILES=server/.env` takes
|
|
148
|
+
exact control.
|
|
149
|
+
|
|
150
|
+
## Commands
|
|
151
|
+
|
|
152
|
+
| | |
|
|
153
|
+
|---|---|
|
|
154
|
+
| `redline init` | write a starter `agents.py` |
|
|
155
|
+
| `redline dev` | register your agents and take work |
|
|
156
|
+
|
|
157
|
+
| | |
|
|
158
|
+
|---|---|
|
|
159
|
+
| `REDLINE_API_KEY` | runner key, `rl_…`, from the Agents page |
|
|
160
|
+
| `REDLINE_URL` | your Redline; defaults to `http://localhost:8790` |
|
|
161
|
+
|
|
162
|
+
## Where agents are found
|
|
163
|
+
|
|
164
|
+
`agents.py`, or every `*.py` in an `agents/` folder. Not `redline.py` — a file
|
|
165
|
+
by that name in your working directory shadows this package on `sys.path`, and
|
|
166
|
+
the import error it produces blames the wrong thing entirely.
|
|
167
|
+
|
|
168
|
+
## Names
|
|
169
|
+
|
|
170
|
+
| | |
|
|
171
|
+
|---|---|
|
|
172
|
+
| install | `pip install redlineai-sdk` |
|
|
173
|
+
| import | `from redline import agent` |
|
|
174
|
+
| npm | `@redlineai/sdk` |
|
|
175
|
+
|
|
176
|
+
The npm package is scoped and PyPI has no scopes, so `@redlineai/sdk` cannot
|
|
177
|
+
exist here — `redlineai-sdk` is the same name with the slash flattened. The
|
|
178
|
+
import stays `redline`, which is what you type a hundred times more often than
|
|
179
|
+
the install line.
|
|
180
|
+
|
|
181
|
+
`pip install redline-sdk` also works; it is a shim that installs this.
|
|
182
|
+
|
|
183
|
+
## Docs
|
|
184
|
+
|
|
185
|
+
<https://tryredlineai.co/docs/agents/your-agent>
|
|
186
|
+
|
|
187
|
+
MIT.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# redlineai-sdk
|
|
2
|
+
|
|
3
|
+
Run **your own agent** inside a [Redline](https://tryredlineai.co) experiment — from your
|
|
4
|
+
repository, on your machine, against the same tasks and rubrics as the agents in
|
|
5
|
+
the catalog.
|
|
6
|
+
|
|
7
|
+
Your agent does not move. It stays where it is, keeps its own dependencies and
|
|
8
|
+
its own model keys, and Redline sends it work.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
pip install redlineai-sdk
|
|
14
|
+
redline init
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`init` writes `agents.py` — one file, holding one TODO.
|
|
18
|
+
|
|
19
|
+
## Wrap what you already wrote
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from redline import agent
|
|
23
|
+
from myapp.agent import your_agent # ← your existing code, unchanged
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@agent(id="my-agent", name="My Agent", description="Describe what it is good at.")
|
|
27
|
+
def run(task, ctx):
|
|
28
|
+
ctx.thinking("Working out what the task needs…")
|
|
29
|
+
return your_agent(task.prompt) # ← the one line that is yours
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
export REDLINE_API_KEY=rl_… # Agents page → Connect your agent
|
|
36
|
+
redline dev
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
That registers the agent with your project and holds a connection open. It now
|
|
40
|
+
appears on the Agents page, can be selected in an experiment, and runs on your
|
|
41
|
+
machine when one is launched.
|
|
42
|
+
|
|
43
|
+
There is no endpoint to expose and nothing deployed to us — `redline dev`
|
|
44
|
+
connects **outbound** and pulls its work, so it runs from a laptop behind NAT.
|
|
45
|
+
|
|
46
|
+
## Telemetry you do not have to write
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
pip install "redlineai-sdk[otel]"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Any framework that speaks OpenTelemetry — Pydantic AI, LangChain's
|
|
53
|
+
instrumentation, anything on the global tracer — has its LLM and tool spans land
|
|
54
|
+
in the run's transcript by itself. `ctx.thinking(...)` is there for what the
|
|
55
|
+
spans do not say.
|
|
56
|
+
|
|
57
|
+
## What an experiment gives your agent
|
|
58
|
+
|
|
59
|
+
An experiment can attach MCP servers, skills, CLIs and repositories. Those
|
|
60
|
+
arrive as **real tools**, not as prose in the prompt:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
pip install "redlineai-sdk[mcp]"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
import asyncio
|
|
68
|
+
from redline import agent, redline_tools
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@agent(id="my-agent", name="My Agent")
|
|
72
|
+
def run(task, ctx):
|
|
73
|
+
attached = asyncio.run(redline_tools(task)) # MCP tools + machine_run
|
|
74
|
+
return your_agent(task.prompt, tools=attached.as_openai_schema())
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`AttachedTools` also hands them over ready-shaped: `for_pydantic_ai()` returns
|
|
78
|
+
Pydantic AI `Tool`s, `for_langchain()` returns `StructuredTool`s.
|
|
79
|
+
|
|
80
|
+
If your agent uses Pydantic AI or LangChain, you can skip even that. `redline
|
|
81
|
+
dev` patches `pydantic_ai.Agent`, `langgraph.prebuilt.create_react_agent` and
|
|
82
|
+
`langchain.agents.create_tool_calling_agent` as they are constructed, so the
|
|
83
|
+
experiment's tools are already on your agent without a line of yours changing.
|
|
84
|
+
|
|
85
|
+
`machine_run` is the interesting one. An experiment that attaches a repository
|
|
86
|
+
clones it onto the project's machine, and your agent — running on your laptop —
|
|
87
|
+
reaches that machine through the tool. It is a computer with your task's
|
|
88
|
+
materials already on it.
|
|
89
|
+
|
|
90
|
+
## Your repo's environment
|
|
91
|
+
|
|
92
|
+
`redline dev` is a second entry point into your app, and your real one almost
|
|
93
|
+
always loads a `.env` first — so this one does too, searching the root and one
|
|
94
|
+
level down. Shell variables always win. `REDLINE_ENV_FILES=server/.env` takes
|
|
95
|
+
exact control.
|
|
96
|
+
|
|
97
|
+
## Commands
|
|
98
|
+
|
|
99
|
+
| | |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `redline init` | write a starter `agents.py` |
|
|
102
|
+
| `redline dev` | register your agents and take work |
|
|
103
|
+
|
|
104
|
+
| | |
|
|
105
|
+
|---|---|
|
|
106
|
+
| `REDLINE_API_KEY` | runner key, `rl_…`, from the Agents page |
|
|
107
|
+
| `REDLINE_URL` | your Redline; defaults to `http://localhost:8790` |
|
|
108
|
+
|
|
109
|
+
## Where agents are found
|
|
110
|
+
|
|
111
|
+
`agents.py`, or every `*.py` in an `agents/` folder. Not `redline.py` — a file
|
|
112
|
+
by that name in your working directory shadows this package on `sys.path`, and
|
|
113
|
+
the import error it produces blames the wrong thing entirely.
|
|
114
|
+
|
|
115
|
+
## Names
|
|
116
|
+
|
|
117
|
+
| | |
|
|
118
|
+
|---|---|
|
|
119
|
+
| install | `pip install redlineai-sdk` |
|
|
120
|
+
| import | `from redline import agent` |
|
|
121
|
+
| npm | `@redlineai/sdk` |
|
|
122
|
+
|
|
123
|
+
The npm package is scoped and PyPI has no scopes, so `@redlineai/sdk` cannot
|
|
124
|
+
exist here — `redlineai-sdk` is the same name with the slash flattened. The
|
|
125
|
+
import stays `redline`, which is what you type a hundred times more often than
|
|
126
|
+
the install line.
|
|
127
|
+
|
|
128
|
+
`pip install redline-sdk` also works; it is a shim that installs this.
|
|
129
|
+
|
|
130
|
+
## Docs
|
|
131
|
+
|
|
132
|
+
<https://tryredlineai.co/docs/agents/your-agent>
|
|
133
|
+
|
|
134
|
+
MIT.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "redlineai-sdk"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
description = "Run your own agents inside Redline AI experiments — from your repo, with `redline dev`."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.9"
|
|
7
|
+
license = { file = "LICENSE" }
|
|
8
|
+
authors = [{ name = "Redline AI" }]
|
|
9
|
+
keywords = ["agents", "evaluation", "benchmark", "llm", "ai", "pydantic-ai", "langchain", "opentelemetry"]
|
|
10
|
+
# Standard library only. The SDK has to install into somebody's existing app
|
|
11
|
+
# without starting a dependency fight, and the worker loop needs nothing more
|
|
12
|
+
# than urllib.
|
|
13
|
+
dependencies = []
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.9",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
25
|
+
"Topic :: Software Development :: Testing",
|
|
26
|
+
"Typing :: Typed",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://tryredlineai.co"
|
|
31
|
+
Documentation = "https://tryredlineai.co/docs/agents/your-agent"
|
|
32
|
+
Source = "https://github.com/hritvikgupta/redlineai"
|
|
33
|
+
Issues = "https://github.com/hritvikgupta/redlineai/issues"
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
# `pip install redlineai-sdk[otel]` — automatic capture of framework telemetry
|
|
37
|
+
# (Pydantic AI, LangChain instrumentation, anything on the global tracer).
|
|
38
|
+
otel = ["opentelemetry-sdk>=1.20"]
|
|
39
|
+
# `pip install redlineai-sdk[mcp]` — attached MCP servers become callable tools
|
|
40
|
+
# via redline_tools(task).
|
|
41
|
+
mcp = ["mcp>=1.9"]
|
|
42
|
+
|
|
43
|
+
[project.scripts]
|
|
44
|
+
redline = "redline.cli:main"
|
|
45
|
+
|
|
46
|
+
[build-system]
|
|
47
|
+
requires = ["setuptools>=68"]
|
|
48
|
+
build-backend = "setuptools.build_meta"
|
|
49
|
+
|
|
50
|
+
[tool.setuptools.packages.find]
|
|
51
|
+
include = ["redline*"]
|
|
52
|
+
|
|
53
|
+
[tool.setuptools.package-data]
|
|
54
|
+
# The type hints are real; say so, or a consumer's type checker ignores them.
|
|
55
|
+
redline = ["py.typed"]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""redline — your agent, inside a Redline AI experiment.
|
|
2
|
+
|
|
3
|
+
The model is trigger.dev's, because it is the right one: your agent stays in
|
|
4
|
+
YOUR repo and YOUR process, with your keys and your framework. You mark it
|
|
5
|
+
with @agent, run `redline dev`, and the CLI connects OUTBOUND to the platform —
|
|
6
|
+
registers what you declared, claims runs targeted at it, executes your
|
|
7
|
+
function, and streams the record back while it works. No endpoint to expose,
|
|
8
|
+
nothing deployed to us; it works from a laptop behind NAT because the worker
|
|
9
|
+
pulls.
|
|
10
|
+
|
|
11
|
+
from redline import agent
|
|
12
|
+
|
|
13
|
+
@agent(id="research-agent", name="Research Agent")
|
|
14
|
+
def run(task, ctx):
|
|
15
|
+
ctx.thinking("planning…")
|
|
16
|
+
answer = my_existing_agent(task.prompt)
|
|
17
|
+
return answer
|
|
18
|
+
|
|
19
|
+
Telemetry is captured, not demanded: with `pip install redlineai-sdk[otel]`, a
|
|
20
|
+
framework that speaks OpenTelemetry — Pydantic AI, LangChain's instrumentation,
|
|
21
|
+
anything on the global tracer — has its LLM and tool spans land in the run's
|
|
22
|
+
transcript by themselves. `ctx` exists for whatever the spans do not say.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
from .types import Agent, Context, Task, agent
|
|
26
|
+
from .tools import AttachedTools, RedlineTool, install_clis, redline_tools
|
|
27
|
+
|
|
28
|
+
__all__ = [
|
|
29
|
+
"agent",
|
|
30
|
+
"Agent",
|
|
31
|
+
"Context",
|
|
32
|
+
"Task",
|
|
33
|
+
# What the experiment attached, as tools your agent can call.
|
|
34
|
+
"redline_tools",
|
|
35
|
+
"install_clis",
|
|
36
|
+
"AttachedTools",
|
|
37
|
+
"RedlineTool",
|
|
38
|
+
]
|