chatterer 0.1.5__py3-none-any.whl → 0.1.6__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.
chatterer/__init__.py CHANGED
@@ -1,12 +1,16 @@
1
1
  from .language_model import Chatterer
2
2
  from .strategies import (
3
3
  AoTPipeline,
4
+ AoTPrompter,
4
5
  AoTStrategy,
5
- BaseAoTPrompter,
6
6
  BaseStrategy,
7
- CodingAoTPrompter,
8
- GeneralAoTPrompter,
9
- PhilosophyAoTPrompter,
7
+ )
8
+ from .tools import (
9
+ anything_to_markdown,
10
+ get_default_html_to_markdown_options,
11
+ html_to_markdown,
12
+ pdf_to_text,
13
+ pyscripts_to_snippets,
10
14
  )
11
15
 
12
16
  __all__ = [
@@ -14,8 +18,10 @@ __all__ = [
14
18
  "Chatterer",
15
19
  "AoTStrategy",
16
20
  "AoTPipeline",
17
- "BaseAoTPrompter",
18
- "GeneralAoTPrompter",
19
- "CodingAoTPrompter",
20
- "PhilosophyAoTPrompter",
21
+ "AoTPrompter",
22
+ "html_to_markdown",
23
+ "anything_to_markdown",
24
+ "pdf_to_text",
25
+ "get_default_html_to_markdown_options",
26
+ "pyscripts_to_snippets",
21
27
  ]
@@ -1,4 +1,5 @@
1
1
  from typing import (
2
+ TYPE_CHECKING,
2
3
  Any,
3
4
  AsyncIterator,
4
5
  Iterator,
@@ -11,12 +12,18 @@ from typing import (
11
12
 
12
13
  from langchain_core.language_models.base import LanguageModelInput
13
14
  from langchain_core.language_models.chat_models import BaseChatModel
15
+ from langchain_core.messages import HumanMessage
16
+ from langchain_core.runnables.base import Runnable
14
17
  from langchain_core.runnables.config import RunnableConfig
15
18
  from pydantic import BaseModel, Field
16
19
 
20
+ if TYPE_CHECKING:
21
+ from instructor import Partial
22
+
17
23
  PydanticModelT = TypeVar("PydanticModelT", bound=BaseModel)
18
- ContentType: TypeAlias = str | list[str | dict[str, Any]]
19
- StructuredOutputType: TypeAlias = dict[str, Any] | BaseModel
24
+ StructuredOutputType: TypeAlias = dict[object, object] | BaseModel
25
+
26
+ DEFAULT_IMAGE_DESCRIPTION_INSTRUCTION = "Just describe all the details you see in the image in few sentences."
20
27
 
21
28
 
22
29
  class Chatterer(BaseModel):
@@ -26,6 +33,17 @@ class Chatterer(BaseModel):
26
33
  structured_output_kwargs: dict[str, Any] = Field(default_factory=dict)
27
34
 
28
35
  def __call__(self, messages: LanguageModelInput) -> str:
36
+ """
37
+ Generate text from the given input messages.
38
+
39
+ Args:
40
+ messages (LanguageModelInput): Input messages for the language model.
41
+ Can be one of the following types:
42
+ - str: A single string message.
43
+ - list[dict[str, str]]: A list of dictionaries with 'role' and 'content' keys.
44
+ - tuple[str, str]: A tuple of strings representing the role and content of a single message.
45
+ - list[BaseMessage]: A list of BaseMessage objects. (BaseMessage is a Pydantic model; e.g. can import AIMessage, HumanMessage, SystemMessage from langchain_core.messages)
46
+ """
29
47
  return self.generate(messages)
30
48
 
31
49
  @classmethod
@@ -84,11 +102,7 @@ class Chatterer(BaseModel):
84
102
  stop: Optional[list[str]] = None,
85
103
  **kwargs: Any,
86
104
  ) -> str:
87
- content: ContentType = self.client.invoke(input=messages, config=config, stop=stop, **kwargs).content
88
- if isinstance(content, str):
89
- return content
90
- else:
91
- return "".join(part for part in content if isinstance(part, str))
105
+ return self.client.invoke(input=messages, config=config, stop=stop, **kwargs).text()
92
106
 
93
107
  async def agenerate(
94
108
  self,
@@ -97,11 +111,7 @@ class Chatterer(BaseModel):
97
111
  stop: Optional[list[str]] = None,
98
112
  **kwargs: Any,
99
113
  ) -> str:
100
- content: ContentType = (await self.client.ainvoke(input=messages, config=config, stop=stop, **kwargs)).content
101
- if isinstance(content, str):
102
- return content
103
- else:
104
- return "".join(part for part in content if isinstance(part, str))
114
+ return (await self.client.ainvoke(input=messages, config=config, stop=stop, **kwargs)).text()
105
115
 
106
116
  def generate_stream(
107
117
  self,
@@ -111,17 +121,7 @@ class Chatterer(BaseModel):
111
121
  **kwargs: Any,
112
122
  ) -> Iterator[str]:
113
123
  for chunk in self.client.stream(input=messages, config=config, stop=stop, **kwargs):
114
- content: ContentType = chunk.content
115
- if isinstance(content, str):
116
- yield content
117
- elif isinstance(content, list):
118
- for part in content:
119
- if isinstance(part, str):
120
- yield part
121
- else:
122
- continue
123
- else:
124
- continue
124
+ yield chunk.text()
125
125
 
126
126
  async def agenerate_stream(
127
127
  self,
@@ -131,17 +131,7 @@ class Chatterer(BaseModel):
131
131
  **kwargs: Any,
132
132
  ) -> AsyncIterator[str]:
133
133
  async for chunk in self.client.astream(input=messages, config=config, stop=stop, **kwargs):
134
- content: ContentType = chunk.content
135
- if isinstance(content, str):
136
- yield content
137
- elif isinstance(content, list):
138
- for part in content:
139
- if isinstance(part, str):
140
- yield part
141
- else:
142
- continue
143
- else:
144
- continue
134
+ yield chunk.text()
145
135
 
146
136
  def generate_pydantic(
147
137
  self,
@@ -151,8 +141,10 @@ class Chatterer(BaseModel):
151
141
  stop: Optional[list[str]] = None,
152
142
  **kwargs: Any,
153
143
  ) -> PydanticModelT:
154
- result: StructuredOutputType = self.client.with_structured_output(
155
- response_model, **self.structured_output_kwargs
144
+ result: StructuredOutputType = with_structured_output(
145
+ client=self.client,
146
+ response_model=response_model,
147
+ structured_output_kwargs=self.structured_output_kwargs,
156
148
  ).invoke(input=messages, config=config, stop=stop, **kwargs)
157
149
  if isinstance(result, response_model):
158
150
  return result
@@ -167,8 +159,10 @@ class Chatterer(BaseModel):
167
159
  stop: Optional[list[str]] = None,
168
160
  **kwargs: Any,
169
161
  ) -> PydanticModelT:
170
- result: StructuredOutputType = await self.client.with_structured_output(
171
- response_model, **self.structured_output_kwargs
162
+ result: StructuredOutputType = await with_structured_output(
163
+ client=self.client,
164
+ response_model=response_model,
165
+ structured_output_kwargs=self.structured_output_kwargs,
172
166
  ).ainvoke(input=messages, config=config, stop=stop, **kwargs)
173
167
  if isinstance(result, response_model):
174
168
  return result
@@ -189,9 +183,11 @@ class Chatterer(BaseModel):
189
183
  raise ImportError("Please install `instructor` with `pip install instructor` to use this feature.")
190
184
 
191
185
  partial_response_model = instructor.Partial[response_model]
192
- for chunk in self.client.with_structured_output(partial_response_model, **self.structured_output_kwargs).stream(
193
- input=messages, config=config, stop=stop, **kwargs
194
- ):
186
+ for chunk in with_structured_output(
187
+ client=self.client,
188
+ response_model=partial_response_model,
189
+ structured_output_kwargs=self.structured_output_kwargs,
190
+ ).stream(input=messages, config=config, stop=stop, **kwargs):
195
191
  yield response_model.model_validate(chunk)
196
192
 
197
193
  async def agenerate_pydantic_stream(
@@ -208,11 +204,43 @@ class Chatterer(BaseModel):
208
204
  raise ImportError("Please install `instructor` with `pip install instructor` to use this feature.")
209
205
 
210
206
  partial_response_model = instructor.Partial[response_model]
211
- async for chunk in self.client.with_structured_output(
212
- partial_response_model, **self.structured_output_kwargs
207
+ async for chunk in with_structured_output(
208
+ client=self.client,
209
+ response_model=partial_response_model,
210
+ structured_output_kwargs=self.structured_output_kwargs,
213
211
  ).astream(input=messages, config=config, stop=stop, **kwargs):
214
212
  yield response_model.model_validate(chunk)
215
213
 
214
+ def describe_image(self, image_url: str, instruction: str = DEFAULT_IMAGE_DESCRIPTION_INSTRUCTION) -> str:
215
+ """
216
+ Create a detailed description of an image using the Vision Language Model.
217
+ - image_url: Image URL to describe
218
+ """
219
+ return self.generate([
220
+ HumanMessage(
221
+ content=[{"type": "text", "text": instruction}, {"type": "image_url", "image_url": {"url": image_url}}],
222
+ )
223
+ ])
224
+
225
+ async def adescribe_image(self, image_url: str, instruction: str = DEFAULT_IMAGE_DESCRIPTION_INSTRUCTION) -> str:
226
+ """
227
+ Create a detailed description of an image using the Vision Language Model asynchronously.
228
+ - image_url: Image URL to describe
229
+ """
230
+ return await self.agenerate([
231
+ HumanMessage(
232
+ content=[{"type": "text", "text": instruction}, {"type": "image_url", "image_url": {"url": image_url}}],
233
+ )
234
+ ])
235
+
236
+
237
+ def with_structured_output(
238
+ client: BaseChatModel,
239
+ response_model: Type["PydanticModelT | Partial[PydanticModelT]"],
240
+ structured_output_kwargs: dict[str, Any],
241
+ ) -> Runnable[LanguageModelInput, dict[object, object] | BaseModel]:
242
+ return client.with_structured_output(schema=response_model, **structured_output_kwargs) # pyright: ignore[reportUnknownVariableType, reportUnknownMemberType]
243
+
216
244
 
217
245
  if __name__ == "__main__":
218
246
  import asyncio
@@ -297,312 +325,3 @@ if __name__ == "__main__":
297
325
  print("Error in agenerate_pydantic_stream:", e)
298
326
 
299
327
  asyncio.run(run_async_tests())
300
-
301
- # === Synchronous generate ===
302
- # Result (generate): The meaning of life is a deeply philosophical question that has been pondered by humans for centuries. Different cultures, religions, and belief systems have their own interpretations of the meaning of life. Some believe that the meaning of life is to seek happiness and pleasure, others believe it is to serve a higher power or fulfill a spiritual purpose. Ultimately, the meaning of life is a personal and subjective concept that each individual must find and define for themselves.
303
-
304
- # === Synchronous __call__ ===
305
- # Result (__call__): The meaning of life is a philosophical and existential question that has been debated for centuries. Different individuals, cultures, and philosophies offer varying perspectives on the purpose and significance of life. Some believe that the meaning of life is to seek happiness, fulfillment, and personal growth, while others believe it is to fulfill a higher spiritual or moral purpose. Ultimately, the meaning of life is a deeply personal and subjective concept that each individual must explore and discover for themselves.
306
-
307
- # === Synchronous generate_stream ===
308
- # Chunk 0:
309
- # Chunk 1: The
310
- # Chunk 2: meaning
311
- # Chunk 3: of
312
- # Chunk 4: life
313
- # Chunk 5: is
314
- # Chunk 6: a
315
- # Chunk 7: complex
316
- # Chunk 8: and
317
- # Chunk 9: deeply
318
- # Chunk 10: personal
319
- # Chunk 11: question
320
- # Chunk 12: that
321
- # Chunk 13: has
322
- # Chunk 14: been
323
- # Chunk 15: debated
324
- # Chunk 16: by
325
- # Chunk 17: philosophers
326
- # Chunk 18: ,
327
- # Chunk 19: theolog
328
- # Chunk 20: ians
329
- # Chunk 21: ,
330
- # Chunk 22: and
331
- # Chunk 23: individuals
332
- # Chunk 24: throughout
333
- # Chunk 25: history
334
- # Chunk 26: .
335
- # Chunk 27: The
336
- # Chunk 28: answer
337
- # Chunk 29: to
338
- # Chunk 30: this
339
- # Chunk 31: question
340
- # Chunk 32: can
341
- # Chunk 33: vary
342
- # Chunk 34: greatly
343
- # Chunk 35: depending
344
- # Chunk 36: on
345
- # Chunk 37: one
346
- # Chunk 38: 's
347
- # Chunk 39: beliefs
348
- # Chunk 40: ,
349
- # Chunk 41: values
350
- # Chunk 42: ,
351
- # Chunk 43: and
352
- # Chunk 44: experiences
353
- # Chunk 45: .
354
- # Chunk 46: Some
355
- # Chunk 47: may
356
- # Chunk 48: find
357
- # Chunk 49: meaning
358
- # Chunk 50: in
359
- # Chunk 51: pursuing
360
- # Chunk 52: personal
361
- # Chunk 53: happiness
362
- # Chunk 54: and
363
- # Chunk 55: fulfillment
364
- # Chunk 56: ,
365
- # Chunk 57: others
366
- # Chunk 58: may
367
- # Chunk 59: find
368
- # Chunk 60: meaning
369
- # Chunk 61: in
370
- # Chunk 62: contributing
371
- # Chunk 63: to
372
- # Chunk 64: the
373
- # Chunk 65: greater
374
- # Chunk 66: good
375
- # Chunk 67: of
376
- # Chunk 68: society
377
- # Chunk 69: ,
378
- # Chunk 70: while
379
- # Chunk 71: others
380
- # Chunk 72: may
381
- # Chunk 73: find
382
- # Chunk 74: meaning
383
- # Chunk 75: in
384
- # Chunk 76: spiritual
385
- # Chunk 77: or
386
- # Chunk 78: religious
387
- # Chunk 79: beliefs
388
- # Chunk 80: .
389
- # Chunk 81: Ultimately
390
- # Chunk 82: ,
391
- # Chunk 83: the
392
- # Chunk 84: meaning
393
- # Chunk 85: of
394
- # Chunk 86: life
395
- # Chunk 87: is
396
- # Chunk 88: subjective
397
- # Chunk 89: and
398
- # Chunk 90: can
399
- # Chunk 91: differ
400
- # Chunk 92: from
401
- # Chunk 93: person
402
- # Chunk 94: to
403
- # Chunk 95: person
404
- # Chunk 96: .
405
- # Chunk 97:
406
-
407
- # === Synchronous generate_pydantic ===
408
- # C:\Users\cosogi\chatterer\.venv\Lib\site-packages\langchain_openai\chat_models\base.py:1390: UserWarning: Cannot use method='json_schema' with model gpt-3.5-turbo since it doesn't support OpenAI's Structured Output API. You can see supported models here: https://platform.openai.com/docs/guides/structured-outputs#supported-models. To fix this warning, set `method='function_calling'. Overriding to method='function_calling'.
409
- # warnings.warn(
410
- # Result (generate_pydantic): proposition_topic='meaning of life' proposition_content='The meaning of life is a philosophical question that has been debated by thinkers and scholars for centuries. There are different perspectives on the meaning of life, including religious, existential, and philosophical views. Some argue that the meaning of life is to seek happiness and fulfillment, while others believe it is to fulfill a higher purpose or serve others. Ultimately, the meaning of life is subjective and may vary depending on individual beliefs and values.'
411
-
412
- # === Synchronous generate_pydantic_stream ===
413
- # C:\Users\cosogi\chatterer\.venv\Lib\site-packages\langchain_openai\chat_models\base.py:1390: UserWarning: Cannot use method='json_schema' with model gpt-3.5-turbo since it doesn't support OpenAI's Structured Output API. You can see supported models here: https://platform.openai.com/docs/guides/structured-outputs#supported-models. To fix this warning, set `method='function_calling'. Overriding to method='function_calling'.
414
- # warnings.warn(
415
- # Pydantic Chunk 0: proposition_topic='Meaning of Life' proposition_content=''
416
- # Pydantic Chunk 1: proposition_topic='Meaning of Life' proposition_content='The'
417
- # Pydantic Chunk 2: proposition_topic='Meaning of Life' proposition_content='The meaning'
418
- # Pydantic Chunk 3: proposition_topic='Meaning of Life' proposition_content='The meaning of'
419
- # Pydantic Chunk 4: proposition_topic='Meaning of Life' proposition_content='The meaning of life'
420
- # Pydantic Chunk 5: proposition_topic='Meaning of Life' proposition_content='The meaning of life is'
421
- # Pydantic Chunk 6: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a'
422
- # Pydantic Chunk 7: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical'
423
- # Pydantic Chunk 8: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and'
424
- # Pydantic Chunk 9: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential'
425
- # Pydantic Chunk 10: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question'
426
- # Pydantic Chunk 11: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that'
427
- # Pydantic Chunk 12: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has'
428
- # Pydantic Chunk 13: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been'
429
- # Pydantic Chunk 14: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated'
430
- # Pydantic Chunk 15: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by'
431
- # Pydantic Chunk 16: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars'
432
- # Pydantic Chunk 17: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars,'
433
- # Pydantic Chunk 18: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers'
434
- # Pydantic Chunk 19: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers,'
435
- # Pydantic Chunk 20: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and'
436
- # Pydantic Chunk 21: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals'
437
- # Pydantic Chunk 22: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout'
438
- # Pydantic Chunk 23: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history'
439
- # Pydantic Chunk 24: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history.'
440
- # Pydantic Chunk 25: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It'
441
- # Pydantic Chunk 26: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers'
442
- # Pydantic Chunk 27: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to'
443
- # Pydantic Chunk 28: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the'
444
- # Pydantic Chunk 29: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the purpose'
445
- # Pydantic Chunk 30: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the purpose,'
446
- # Pydantic Chunk 31: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the purpose, significance'
447
- # Pydantic Chunk 32: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the purpose, significance,'
448
- # Pydantic Chunk 33: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the purpose, significance, or'
449
- # Pydantic Chunk 34: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the purpose, significance, or value'
450
- # Pydantic Chunk 35: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the purpose, significance, or value of'
451
- # Pydantic Chunk 36: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the purpose, significance, or value of human'
452
- # Pydantic Chunk 37: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the purpose, significance, or value of human existence'
453
- # Pydantic Chunk 38: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the purpose, significance, or value of human existence and'
454
- # Pydantic Chunk 39: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the purpose, significance, or value of human existence and consciousness'
455
- # Pydantic Chunk 40: proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that has been debated by scholars, philosophers, and individuals throughout history. It refers to the purpose, significance, or value of human existence and consciousness.'
456
-
457
- # === Asynchronous agenerate ===
458
- # Result (agenerate): The meaning of life is a complex and subjective philosophical question that has been debated throughout history. Different individuals and cultures may have different beliefs and perspectives on the meaning of life. Some may believe that the meaning of life is to seek happiness and fulfillment, others may believe it is to serve a higher power or contribute to the greater good of society. Ultimately, the meaning of life is a highly personal and individualistic concept that each person must determine for themselves.
459
-
460
- # === Asynchronous agenerate_stream ===
461
- # Async Chunk 0:
462
- # Async Chunk 1: This
463
- # Async Chunk 2: is
464
- # Async Chunk 3: a
465
- # Async Chunk 4: deeply
466
- # Async Chunk 5: philosophical
467
- # Async Chunk 6: question
468
- # Async Chunk 7: that
469
- # Async Chunk 8: has
470
- # Async Chunk 9: puzzled
471
- # Async Chunk 10: humans
472
- # Async Chunk 11: for
473
- # Async Chunk 12: centuries
474
- # Async Chunk 13: .
475
- # Async Chunk 14: The
476
- # Async Chunk 15: meaning
477
- # Async Chunk 16: of
478
- # Async Chunk 17: life
479
- # Async Chunk 18: is
480
- # Async Chunk 19: a
481
- # Async Chunk 20: highly
482
- # Async Chunk 21: individual
483
- # Async Chunk 22: and
484
- # Async Chunk 23: subjective
485
- # Async Chunk 24: concept
486
- # Async Chunk 25: ,
487
- # Async Chunk 26: with
488
- # Async Chunk 27: different
489
- # Async Chunk 28: people
490
- # Async Chunk 29: finding
491
- # Async Chunk 30: meaning
492
- # Async Chunk 31: in
493
- # Async Chunk 32: different
494
- # Async Chunk 33: things
495
- # Async Chunk 34: .
496
- # Async Chunk 35: Some
497
- # Async Chunk 36: may
498
- # Async Chunk 37: find
499
- # Async Chunk 38: meaning
500
- # Async Chunk 39: in
501
- # Async Chunk 40: their
502
- # Async Chunk 41: relationships
503
- # Async Chunk 42: ,
504
- # Async Chunk 43: their
505
- # Async Chunk 44: work
506
- # Async Chunk 45: ,
507
- # Async Chunk 46: their
508
- # Async Chunk 47: beliefs
509
- # Async Chunk 48: ,
510
- # Async Chunk 49: or
511
- # Async Chunk 50: their
512
- # Async Chunk 51: experiences
513
- # Async Chunk 52: .
514
- # Async Chunk 53: Others
515
- # Async Chunk 54: may
516
- # Async Chunk 55: find
517
- # Async Chunk 56: meaning
518
- # Async Chunk 57: in
519
- # Async Chunk 58: the
520
- # Async Chunk 59: pursuit
521
- # Async Chunk 60: of
522
- # Async Chunk 61: personal
523
- # Async Chunk 62: growth
524
- # Async Chunk 63: ,
525
- # Async Chunk 64: knowledge
526
- # Async Chunk 65: ,
527
- # Async Chunk 66: or
528
- # Async Chunk 67: happiness
529
- # Async Chunk 68: .
530
- # Async Chunk 69: Ultimately
531
- # Async Chunk 70: ,
532
- # Async Chunk 71: the
533
- # Async Chunk 72: meaning
534
- # Async Chunk 73: of
535
- # Async Chunk 74: life
536
- # Async Chunk 75: is
537
- # Async Chunk 76: something
538
- # Async Chunk 77: that
539
- # Async Chunk 78: each
540
- # Async Chunk 79: person
541
- # Async Chunk 80: must
542
- # Async Chunk 81: discover
543
- # Async Chunk 82: for
544
- # Async Chunk 83: themselves
545
- # Async Chunk 84: through
546
- # Async Chunk 85: intros
547
- # Async Chunk 86: pection
548
- # Async Chunk 87: ,
549
- # Async Chunk 88: reflection
550
- # Async Chunk 89: ,
551
- # Async Chunk 90: and
552
- # Async Chunk 91: experience
553
- # Async Chunk 92: .
554
- # Async Chunk 93:
555
-
556
- # === Asynchronous agenerate_pydantic ===
557
- # C:\Users\cosogi\chatterer\.venv\Lib\site-packages\langchain_openai\chat_models\base.py:1390: UserWarning: Cannot use method='json_schema' with model gpt-3.5-turbo since it doesn't support OpenAI's Structured Output API. You can see supported models here: https://platform.openai.com/docs/guides/structured-outputs#supported-models. To fix this warning, set `method='function_calling'. Overriding to method='function_calling'.
558
- # warnings.warn(
559
- # Result (agenerate_pydantic): proposition_topic='Meaning of Life' proposition_content='The meaning of life is a philosophical and existential question that explores the purpose and significance of human existence. It is a complex and subjective concept that has been debated by philosophers, theologians, and thinkers throughout history. Some believe that the meaning of life is to seek happiness, fulfillment, or spiritual enlightenment, while others argue that it is to make a positive impact on the world or to find meaning in personal relationships and experiences. Ultimately, the meaning of life is a deeply personal and reflective question that each individual must contemplate and define for themselves.'
560
-
561
- # === Asynchronous agenerate_pydantic_stream ===
562
- # C:\Users\cosogi\chatterer\.venv\Lib\site-packages\langchain_openai\chat_models\base.py:1390: UserWarning: Cannot use method='json_schema' with model gpt-3.5-turbo since it doesn't support OpenAI's Structured Output API. You can see supported models here: https://platform.openai.com/docs/guides/structured-outputs#supported-models. To fix this warning, set `method='function_calling'. Overriding to method='function_calling'.
563
- # warnings.warn(
564
- # Async Pydantic Chunk 0: proposition_topic='The Meaning of Life' proposition_content=''
565
- # Async Pydantic Chunk 1: proposition_topic='The Meaning of Life' proposition_content='The'
566
- # Async Pydantic Chunk 2: proposition_topic='The Meaning of Life' proposition_content='The meaning'
567
- # Async Pydantic Chunk 3: proposition_topic='The Meaning of Life' proposition_content='The meaning of'
568
- # Async Pydantic Chunk 4: proposition_topic='The Meaning of Life' proposition_content='The meaning of life'
569
- # Async Pydantic Chunk 5: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is'
570
- # Async Pydantic Chunk 6: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a'
571
- # Async Pydantic Chunk 7: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical'
572
- # Async Pydantic Chunk 8: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question'
573
- # Async Pydantic Chunk 9: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that'
574
- # Async Pydantic Chunk 10: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks'
575
- # Async Pydantic Chunk 11: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to'
576
- # Async Pydantic Chunk 12: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand'
577
- # Async Pydantic Chunk 13: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the'
578
- # Async Pydantic Chunk 14: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose'
579
- # Async Pydantic Chunk 15: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and'
580
- # Async Pydantic Chunk 16: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance'
581
- # Async Pydantic Chunk 17: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of'
582
- # Async Pydantic Chunk 18: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human'
583
- # Async Pydantic Chunk 19: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence'
584
- # Async Pydantic Chunk 20: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence.'
585
- # Async Pydantic Chunk 21: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It'
586
- # Async Pydantic Chunk 22: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is'
587
- # Async Pydantic Chunk 23: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a'
588
- # Async Pydantic Chunk 24: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound'
589
- # Async Pydantic Chunk 25: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and'
590
- # Async Pydantic Chunk 26: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex'
591
- # Async Pydantic Chunk 27: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic'
592
- # Async Pydantic Chunk 28: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that'
593
- # Async Pydantic Chunk 29: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has'
594
- # Async Pydantic Chunk 30: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been'
595
- # Async Pydantic Chunk 31: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated'
596
- # Async Pydantic Chunk 32: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and'
597
- # Async Pydantic Chunk 33: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and explored'
598
- # Async Pydantic Chunk 34: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and explored by'
599
- # Async Pydantic Chunk 35: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and explored by philosophers'
600
- # Async Pydantic Chunk 36: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and explored by philosophers,'
601
- # Async Pydantic Chunk 37: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and explored by philosophers, theolog'
602
- # Async Pydantic Chunk 38: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and explored by philosophers, theologians'
603
- # Async Pydantic Chunk 39: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and explored by philosophers, theologians,'
604
- # Async Pydantic Chunk 40: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and explored by philosophers, theologians, and'
605
- # Async Pydantic Chunk 41: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and explored by philosophers, theologians, and thinkers'
606
- # Async Pydantic Chunk 42: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and explored by philosophers, theologians, and thinkers throughout'
607
- # Async Pydantic Chunk 43: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and explored by philosophers, theologians, and thinkers throughout history'
608
- # Async Pydantic Chunk 44: proposition_topic='The Meaning of Life' proposition_content='The meaning of life is a philosophical question that seeks to understand the purpose and significance of human existence. It is a profound and complex topic that has been debated and explored by philosophers, theologians, and thinkers throughout history.'
chatterer/py.typed ADDED
File without changes
@@ -1,19 +1,13 @@
1
1
  from .atom_of_thoughts import (
2
2
  AoTPipeline,
3
3
  AoTStrategy,
4
- BaseAoTPrompter,
5
- CodingAoTPrompter,
6
- GeneralAoTPrompter,
7
- PhilosophyAoTPrompter,
4
+ AoTPrompter,
8
5
  )
9
6
  from .base import BaseStrategy
10
7
 
11
8
  __all__ = [
12
9
  "BaseStrategy",
13
10
  "AoTPipeline",
14
- "BaseAoTPrompter",
11
+ "AoTPrompter",
15
12
  "AoTStrategy",
16
- "GeneralAoTPrompter",
17
- "CodingAoTPrompter",
18
- "PhilosophyAoTPrompter",
19
13
  ]