chatterer 0.1.11__py3-none-any.whl → 0.1.12__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,170 +1,170 @@
1
- Metadata-Version: 2.4
2
- Name: chatterer
3
- Version: 0.1.11
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
- Requires-Dist: youtube-transcript-api>=1.0.2; extra == "conversion"
22
- Provides-Extra: langchain
23
- Requires-Dist: chatterer[langchain-providers]; extra == "langchain"
24
- Requires-Dist: langchain-experimental>=0.3.4; extra == "langchain"
25
- Provides-Extra: langchain-providers
26
- Requires-Dist: langchain-openai>=0.3.7; extra == "langchain-providers"
27
- Requires-Dist: langchain-anthropic>=0.3.8; extra == "langchain-providers"
28
- Requires-Dist: langchain-google-genai>=2.0.10; extra == "langchain-providers"
29
- Requires-Dist: langchain-ollama>=0.2.3; extra == "langchain-providers"
30
- Provides-Extra: all
31
- Requires-Dist: chatterer[langchain]; extra == "all"
32
- Requires-Dist: chatterer[conversion]; extra == "all"
33
- Requires-Dist: chatterer[dev]; extra == "all"
34
-
35
- # Chatterer
36
-
37
- **Simplified, Structured AI Assistant Framework**
38
-
39
- `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.
40
-
41
- The structured reasoning in `chatterer` is inspired by the [Atom-of-Thought](https://github.com/qixucen/atom) pipeline.
42
-
43
- ---
44
-
45
- ## Quick Install
46
-
47
- ```bash
48
- pip install chatterer
49
- ```
50
-
51
- ---
52
-
53
- ## Quickstart Example
54
-
55
- Generate text quickly using OpenAI:
56
-
57
- ```python
58
- from chatterer import Chatterer
59
-
60
- chat = Chatterer.openai("gpt-4o-mini")
61
- response = chat.generate("What is the meaning of life?")
62
- print(response)
63
- ```
64
-
65
- Messages can be input as plain strings or structured lists:
66
-
67
- ```python
68
- response = chat.generate([{ "role": "user", "content": "What's 2+2?" }])
69
- print(response)
70
- ```
71
-
72
- ### Structured Output with Pydantic
73
-
74
- ```python
75
- from pydantic import BaseModel
76
-
77
- class AnswerModel(BaseModel):
78
- question: str
79
- answer: str
80
-
81
- response = chat.generate_pydantic(AnswerModel, "What's the capital of France?")
82
- print(response.question, response.answer)
83
- ```
84
-
85
- ### Async Example
86
-
87
- ```python
88
- import asyncio
89
-
90
- async def main():
91
- response = await chat.agenerate("Explain async in Python briefly.")
92
- print(response)
93
-
94
- asyncio.run(main())
95
- ```
96
-
97
- ---
98
-
99
- ## Atom-of-Thought Pipeline (AoT)
100
-
101
- `AoTPipeline` provides structured reasoning by:
102
-
103
- - Detecting question domains (general, math, coding, philosophy, multihop).
104
- - Decomposing questions recursively.
105
- - Generating direct, decomposition-based, and simplified answers.
106
- - Combining answers via ensemble.
107
-
108
- ### AoT Usage Example
109
-
110
- ```python
111
- from chatterer import Chatterer
112
- from chatterer.strategies import AoTStrategy, AoTPipeline
113
-
114
- pipeline = AoTPipeline(chatterer=Chatterer.openai(), max_depth=2)
115
- strategy = AoTStrategy(pipeline=pipeline)
116
-
117
- question = "What would Newton discover if hit by an apple falling from 100 meters?"
118
- answer = strategy.invoke(question)
119
- print(answer)
120
- ```
121
-
122
- ---
123
-
124
- ## Supported Models
125
-
126
- - **OpenAI**
127
- - **Anthropic**
128
- - **Google Gemini**
129
- - **Ollama** (local models)
130
-
131
- Initialize models easily:
132
-
133
- ```python
134
- openai_chat = Chatterer.openai("gpt-4o-mini")
135
- anthropic_chat = Chatterer.anthropic("claude-3-7-sonnet-20250219")
136
- gemini_chat = Chatterer.google("gemini-2.0-flash")
137
- ollama_chat = Chatterer.ollama("deepseek-r1:1.5b")
138
- ```
139
-
140
- ---
141
-
142
- ## Advanced Features
143
-
144
- - **Streaming responses**
145
- - **Async/Await support**
146
- - **Structured outputs with Pydantic models**
147
-
148
- ---
149
-
150
- ## Logging
151
-
152
- Built-in logging for easy debugging:
153
-
154
- ```python
155
- import logging
156
- logging.basicConfig(level=logging.DEBUG)
157
- ```
158
-
159
- ---
160
-
161
- ## Contributing
162
-
163
- Feel free to open an issue or pull request.
164
-
165
- ---
166
-
167
- ## License
168
-
169
- MIT License
170
-
1
+ Metadata-Version: 2.4
2
+ Name: chatterer
3
+ Version: 0.1.12
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
+ Requires-Dist: youtube-transcript-api>=1.0.2; extra == "conversion"
22
+ Provides-Extra: langchain
23
+ Requires-Dist: chatterer[langchain-providers]; extra == "langchain"
24
+ Requires-Dist: langchain-experimental>=0.3.4; extra == "langchain"
25
+ Provides-Extra: langchain-providers
26
+ Requires-Dist: langchain-openai>=0.3.7; extra == "langchain-providers"
27
+ Requires-Dist: langchain-anthropic>=0.3.8; extra == "langchain-providers"
28
+ Requires-Dist: langchain-google-genai>=2.0.10; extra == "langchain-providers"
29
+ Requires-Dist: langchain-ollama>=0.2.3; extra == "langchain-providers"
30
+ Provides-Extra: all
31
+ Requires-Dist: chatterer[langchain]; extra == "all"
32
+ Requires-Dist: chatterer[conversion]; extra == "all"
33
+ Requires-Dist: chatterer[dev]; extra == "all"
34
+
35
+ # Chatterer
36
+
37
+ **Simplified, Structured AI Assistant Framework**
38
+
39
+ `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.
40
+
41
+ The structured reasoning in `chatterer` is inspired by the [Atom-of-Thought](https://github.com/qixucen/atom) pipeline.
42
+
43
+ ---
44
+
45
+ ## Quick Install
46
+
47
+ ```bash
48
+ pip install chatterer
49
+ ```
50
+
51
+ ---
52
+
53
+ ## Quickstart Example
54
+
55
+ Generate text quickly using OpenAI:
56
+
57
+ ```python
58
+ from chatterer import Chatterer
59
+
60
+ chat = Chatterer.openai("gpt-4o-mini")
61
+ response = chat.generate("What is the meaning of life?")
62
+ print(response)
63
+ ```
64
+
65
+ Messages can be input as plain strings or structured lists:
66
+
67
+ ```python
68
+ response = chat.generate([{ "role": "user", "content": "What's 2+2?" }])
69
+ print(response)
70
+ ```
71
+
72
+ ### Structured Output with Pydantic
73
+
74
+ ```python
75
+ from pydantic import BaseModel
76
+
77
+ class AnswerModel(BaseModel):
78
+ question: str
79
+ answer: str
80
+
81
+ response = chat.generate_pydantic(AnswerModel, "What's the capital of France?")
82
+ print(response.question, response.answer)
83
+ ```
84
+
85
+ ### Async Example
86
+
87
+ ```python
88
+ import asyncio
89
+
90
+ async def main():
91
+ response = await chat.agenerate("Explain async in Python briefly.")
92
+ print(response)
93
+
94
+ asyncio.run(main())
95
+ ```
96
+
97
+ ---
98
+
99
+ ## Atom-of-Thought Pipeline (AoT)
100
+
101
+ `AoTPipeline` provides structured reasoning by:
102
+
103
+ - Detecting question domains (general, math, coding, philosophy, multihop).
104
+ - Decomposing questions recursively.
105
+ - Generating direct, decomposition-based, and simplified answers.
106
+ - Combining answers via ensemble.
107
+
108
+ ### AoT Usage Example
109
+
110
+ ```python
111
+ from chatterer import Chatterer
112
+ from chatterer.strategies import AoTStrategy, AoTPipeline
113
+
114
+ pipeline = AoTPipeline(chatterer=Chatterer.openai(), max_depth=2)
115
+ strategy = AoTStrategy(pipeline=pipeline)
116
+
117
+ question = "What would Newton discover if hit by an apple falling from 100 meters?"
118
+ answer = strategy.invoke(question)
119
+ print(answer)
120
+ ```
121
+
122
+ ---
123
+
124
+ ## Supported Models
125
+
126
+ - **OpenAI**
127
+ - **Anthropic**
128
+ - **Google Gemini**
129
+ - **Ollama** (local models)
130
+
131
+ Initialize models easily:
132
+
133
+ ```python
134
+ openai_chat = Chatterer.openai("gpt-4o-mini")
135
+ anthropic_chat = Chatterer.anthropic("claude-3-7-sonnet-20250219")
136
+ gemini_chat = Chatterer.google("gemini-2.0-flash")
137
+ ollama_chat = Chatterer.ollama("deepseek-r1:1.5b")
138
+ ```
139
+
140
+ ---
141
+
142
+ ## Advanced Features
143
+
144
+ - **Streaming responses**
145
+ - **Async/Await support**
146
+ - **Structured outputs with Pydantic models**
147
+
148
+ ---
149
+
150
+ ## Logging
151
+
152
+ Built-in logging for easy debugging:
153
+
154
+ ```python
155
+ import logging
156
+ logging.basicConfig(level=logging.DEBUG)
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Contributing
162
+
163
+ Feel free to open an issue or pull request.
164
+
165
+ ---
166
+
167
+ ## License
168
+
169
+ MIT License
170
+
@@ -0,0 +1,27 @@
1
+ chatterer/__init__.py,sha256=dgmZGLN_oJDi6zgxxtNMJz5KKA_bSZ11l8cP9f54XhA,1328
2
+ chatterer/language_model.py,sha256=mT_PNvXOKSvf9SezJO3EQKYJnfP2XwRObIdFSn99L2Q,23501
3
+ chatterer/messages.py,sha256=rk2rto4eDdkKoXe9w8C0TbYoNb4FuEVwGc_uiLPDLOQ,220
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=JgASkLhhy0H2coF5toZGDphI5vGtxfSIrLHYGSK2Hdk,677
9
+ chatterer/tools/convert_to_text.py,sha256=isRJ667sEXtZWqpgRx2koIaC3dIP6Pe1_PJXuR10TtQ,15452
10
+ chatterer/tools/youtube.py,sha256=P6I4deJt4xRuQ2ASLGELfkedD1c-foxjIM0n8RI9YTk,5891
11
+ chatterer/tools/citation_chunking/__init__.py,sha256=DyLMGG4dVgSnGIdaSHcBNDz09iXflcKuJCtg4W0JTVo,79
12
+ chatterer/tools/citation_chunking/chunks.py,sha256=_Sxzfbud8XTOHdHdQmKwm4-byES1cD1V6C28DgtS1BA,2120
13
+ chatterer/tools/citation_chunking/citation_chunker.py,sha256=Aye1BqUCa4u_CsTZoqCe72pJA8C_y2U5UR7cNoNpeo4,4776
14
+ chatterer/tools/citation_chunking/citations.py,sha256=BWhSwzZccvu0Db-OxEbsuEGEz-Dh_tXo8HRx1y2XUHg,12308
15
+ chatterer/tools/citation_chunking/prompt.py,sha256=so-8uFQ5b2Zq2V5Brfxd76bEnKYkHovYsohAnbxWEnY,7557
16
+ chatterer/tools/citation_chunking/reference.py,sha256=m47XYaB5uFff_x_k7US9hNr-SpZjKnl-GuzsGaQzcZo,893
17
+ chatterer/tools/citation_chunking/utils.py,sha256=Xytm9lMrS783Po1qWAdEJ8q7Q3l2UMzwHd9EkYTRiwk,6210
18
+ chatterer/tools/webpage_to_markdown/__init__.py,sha256=aL4O78CX6AVBXVfUoM8gLxfYb-kpmhwzwDxKk1Gj_Co,119
19
+ chatterer/tools/webpage_to_markdown/playwright_bot.py,sha256=U5xvGFzn4IWCAI98hpbCD5imKRrhYBa9_RzuFNiSwYA,26847
20
+ chatterer/tools/webpage_to_markdown/utils.py,sha256=N-eZrLQMEmrBwlBBNB1t7c6eEWLGi2kdqoYyrqYq-ec,12604
21
+ chatterer/utils/__init__.py,sha256=qf1gGonmQP3EAaMJtZf_BCYtxgrKH8ymdvD9sF_ezes,319
22
+ chatterer/utils/code_agent.py,sha256=jfv7a67hwHpdbGg8MmjHrZ3buRE2r32XVlXaWtqtuKY,5005
23
+ chatterer/utils/image.py,sha256=nRnHXYtU9LVm6lChvvFl67GytkmD4t6xahbCJprThvQ,10661
24
+ chatterer-0.1.12.dist-info/METADATA,sha256=61l16uSGfXUfUCcXfGnYvYSlVcvrPkRyedhAoiavyVo,4288
25
+ chatterer-0.1.12.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
26
+ chatterer-0.1.12.dist-info/top_level.txt,sha256=7nSQKP0bHxPRc7HyzdbKsJdkvPgYD0214o6slRizv9s,10
27
+ chatterer-0.1.12.dist-info/RECORD,,
@@ -1,27 +0,0 @@
1
- chatterer/__init__.py,sha256=BPgCQ6VWGBXSh8xJr_0bpM0hcOOUz0KoxcKxOd9GYyI,1388
2
- chatterer/language_model.py,sha256=DX_mU855JHHqE0gdnieWZNOwX1BjIO4VK4EightRL3w,24353
3
- chatterer/messages.py,sha256=OtbZ3two0LUQ4PXES97FDIBUSO3IcMHdFV1VFkDL2mI,229
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=hmWIuLJWotGQodL__i4LLbHdXe7Nl5uKHqNke9tHMro,705
9
- chatterer/tools/convert_to_text.py,sha256=kBqxCJ0IoiAw2eiPYqep_SPZm-TtYKF7mdACLsWQUuI,15915
10
- chatterer/tools/youtube.py,sha256=GhyE05JBF_eos01A_N-X5tZv4wQJ--IjErBbEBeNBpQ,6037
11
- chatterer/tools/citation_chunking/__init__.py,sha256=gG7Fnkkp28UpcWMbfMY_4gqzZSZ8QzlhalHBoeoq7K0,82
12
- chatterer/tools/citation_chunking/chunks.py,sha256=50Dpa43RaYftlNox8tM1qI8htZ3_AJ9Uyyn02WsmxYk,2173
13
- chatterer/tools/citation_chunking/citation_chunker.py,sha256=yx5O9pUkowlNcFyyNf7f3sbq7-CV8AXOzFnviDldPR8,4894
14
- chatterer/tools/citation_chunking/citations.py,sha256=RWVJA38yvlER9PhLDPZnqaRsbQ334W4FDQXBqGpdi08,12593
15
- chatterer/tools/citation_chunking/prompt.py,sha256=S0Z6v8R23_Vknt3qYyjoDE1_gBsb0fCEx7LIw7BFXmA,7714
16
- chatterer/tools/citation_chunking/reference.py,sha256=uRKufkU41Zedz6MQUCy-aCk4Rwxg94m4b332zKDpXAs,919
17
- chatterer/tools/citation_chunking/utils.py,sha256=M4pH2-UIE1VLzQLXDqjEe4L3Xcy0e0KhAP3I2U2BNms,6348
18
- chatterer/tools/webpage_to_markdown/__init__.py,sha256=bHH4qfnXyw8Zz-yBPLaTezF1sh9njvNBJmhBVtcpjsA,123
19
- chatterer/tools/webpage_to_markdown/playwright_bot.py,sha256=yP0KixYZNQ4Kn_ZCFDI3mVyBD_DpUGfqgklpaGJUTCU,27496
20
- chatterer/tools/webpage_to_markdown/utils.py,sha256=ZLUU94imYciEdynD2K7Dmcsbt8BVQTaOP56Ba6DAFvk,12593
21
- chatterer/utils/__init__.py,sha256=8nzpFJKU_wSRPH6LBP6HRBotPMrSl_VO9UlmFprTrK0,334
22
- chatterer/utils/code_agent.py,sha256=UaWdeGzJMPzRSFy9yrxuveBJsvOPSa0te6OuE18bees,5143
23
- chatterer/utils/image.py,sha256=1imiyq6TB9NIIGx3zAA2OwMWuXlifYIAjwfWRWa4WIM,10858
24
- chatterer-0.1.11.dist-info/METADATA,sha256=S3hRkxG1DlFc_NGrra1xhniiCDDVoVrow2N96OJy8i0,4458
25
- chatterer-0.1.11.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
26
- chatterer-0.1.11.dist-info/top_level.txt,sha256=7nSQKP0bHxPRc7HyzdbKsJdkvPgYD0214o6slRizv9s,10
27
- chatterer-0.1.11.dist-info/RECORD,,