thoughtflow 0.0.2__tar.gz → 0.0.3__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.
Files changed (54) hide show
  1. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/.gitignore +1 -0
  2. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/PKG-INFO +1 -1
  3. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/pyproject.toml +1 -1
  4. thoughtflow-0.0.3/src/thoughtflow/__init__.py +99 -0
  5. thoughtflow-0.0.3/src/thoughtflow/_util.py +752 -0
  6. thoughtflow-0.0.3/src/thoughtflow/action.py +357 -0
  7. thoughtflow-0.0.3/src/thoughtflow/agent.py +66 -0
  8. thoughtflow-0.0.3/src/thoughtflow/llm.py +250 -0
  9. thoughtflow-0.0.3/src/thoughtflow/memory/__init__.py +32 -0
  10. thoughtflow-0.0.3/src/thoughtflow/memory/base.py +1658 -0
  11. thoughtflow-0.0.3/src/thoughtflow/thought.py +1102 -0
  12. thoughtflow-0.0.3/src/thoughtflow/thoughtflow6.py +4180 -0
  13. thoughtflow-0.0.3/tests/conftest.py +429 -0
  14. thoughtflow-0.0.3/tests/integration/test_llm_providers.py +492 -0
  15. thoughtflow-0.0.3/tests/unit/test_action.py +421 -0
  16. thoughtflow-0.0.3/tests/unit/test_agent.py +69 -0
  17. thoughtflow-0.0.3/tests/unit/test_llm.py +469 -0
  18. thoughtflow-0.0.3/tests/unit/test_memory.py +1104 -0
  19. thoughtflow-0.0.3/tests/unit/test_thought.py +501 -0
  20. thoughtflow-0.0.3/tests/unit/test_util.py +890 -0
  21. thoughtflow-0.0.2/src/thoughtflow/__init__.py +0 -56
  22. thoughtflow-0.0.2/src/thoughtflow/_util.py +0 -108
  23. thoughtflow-0.0.2/src/thoughtflow/adapters/__init__.py +0 -43
  24. thoughtflow-0.0.2/src/thoughtflow/adapters/anthropic.py +0 -119
  25. thoughtflow-0.0.2/src/thoughtflow/adapters/base.py +0 -140
  26. thoughtflow-0.0.2/src/thoughtflow/adapters/local.py +0 -133
  27. thoughtflow-0.0.2/src/thoughtflow/adapters/openai.py +0 -118
  28. thoughtflow-0.0.2/src/thoughtflow/agent.py +0 -147
  29. thoughtflow-0.0.2/src/thoughtflow/memory/__init__.py +0 -27
  30. thoughtflow-0.0.2/src/thoughtflow/memory/base.py +0 -142
  31. thoughtflow-0.0.2/tests/conftest.py +0 -165
  32. thoughtflow-0.0.2/tests/unit/test_agent.py +0 -84
  33. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/CHANGELOG.md +0 -0
  34. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/LICENSE +0 -0
  35. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/README.md +0 -0
  36. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/src/thoughtflow/eval/__init__.py +0 -0
  37. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/src/thoughtflow/eval/harness.py +0 -0
  38. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/src/thoughtflow/eval/replay.py +0 -0
  39. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/src/thoughtflow/message.py +0 -0
  40. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/src/thoughtflow/py.typed +0 -0
  41. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/src/thoughtflow/tools/__init__.py +0 -0
  42. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/src/thoughtflow/tools/base.py +0 -0
  43. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/src/thoughtflow/tools/registry.py +0 -0
  44. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/src/thoughtflow/trace/__init__.py +0 -0
  45. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/src/thoughtflow/trace/events.py +0 -0
  46. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/src/thoughtflow/trace/schema.py +0 -0
  47. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/src/thoughtflow/trace/session.py +0 -0
  48. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/tests/__init__.py +0 -0
  49. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/tests/integration/__init__.py +0 -0
  50. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/tests/integration/test_anthropic_adapter.py +0 -0
  51. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/tests/integration/test_openai_adapter.py +0 -0
  52. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/tests/unit/__init__.py +0 -0
  53. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/tests/unit/test_message.py +0 -0
  54. {thoughtflow-0.0.2 → thoughtflow-0.0.3}/tests/unit/test_trace.py +0 -0
@@ -160,3 +160,4 @@ cython_debug/
160
160
  # and can be added to the global gitignore or merged into this file. For a more nuclear
161
161
  # option (not recommended) you can uncomment the following to ignore the entire idea folder.
162
162
  #.idea/
163
+ .DS_Store
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thoughtflow
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: A minimal, explicit, Pythonic substrate for building reproducible, portable, testable LLM and agent systems.
5
5
  Project-URL: Homepage, https://github.com/jrolf/thoughtflow
6
6
  Project-URL: Documentation, https://thoughtflow.dev
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "thoughtflow"
7
- version = "0.0.2"
7
+ version = "0.0.3"
8
8
  description = "A minimal, explicit, Pythonic substrate for building reproducible, portable, testable LLM and agent systems."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -0,0 +1,99 @@
1
+ """
2
+ ThoughtFlow: A minimal, explicit, Pythonic substrate for LLM and agent systems.
3
+
4
+ Core Philosophy:
5
+ - Tiny surface area: Few powerful primitives over many specialized classes
6
+ - Explicit state: All state is visible, serializable, and replayable
7
+ - Portability: Works across OpenAI, Anthropic, local models, serverless
8
+ - Deterministic testing: Record/replay workflows, stable sessions
9
+
10
+ Core Primitives:
11
+ - LLM: Multi-provider interface for language model calls
12
+ - MEMORY: Event-sourced state container (messages, logs, reflections, variables)
13
+ - THOUGHT: Unit of cognition (Prompt + Context + LLM + Parsing + Validation)
14
+ - ACTION: External operation wrapper with consistent logging
15
+
16
+ Basic Usage:
17
+ >>> from thoughtflow import LLM, MEMORY, THOUGHT
18
+ >>>
19
+ >>> llm = LLM("openai:gpt-4o", key="your-api-key")
20
+ >>> memory = MEMORY()
21
+ >>> memory.add_msg("user", "Hello!")
22
+ >>>
23
+ >>> thought = THOUGHT(
24
+ ... name="respond",
25
+ ... llm=llm,
26
+ ... prompt="Respond to the user message: {last_user_msg}"
27
+ ... )
28
+ >>> memory = thought(memory)
29
+ >>> result = memory.get_var("respond_result")
30
+ """
31
+
32
+ from __future__ import annotations
33
+
34
+ # Core primitives
35
+ from thoughtflow.llm import LLM
36
+ from thoughtflow.memory.base import MEMORY
37
+ from thoughtflow.thought import THOUGHT
38
+ from thoughtflow.action import ACTION
39
+
40
+ # Utilities
41
+ from thoughtflow._util import (
42
+ EventStamp,
43
+ event_stamp,
44
+ hashify,
45
+ construct_prompt,
46
+ construct_msgs,
47
+ valid_extract,
48
+ ValidExtractError,
49
+ )
50
+
51
+ # Deprecated (for backward compatibility)
52
+ from thoughtflow.agent import Agent, TracedAgent
53
+
54
+ # Keep message types for potential utility
55
+ from thoughtflow.message import Message, MessageList
56
+
57
+ # Submodule access (keep tools, trace, eval for advanced usage)
58
+ from thoughtflow import tools
59
+ from thoughtflow import memory
60
+ from thoughtflow import trace
61
+ from thoughtflow import eval
62
+
63
+ # Version
64
+ try:
65
+ from importlib.metadata import version as _get_version
66
+
67
+ __version__ = _get_version("thoughtflow")
68
+ except Exception:
69
+ __version__ = "0.0.0"
70
+
71
+ # Public API
72
+ __all__ = [
73
+ # Core Primitives
74
+ "LLM",
75
+ "MEMORY",
76
+ "THOUGHT",
77
+ "ACTION",
78
+ # Utilities
79
+ "EventStamp",
80
+ "event_stamp",
81
+ "hashify",
82
+ "construct_prompt",
83
+ "construct_msgs",
84
+ "valid_extract",
85
+ "ValidExtractError",
86
+ # Types
87
+ "Message",
88
+ "MessageList",
89
+ # Deprecated
90
+ "Agent",
91
+ "TracedAgent",
92
+ # Submodules
93
+ "tools",
94
+ "memory",
95
+ "trace",
96
+ "eval",
97
+ # Metadata
98
+ "__version__",
99
+ ]