thoughtflow 0.0.2__py3-none-any.whl → 0.0.4__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.
- thoughtflow/__init__.py +57 -14
- thoughtflow/_util.py +713 -69
- thoughtflow/action.py +357 -0
- thoughtflow/agent.py +49 -130
- thoughtflow/llm.py +250 -0
- thoughtflow/memory/__init__.py +20 -15
- thoughtflow/memory/base.py +1615 -99
- thoughtflow/thought.py +1102 -0
- thoughtflow/thoughtflow6.py +4180 -0
- thoughtflow-0.0.4.dist-info/METADATA +1686 -0
- thoughtflow-0.0.4.dist-info/RECORD +25 -0
- thoughtflow/adapters/__init__.py +0 -43
- thoughtflow/adapters/anthropic.py +0 -119
- thoughtflow/adapters/base.py +0 -140
- thoughtflow/adapters/local.py +0 -133
- thoughtflow/adapters/openai.py +0 -118
- thoughtflow-0.0.2.dist-info/METADATA +0 -215
- thoughtflow-0.0.2.dist-info/RECORD +0 -26
- {thoughtflow-0.0.2.dist-info → thoughtflow-0.0.4.dist-info}/WHEEL +0 -0
- {thoughtflow-0.0.2.dist-info → thoughtflow-0.0.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: thoughtflow
|
|
3
|
-
Version: 0.0.2
|
|
4
|
-
Summary: A minimal, explicit, Pythonic substrate for building reproducible, portable, testable LLM and agent systems.
|
|
5
|
-
Project-URL: Homepage, https://github.com/jrolf/thoughtflow
|
|
6
|
-
Project-URL: Documentation, https://thoughtflow.dev
|
|
7
|
-
Project-URL: Repository, https://github.com/jrolf/thoughtflow
|
|
8
|
-
Project-URL: Issues, https://github.com/jrolf/thoughtflow/issues
|
|
9
|
-
Project-URL: Changelog, https://github.com/jrolf/thoughtflow/blob/main/CHANGELOG.md
|
|
10
|
-
Author-email: "James A. Rolfsen" <james@think.dev>
|
|
11
|
-
Maintainer-email: "James A. Rolfsen" <james@think.dev>
|
|
12
|
-
License: MIT License
|
|
13
|
-
|
|
14
|
-
Copyright (c) 2025 James A. Rolfsen
|
|
15
|
-
|
|
16
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
17
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
18
|
-
in the Software without restriction, including without limitation the rights
|
|
19
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
20
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
21
|
-
furnished to do so, subject to the following conditions:
|
|
22
|
-
|
|
23
|
-
The above copyright notice and this permission notice shall be included in all
|
|
24
|
-
copies or substantial portions of the Software.
|
|
25
|
-
|
|
26
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
27
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
28
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
29
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
30
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
31
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
32
|
-
SOFTWARE.
|
|
33
|
-
License-File: LICENSE
|
|
34
|
-
Keywords: agents,ai,anthropic,langchain-alternative,llm,machine-learning,openai,orchestration
|
|
35
|
-
Classifier: Development Status :: 3 - Alpha
|
|
36
|
-
Classifier: Intended Audience :: Developers
|
|
37
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
38
|
-
Classifier: Operating System :: OS Independent
|
|
39
|
-
Classifier: Programming Language :: Python :: 3
|
|
40
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
41
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
42
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
43
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
44
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
45
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
46
|
-
Classifier: Typing :: Typed
|
|
47
|
-
Requires-Python: >=3.9
|
|
48
|
-
Provides-Extra: all
|
|
49
|
-
Requires-Dist: anthropic>=0.18; extra == 'all'
|
|
50
|
-
Requires-Dist: mkdocs-material>=9.0; extra == 'all'
|
|
51
|
-
Requires-Dist: mkdocs>=1.5; extra == 'all'
|
|
52
|
-
Requires-Dist: mkdocstrings[python]>=0.24; extra == 'all'
|
|
53
|
-
Requires-Dist: mypy>=1.0; extra == 'all'
|
|
54
|
-
Requires-Dist: ollama>=0.1; extra == 'all'
|
|
55
|
-
Requires-Dist: openai>=1.0; extra == 'all'
|
|
56
|
-
Requires-Dist: pre-commit>=3.0; extra == 'all'
|
|
57
|
-
Requires-Dist: pytest-asyncio>=0.21; extra == 'all'
|
|
58
|
-
Requires-Dist: pytest-cov>=4.0; extra == 'all'
|
|
59
|
-
Requires-Dist: pytest>=7.0; extra == 'all'
|
|
60
|
-
Requires-Dist: ruff>=0.1; extra == 'all'
|
|
61
|
-
Provides-Extra: all-providers
|
|
62
|
-
Requires-Dist: anthropic>=0.18; extra == 'all-providers'
|
|
63
|
-
Requires-Dist: ollama>=0.1; extra == 'all-providers'
|
|
64
|
-
Requires-Dist: openai>=1.0; extra == 'all-providers'
|
|
65
|
-
Provides-Extra: anthropic
|
|
66
|
-
Requires-Dist: anthropic>=0.18; extra == 'anthropic'
|
|
67
|
-
Provides-Extra: dev
|
|
68
|
-
Requires-Dist: mypy>=1.0; extra == 'dev'
|
|
69
|
-
Requires-Dist: pre-commit>=3.0; extra == 'dev'
|
|
70
|
-
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
|
|
71
|
-
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
72
|
-
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
73
|
-
Requires-Dist: ruff>=0.1; extra == 'dev'
|
|
74
|
-
Provides-Extra: docs
|
|
75
|
-
Requires-Dist: mkdocs-material>=9.0; extra == 'docs'
|
|
76
|
-
Requires-Dist: mkdocs>=1.5; extra == 'docs'
|
|
77
|
-
Requires-Dist: mkdocstrings[python]>=0.24; extra == 'docs'
|
|
78
|
-
Provides-Extra: local
|
|
79
|
-
Requires-Dist: ollama>=0.1; extra == 'local'
|
|
80
|
-
Provides-Extra: openai
|
|
81
|
-
Requires-Dist: openai>=1.0; extra == 'openai'
|
|
82
|
-
Description-Content-Type: text/markdown
|
|
83
|
-
|
|
84
|
-
# ThoughtFlow
|
|
85
|
-
|
|
86
|
-
[](https://badge.fury.io/py/thoughtflow)
|
|
87
|
-
[](https://www.python.org/downloads/)
|
|
88
|
-
[](https://opensource.org/licenses/MIT)
|
|
89
|
-
[](https://github.com/jrolf/thoughtflow/actions/workflows/ci.yml)
|
|
90
|
-
|
|
91
|
-
**A minimal, explicit, Pythonic substrate for building reproducible, portable, testable LLM and agent systems.**
|
|
92
|
-
|
|
93
|
-
> *Tiny surface area. Explicit state. Portable execution. Deterministic testing.*
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## Why ThoughtFlow?
|
|
98
|
-
|
|
99
|
-
The modern LLM/agent ecosystem often evolves into abstraction swamps—hidden state, magical callbacks, and frameworks that are hard to understand, test, and deploy.
|
|
100
|
-
|
|
101
|
-
**ThoughtFlow takes a different path:**
|
|
102
|
-
|
|
103
|
-
- ✅ **No hidden agent runtime** you can't reason about
|
|
104
|
-
- ✅ **No graph DSL** you must adopt to do anything serious
|
|
105
|
-
- ✅ **No implicit global memory** or callback chains
|
|
106
|
-
- ✅ **No abstraction layers** whose main job is wrapping other abstractions
|
|
107
|
-
|
|
108
|
-
Instead, ThoughtFlow makes orchestration logic **plain Python**: explicit inputs, explicit outputs, explicit state transitions, replayable sessions, deterministic evaluation paths.
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Installation
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
# Core library (zero dependencies)
|
|
116
|
-
pip install thoughtflow
|
|
117
|
-
|
|
118
|
-
# With OpenAI support
|
|
119
|
-
pip install thoughtflow[openai]
|
|
120
|
-
|
|
121
|
-
# With Anthropic support
|
|
122
|
-
pip install thoughtflow[anthropic]
|
|
123
|
-
|
|
124
|
-
# With all providers
|
|
125
|
-
pip install thoughtflow[all-providers]
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## Quick Start
|
|
131
|
-
|
|
132
|
-
```python
|
|
133
|
-
from thoughtflow import Agent
|
|
134
|
-
from thoughtflow.adapters import OpenAIAdapter
|
|
135
|
-
|
|
136
|
-
# Create an adapter for your provider
|
|
137
|
-
adapter = OpenAIAdapter(api_key="your-api-key")
|
|
138
|
-
|
|
139
|
-
# Create an agent
|
|
140
|
-
agent = Agent(adapter)
|
|
141
|
-
|
|
142
|
-
# Call with a message list (the universal currency)
|
|
143
|
-
response = agent.call([
|
|
144
|
-
{"role": "system", "content": "You are a helpful assistant."},
|
|
145
|
-
{"role": "user", "content": "What is ThoughtFlow?"}
|
|
146
|
-
])
|
|
147
|
-
|
|
148
|
-
print(response)
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
## Core Concepts
|
|
154
|
-
|
|
155
|
-
### The Agent Contract
|
|
156
|
-
|
|
157
|
-
An Agent is something that can be called with messages and parameters:
|
|
158
|
-
|
|
159
|
-
```python
|
|
160
|
-
class Agent:
|
|
161
|
-
def call(self, msg_list, params=None):
|
|
162
|
-
raise NotImplementedError
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
That's it. Everything else is composition.
|
|
166
|
-
|
|
167
|
-
### Messages: Stable Schema, Minimal Assumptions
|
|
168
|
-
|
|
169
|
-
```python
|
|
170
|
-
msg_list = [
|
|
171
|
-
{"role": "system", "content": "You are a helpful assistant."},
|
|
172
|
-
{"role": "user", "content": "Draft 3 names for a company."},
|
|
173
|
-
]
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Explicit Tracing
|
|
177
|
-
|
|
178
|
-
```python
|
|
179
|
-
from thoughtflow.trace import Session
|
|
180
|
-
|
|
181
|
-
session = Session()
|
|
182
|
-
response = agent.call(msg_list, session=session)
|
|
183
|
-
|
|
184
|
-
# Session captures everything: inputs, outputs, timing, tokens, costs
|
|
185
|
-
print(session.to_dict())
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## Design Principles
|
|
191
|
-
|
|
192
|
-
1. **Tiny Surface Area**: Few powerful primitives over many specialized classes
|
|
193
|
-
2. **Explicit State**: All state is visible, serializable, and replayable
|
|
194
|
-
3. **Portability**: Works across OpenAI, Anthropic, local models, serverless
|
|
195
|
-
4. **Deterministic Testing**: Record/replay workflows, stable sessions, predictable behavior
|
|
196
|
-
|
|
197
|
-
---
|
|
198
|
-
|
|
199
|
-
## Project Status
|
|
200
|
-
|
|
201
|
-
🚧 **Alpha** - ThoughtFlow is under active development. The API may change.
|
|
202
|
-
|
|
203
|
-
See the [CHANGELOG](CHANGELOG.md) for version history.
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## Contributing
|
|
208
|
-
|
|
209
|
-
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## License
|
|
214
|
-
|
|
215
|
-
[MIT](LICENSE) © James A. Rolfsen
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
thoughtflow/__init__.py,sha256=Jc_g5TDgnMFq3vNI5IBO8Xaja-f-KtjmW9NatIkUtYI,1375
|
|
2
|
-
thoughtflow/_util.py,sha256=64QWe9TV3reyhmnlZDO_c3AtntHY6AFXe4MyqpJ20hs,2804
|
|
3
|
-
thoughtflow/agent.py,sha256=yRL3OA1anQ6r_TUj8ncy0ZT5GF0G0rYaZxdV_YdpMig,4290
|
|
4
|
-
thoughtflow/message.py,sha256=5hR2Zs3tDRYLtYuuArqmJ4CgBDTUhjHj_RQhCN7tRrg,3800
|
|
5
|
-
thoughtflow/py.typed,sha256=Y3QpSe9qtWcL1vKplcWdRY0cn5071TLJQWBO0QbxTm8,84
|
|
6
|
-
thoughtflow/adapters/__init__.py,sha256=OmGEgr08B7kwsSydINBQzsW5S_YDrzhLII05F1aqdak,1235
|
|
7
|
-
thoughtflow/adapters/anthropic.py,sha256=IS-viYzbgde0em5cPiKkn8yQ6oHvkvBKL5_4JIBywG8,3500
|
|
8
|
-
thoughtflow/adapters/base.py,sha256=vZE3M84AiPWSaGJIEKjkfB-FEgEswtBahNuHC_yBuhs,4102
|
|
9
|
-
thoughtflow/adapters/local.py,sha256=XsCRtZ2HhLjXIOj-Du_RwLLgEOwGDVjvnQpze97wM1w,4037
|
|
10
|
-
thoughtflow/adapters/openai.py,sha256=RcE5Le__j8P_UQf3dF8WMTW1Ie7zTNYgBUOWK7r1Tcc,3287
|
|
11
|
-
thoughtflow/eval/__init__.py,sha256=WiXk5IarMdgQV-mCpWVq_ZwCq6iC6pAKwl9wbZsmmNA,866
|
|
12
|
-
thoughtflow/eval/harness.py,sha256=DH8EGajfxIGsb9HLk7g-hnQM0t1C90VAk7bOPLK9OBQ,5505
|
|
13
|
-
thoughtflow/eval/replay.py,sha256=-osU4BbjVdThLeM1bygCss7sqqHHvg9I43XEvVZkNd8,4011
|
|
14
|
-
thoughtflow/memory/__init__.py,sha256=jwakjf3Rfi4Rk9HfadNHy6WGJ3VNG9GI3gSZO5Ebe5I,691
|
|
15
|
-
thoughtflow/memory/base.py,sha256=WjnrJYT_b72BX3M6DontoVNhNW-SGVDbR2bAtyxy1-Q,4224
|
|
16
|
-
thoughtflow/tools/__init__.py,sha256=1bDivRtNS2rGDForiLMOGKjStBeZAWFH8wylAN3Ihjk,648
|
|
17
|
-
thoughtflow/tools/base.py,sha256=VYRFDhzG912HFUR6W82kykm_FU-r4xg4aEzHBDN_b8M,4069
|
|
18
|
-
thoughtflow/tools/registry.py,sha256=ERKStxvh_UkfLg7GebVFaifSuudFYAfYXbnxr7lC5o0,3335
|
|
19
|
-
thoughtflow/trace/__init__.py,sha256=fQSpJJyYdtaI_L_QAD4NqvYA6yXS5xCJXxS5-rVUpoM,891
|
|
20
|
-
thoughtflow/trace/events.py,sha256=jJtVzs2xSLb43CAW6_CqgBVGgM0gBJ1x-_xmQjwUGkw,4647
|
|
21
|
-
thoughtflow/trace/schema.py,sha256=teyUJ3gV80ZgsU8oCYJmku_f-SDULKtvqqLjvp1eQ_E,3180
|
|
22
|
-
thoughtflow/trace/session.py,sha256=ZYKMGe3t98A7LujG-nSuRQo83BvzqhZGKFXHZZU0amw,4225
|
|
23
|
-
thoughtflow-0.0.2.dist-info/METADATA,sha256=50ieenI8zDoK1IuHmNU1Tpa4ginxmUUuY7DQ5hw_Hck,7548
|
|
24
|
-
thoughtflow-0.0.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
25
|
-
thoughtflow-0.0.2.dist-info/licenses/LICENSE,sha256=Z__Z0xyty_n2lxI7UNvfqkgemXIP0_UliF5sZN8GsPw,1073
|
|
26
|
-
thoughtflow-0.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|