chatterer 0.1.7__py3-none-any.whl → 0.1.8__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.
@@ -1,166 +1,166 @@
1
- Metadata-Version: 2.4
2
- Name: chatterer
3
- Version: 0.1.7
4
- Summary: The highest-level interface for various LLM APIs.
5
- Requires-Python: >=3.12
6
- Description-Content-Type: text/markdown
7
- Requires-Dist: instructor>=1.7.2
8
- Requires-Dist: langchain>=0.3.19
9
- Provides-Extra: dev
10
- Requires-Dist: neo4j-extension>=0.1.14; extra == "dev"
11
- Requires-Dist: colorama>=0.4.6; extra == "dev"
12
- Requires-Dist: ipykernel>=6.29.5; extra == "dev"
13
- Provides-Extra: conversion
14
- Requires-Dist: markdownify>=1.1.0; extra == "conversion"
15
- Requires-Dist: commonmark>=0.9.1; extra == "conversion"
16
- Requires-Dist: playwright>=1.50.0; extra == "conversion"
17
- Requires-Dist: pillow>=11.1.0; extra == "conversion"
18
- Requires-Dist: mistune>=3.1.2; extra == "conversion"
19
- Requires-Dist: markitdown>=0.0.2; extra == "conversion"
20
- Requires-Dist: pymupdf>=1.25.4; extra == "conversion"
21
- Provides-Extra: langchain-providers
22
- Requires-Dist: langchain-openai>=0.3.7; extra == "langchain-providers"
23
- Requires-Dist: langchain-anthropic>=0.3.8; extra == "langchain-providers"
24
- Requires-Dist: langchain-google-genai>=2.0.10; extra == "langchain-providers"
25
- Requires-Dist: langchain-ollama>=0.2.3; extra == "langchain-providers"
26
- Provides-Extra: all
27
- Requires-Dist: chatterer[langchain-providers]; extra == "all"
28
- Requires-Dist: chatterer[conversion]; extra == "all"
29
- Requires-Dist: chatterer[dev]; extra == "all"
30
-
31
- # Chatterer
32
-
33
- **Simplified, Structured AI Assistant Framework**
34
-
35
- `chatterer` is a Python library designed as a type-safe LangChain wrapper for interacting with various language models (OpenAI, Anthropic, Gemini, Ollama, etc.). It supports structured outputs via Pydantic models, plain text responses, and asynchronous calls.
36
-
37
- The structured reasoning in `chatterer` is inspired by the [Atom-of-Thought](https://github.com/qixucen/atom) pipeline.
38
-
39
- ---
40
-
41
- ## Quick Install
42
-
43
- ```bash
44
- pip install chatterer
45
- ```
46
-
47
- ---
48
-
49
- ## Quickstart Example
50
-
51
- Generate text quickly using OpenAI:
52
-
53
- ```python
54
- from chatterer import Chatterer
55
-
56
- chat = Chatterer.openai("gpt-4o-mini")
57
- response = chat.generate("What is the meaning of life?")
58
- print(response)
59
- ```
60
-
61
- Messages can be input as plain strings or structured lists:
62
-
63
- ```python
64
- response = chat.generate([{ "role": "user", "content": "What's 2+2?" }])
65
- print(response)
66
- ```
67
-
68
- ### Structured Output with Pydantic
69
-
70
- ```python
71
- from pydantic import BaseModel
72
-
73
- class AnswerModel(BaseModel):
74
- question: str
75
- answer: str
76
-
77
- response = chat.generate_pydantic(AnswerModel, "What's the capital of France?")
78
- print(response.question, response.answer)
79
- ```
80
-
81
- ### Async Example
82
-
83
- ```python
84
- import asyncio
85
-
86
- async def main():
87
- response = await chat.agenerate("Explain async in Python briefly.")
88
- print(response)
89
-
90
- asyncio.run(main())
91
- ```
92
-
93
- ---
94
-
95
- ## Atom-of-Thought Pipeline (AoT)
96
-
97
- `AoTPipeline` provides structured reasoning by:
98
-
99
- - Detecting question domains (general, math, coding, philosophy, multihop).
100
- - Decomposing questions recursively.
101
- - Generating direct, decomposition-based, and simplified answers.
102
- - Combining answers via ensemble.
103
-
104
- ### AoT Usage Example
105
-
106
- ```python
107
- from chatterer import Chatterer
108
- from chatterer.strategies import AoTStrategy, AoTPipeline
109
-
110
- pipeline = AoTPipeline(chatterer=Chatterer.openai(), max_depth=2)
111
- strategy = AoTStrategy(pipeline=pipeline)
112
-
113
- question = "What would Newton discover if hit by an apple falling from 100 meters?"
114
- answer = strategy.invoke(question)
115
- print(answer)
116
- ```
117
-
118
- ---
119
-
120
- ## Supported Models
121
-
122
- - **OpenAI**
123
- - **Anthropic**
124
- - **Google Gemini**
125
- - **Ollama** (local models)
126
-
127
- Initialize models easily:
128
-
129
- ```python
130
- openai_chat = Chatterer.openai("gpt-4o-mini")
131
- anthropic_chat = Chatterer.anthropic("claude-3-7-sonnet-20250219")
132
- gemini_chat = Chatterer.google("gemini-2.0-flash")
133
- ollama_chat = Chatterer.ollama("deepseek-r1:1.5b")
134
- ```
135
-
136
- ---
137
-
138
- ## Advanced Features
139
-
140
- - **Streaming responses**
141
- - **Async/Await support**
142
- - **Structured outputs with Pydantic models**
143
-
144
- ---
145
-
146
- ## Logging
147
-
148
- Built-in logging for easy debugging:
149
-
150
- ```python
151
- import logging
152
- logging.basicConfig(level=logging.DEBUG)
153
- ```
154
-
155
- ---
156
-
157
- ## Contributing
158
-
159
- Feel free to open an issue or pull request.
160
-
161
- ---
162
-
163
- ## License
164
-
165
- MIT License
166
-
1
+ Metadata-Version: 2.4
2
+ Name: chatterer
3
+ Version: 0.1.8
4
+ Summary: The highest-level interface for various LLM APIs.
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: instructor>=1.7.2
8
+ Requires-Dist: langchain>=0.3.19
9
+ Provides-Extra: dev
10
+ Requires-Dist: neo4j-extension>=0.1.14; extra == "dev"
11
+ Requires-Dist: colorama>=0.4.6; extra == "dev"
12
+ Requires-Dist: ipykernel>=6.29.5; extra == "dev"
13
+ Provides-Extra: conversion
14
+ Requires-Dist: markdownify>=1.1.0; extra == "conversion"
15
+ Requires-Dist: commonmark>=0.9.1; extra == "conversion"
16
+ Requires-Dist: playwright>=1.50.0; extra == "conversion"
17
+ Requires-Dist: pillow>=11.1.0; extra == "conversion"
18
+ Requires-Dist: mistune>=3.1.2; extra == "conversion"
19
+ Requires-Dist: markitdown>=0.0.2; extra == "conversion"
20
+ Requires-Dist: pymupdf>=1.25.4; extra == "conversion"
21
+ Provides-Extra: langchain-providers
22
+ Requires-Dist: langchain-openai>=0.3.7; extra == "langchain-providers"
23
+ Requires-Dist: langchain-anthropic>=0.3.8; extra == "langchain-providers"
24
+ Requires-Dist: langchain-google-genai>=2.0.10; extra == "langchain-providers"
25
+ Requires-Dist: langchain-ollama>=0.2.3; extra == "langchain-providers"
26
+ Provides-Extra: all
27
+ Requires-Dist: chatterer[langchain-providers]; extra == "all"
28
+ Requires-Dist: chatterer[conversion]; extra == "all"
29
+ Requires-Dist: chatterer[dev]; extra == "all"
30
+
31
+ # Chatterer
32
+
33
+ **Simplified, Structured AI Assistant Framework**
34
+
35
+ `chatterer` is a Python library designed as a type-safe LangChain wrapper for interacting with various language models (OpenAI, Anthropic, Gemini, Ollama, etc.). It supports structured outputs via Pydantic models, plain text responses, and asynchronous calls.
36
+
37
+ The structured reasoning in `chatterer` is inspired by the [Atom-of-Thought](https://github.com/qixucen/atom) pipeline.
38
+
39
+ ---
40
+
41
+ ## Quick Install
42
+
43
+ ```bash
44
+ pip install chatterer
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Quickstart Example
50
+
51
+ Generate text quickly using OpenAI:
52
+
53
+ ```python
54
+ from chatterer import Chatterer
55
+
56
+ chat = Chatterer.openai("gpt-4o-mini")
57
+ response = chat.generate("What is the meaning of life?")
58
+ print(response)
59
+ ```
60
+
61
+ Messages can be input as plain strings or structured lists:
62
+
63
+ ```python
64
+ response = chat.generate([{ "role": "user", "content": "What's 2+2?" }])
65
+ print(response)
66
+ ```
67
+
68
+ ### Structured Output with Pydantic
69
+
70
+ ```python
71
+ from pydantic import BaseModel
72
+
73
+ class AnswerModel(BaseModel):
74
+ question: str
75
+ answer: str
76
+
77
+ response = chat.generate_pydantic(AnswerModel, "What's the capital of France?")
78
+ print(response.question, response.answer)
79
+ ```
80
+
81
+ ### Async Example
82
+
83
+ ```python
84
+ import asyncio
85
+
86
+ async def main():
87
+ response = await chat.agenerate("Explain async in Python briefly.")
88
+ print(response)
89
+
90
+ asyncio.run(main())
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Atom-of-Thought Pipeline (AoT)
96
+
97
+ `AoTPipeline` provides structured reasoning by:
98
+
99
+ - Detecting question domains (general, math, coding, philosophy, multihop).
100
+ - Decomposing questions recursively.
101
+ - Generating direct, decomposition-based, and simplified answers.
102
+ - Combining answers via ensemble.
103
+
104
+ ### AoT Usage Example
105
+
106
+ ```python
107
+ from chatterer import Chatterer
108
+ from chatterer.strategies import AoTStrategy, AoTPipeline
109
+
110
+ pipeline = AoTPipeline(chatterer=Chatterer.openai(), max_depth=2)
111
+ strategy = AoTStrategy(pipeline=pipeline)
112
+
113
+ question = "What would Newton discover if hit by an apple falling from 100 meters?"
114
+ answer = strategy.invoke(question)
115
+ print(answer)
116
+ ```
117
+
118
+ ---
119
+
120
+ ## Supported Models
121
+
122
+ - **OpenAI**
123
+ - **Anthropic**
124
+ - **Google Gemini**
125
+ - **Ollama** (local models)
126
+
127
+ Initialize models easily:
128
+
129
+ ```python
130
+ openai_chat = Chatterer.openai("gpt-4o-mini")
131
+ anthropic_chat = Chatterer.anthropic("claude-3-7-sonnet-20250219")
132
+ gemini_chat = Chatterer.google("gemini-2.0-flash")
133
+ ollama_chat = Chatterer.ollama("deepseek-r1:1.5b")
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Advanced Features
139
+
140
+ - **Streaming responses**
141
+ - **Async/Await support**
142
+ - **Structured outputs with Pydantic models**
143
+
144
+ ---
145
+
146
+ ## Logging
147
+
148
+ Built-in logging for easy debugging:
149
+
150
+ ```python
151
+ import logging
152
+ logging.basicConfig(level=logging.DEBUG)
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Contributing
158
+
159
+ Feel free to open an issue or pull request.
160
+
161
+ ---
162
+
163
+ ## License
164
+
165
+ MIT License
166
+
@@ -0,0 +1,24 @@
1
+ chatterer/__init__.py,sha256=kl8VWiDJIt5IQjaBpQu13n0GrzP3qzaNXyA68B1xHTE,802
2
+ chatterer/language_model.py,sha256=S8x2IbzZBi1mAKSKrGuoB4-gfKBz73RCNXt_H-fiDzc,13826
3
+ chatterer/messages.py,sha256=-NyOIK7wJI1uVD8qaJPeLA0LqirFEsZ1mOYoO1F2wLc,188
4
+ chatterer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ chatterer/strategies/__init__.py,sha256=SdOggbmHpw4f7Njwy-T8q64e91OLOUp1k0a0ozZd4qI,221
6
+ chatterer/strategies/atom_of_thoughts.py,sha256=CygOCLu5vLk-fzY9O-iE3qLShfjD7iY40ks9jH4ULBM,40872
7
+ chatterer/strategies/base.py,sha256=b2gMPqodp97OP1dkHfj0UqixjdjVhmTw_V5qJ7i2S6g,427
8
+ chatterer/tools/__init__.py,sha256=yA4RcHIAO33xsmWXQTmtSm9bk1p80yJKSadtMa3X-aY,415
9
+ chatterer/tools/convert_to_text.py,sha256=kBqxCJ0IoiAw2eiPYqep_SPZm-TtYKF7mdACLsWQUuI,15915
10
+ chatterer/tools/citation_chunking/__init__.py,sha256=gG7Fnkkp28UpcWMbfMY_4gqzZSZ8QzlhalHBoeoq7K0,82
11
+ chatterer/tools/citation_chunking/chunks.py,sha256=50Dpa43RaYftlNox8tM1qI8htZ3_AJ9Uyyn02WsmxYk,2173
12
+ chatterer/tools/citation_chunking/citation_chunker.py,sha256=yx5O9pUkowlNcFyyNf7f3sbq7-CV8AXOzFnviDldPR8,4894
13
+ chatterer/tools/citation_chunking/citations.py,sha256=RWVJA38yvlER9PhLDPZnqaRsbQ334W4FDQXBqGpdi08,12593
14
+ chatterer/tools/citation_chunking/prompt.py,sha256=S0Z6v8R23_Vknt3qYyjoDE1_gBsb0fCEx7LIw7BFXmA,7714
15
+ chatterer/tools/citation_chunking/reference.py,sha256=uRKufkU41Zedz6MQUCy-aCk4Rwxg94m4b332zKDpXAs,919
16
+ chatterer/tools/citation_chunking/utils.py,sha256=M4pH2-UIE1VLzQLXDqjEe4L3Xcy0e0KhAP3I2U2BNms,6348
17
+ chatterer/tools/webpage_to_markdown/__init__.py,sha256=bHH4qfnXyw8Zz-yBPLaTezF1sh9njvNBJmhBVtcpjsA,123
18
+ chatterer/tools/webpage_to_markdown/playwright_bot.py,sha256=yP0KixYZNQ4Kn_ZCFDI3mVyBD_DpUGfqgklpaGJUTCU,27496
19
+ chatterer/tools/webpage_to_markdown/utils.py,sha256=ZLUU94imYciEdynD2K7Dmcsbt8BVQTaOP56Ba6DAFvk,12593
20
+ chatterer/utils/image.py,sha256=F3_D1677UDFlgp-UQBS_ChkNODzf_VOfjYNSUi02MaI,10852
21
+ chatterer-0.1.8.dist-info/METADATA,sha256=01CGNp0oae5VdHM5gzqPKYFtlSqufE0h5XFMdn2E_6c,4234
22
+ chatterer-0.1.8.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
23
+ chatterer-0.1.8.dist-info/top_level.txt,sha256=7nSQKP0bHxPRc7HyzdbKsJdkvPgYD0214o6slRizv9s,10
24
+ chatterer-0.1.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (77.0.1)
2
+ Generator: setuptools (77.0.3)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,24 +0,0 @@
1
- chatterer/__init__.py,sha256=YQN_nZclqzZ_dbzxG10NJHRh1VzyjL7vwXETW5un19U,763
2
- chatterer/language_model.py,sha256=ksOg-ZuIaP7qy982pGT8uuYGMgzUHqotXQovNVktoeE,13455
3
- chatterer/messages.py,sha256=miHn3QOcZH8yjR9W5WRFxLvjO8kIyPhcsgoeojT7ByU,180
4
- chatterer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- chatterer/strategies/__init__.py,sha256=oroDpp5ppWralCER5wnf8fgX77dqLAPF0ogmRtRzQfU,208
6
- chatterer/strategies/atom_of_thoughts.py,sha256=g801rY7k5UeNOq2-XRqB4h8sXjikVNzN57G6OtiUH00,39897
7
- chatterer/strategies/base.py,sha256=rqOzTo6S2eQ3A_F9aBXCmVoLM1eT6F2VzZ2Dof330Tk,413
8
- chatterer/tools/__init__.py,sha256=X6E_ESq-QFp12GF9CYdktRPxARKvwOj38uYQlc9xT8c,398
9
- chatterer/tools/convert_to_text.py,sha256=-UuKfFKbmmbkYGodcxsFRgsPszTiclcqupJ-mZEQUEI,15521
10
- chatterer/tools/citation_chunking/__init__.py,sha256=DyLMGG4dVgSnGIdaSHcBNDz09iXflcKuJCtg4W0JTVo,79
11
- chatterer/tools/citation_chunking/chunks.py,sha256=_Sxzfbud8XTOHdHdQmKwm4-byES1cD1V6C28DgtS1BA,2120
12
- chatterer/tools/citation_chunking/citation_chunker.py,sha256=Aye1BqUCa4u_CsTZoqCe72pJA8C_y2U5UR7cNoNpeo4,4776
13
- chatterer/tools/citation_chunking/citations.py,sha256=BWhSwzZccvu0Db-OxEbsuEGEz-Dh_tXo8HRx1y2XUHg,12308
14
- chatterer/tools/citation_chunking/prompt.py,sha256=so-8uFQ5b2Zq2V5Brfxd76bEnKYkHovYsohAnbxWEnY,7557
15
- chatterer/tools/citation_chunking/reference.py,sha256=m47XYaB5uFff_x_k7US9hNr-SpZjKnl-GuzsGaQzcZo,893
16
- chatterer/tools/citation_chunking/utils.py,sha256=Xytm9lMrS783Po1qWAdEJ8q7Q3l2UMzwHd9EkYTRiwk,6210
17
- chatterer/tools/webpage_to_markdown/__init__.py,sha256=aL4O78CX6AVBXVfUoM8gLxfYb-kpmhwzwDxKk1Gj_Co,119
18
- chatterer/tools/webpage_to_markdown/playwright_bot.py,sha256=U5xvGFzn4IWCAI98hpbCD5imKRrhYBa9_RzuFNiSwYA,26847
19
- chatterer/tools/webpage_to_markdown/utils.py,sha256=fmO7MMx1yvnnzLElLI31A3y2VaiLnD_XesLEVCNts3U,12264
20
- chatterer/utils/image.py,sha256=3v7DiVfRPDZGNfdEAQAiDw7DggTkSt1I_RlqoKXlyLY,10418
21
- chatterer-0.1.7.dist-info/METADATA,sha256=vZMtTS7Xxy3aQkI4EawVbBNLCaqIxS32UCKiuRNzlX8,4068
22
- chatterer-0.1.7.dist-info/WHEEL,sha256=tTnHoFhvKQHCh4jz3yCn0WPTYIy7wXx3CJtJ7SJGV7c,91
23
- chatterer-0.1.7.dist-info/top_level.txt,sha256=7nSQKP0bHxPRc7HyzdbKsJdkvPgYD0214o6slRizv9s,10
24
- chatterer-0.1.7.dist-info/RECORD,,