convoviz 0.1.3__py3-none-any.whl → 0.1.5__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.
@@ -5,7 +5,7 @@ object path : conversations.json -> conversation (one of the list items)
5
5
 
6
6
  from __future__ import annotations
7
7
 
8
- from datetime import datetime, timedelta, timezone
8
+ from datetime import datetime, timedelta
9
9
  from os import utime as os_utime
10
10
  from pathlib import Path
11
11
  from typing import TYPE_CHECKING, Any, ClassVar
@@ -46,7 +46,7 @@ class Conversation(BaseModel):
46
46
  plugin_ids: list[str] | None = None
47
47
  conversation_id: str
48
48
  conversation_template_id: str | None = None
49
- id: str | None = None
49
+ id: str | None = None # noqa: A003
50
50
 
51
51
  @classmethod
52
52
  def update_configs(cls, configs: ConversationConfigs) -> None:
@@ -81,7 +81,7 @@ class Conversation(BaseModel):
81
81
  return [
82
82
  node
83
83
  for node in self._all_message_nodes
84
- if node.message and node.message.author_role in authors
84
+ if node.message and node.message.author.role in authors
85
85
  ]
86
86
 
87
87
  @property
@@ -99,7 +99,7 @@ class Conversation(BaseModel):
99
99
  """List of all content types in the conversation (all branches)."""
100
100
  return list(
101
101
  {
102
- node.message.content_type
102
+ node.message.content.content_type
103
103
  for node in self._all_message_nodes
104
104
  if node.message
105
105
  },
@@ -123,7 +123,7 @@ class Conversation(BaseModel):
123
123
 
124
124
  message = assistant_nodes[0].message
125
125
 
126
- return message.model if message else None
126
+ return message.metadata.model_slug if message else None
127
127
 
128
128
  @property
129
129
  def used_plugins(self) -> list[str]:
@@ -268,14 +268,22 @@ class Conversation(BaseModel):
268
268
  @property
269
269
  def month_start(self) -> datetime:
270
270
  """Return the first of the month the conversation was created in."""
271
- return datetime(
272
- self.create_time.year,
273
- self.create_time.month,
274
- 1,
275
- tzinfo=timezone.utc,
271
+ return self.create_time.replace(
272
+ day=1,
273
+ hour=0,
274
+ minute=0,
275
+ second=0,
276
+ microsecond=0,
276
277
  )
277
278
 
278
279
  @property
279
280
  def year_start(self) -> datetime:
280
281
  """Return the first of January of the year the conversation was created in."""
281
- return datetime(self.create_time.year, 1, 1, tzinfo=timezone.utc)
282
+ return self.create_time.replace(
283
+ month=1,
284
+ day=1,
285
+ hour=0,
286
+ minute=0,
287
+ second=0,
288
+ microsecond=0,
289
+ )
@@ -69,15 +69,10 @@ class Message(BaseModel):
69
69
  """Set the configuration for all messages."""
70
70
  cls.__configs.update(configs)
71
71
 
72
- @property
73
- def author_role(self) -> AuthorRole:
74
- """Return the role of the author of the message."""
75
- return self.author.role
76
-
77
72
  @property
78
73
  def header(self) -> str:
79
74
  """Get the title header of the message based on the configs."""
80
- return self.__configs["author_headers"][self.author_role]
75
+ return self.__configs["author_headers"][self.author.role]
81
76
 
82
77
  @property
83
78
  def text(self) -> str:
@@ -92,13 +87,3 @@ class Message(BaseModel):
92
87
  # this error caught some hidden bugs in the data. need more of these
93
88
  err_msg = f"No valid content found in message: {self.id}"
94
89
  raise ValueError(err_msg)
95
-
96
- @property
97
- def content_type(self) -> str:
98
- """Get the content type of the message."""
99
- return self.content.content_type
100
-
101
- @property
102
- def model(self) -> str | None:
103
- """Get the model used for the message."""
104
- return self.metadata.model_slug
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: convoviz
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: Get analytics and visualizations on your ChatGPT data !
5
5
  Home-page: https://github.com/mohamed-chs/chatgpt-history-export-to-md
6
6
  License: MIT
@@ -37,13 +37,13 @@ convoviz/configuration.py,sha256=gsabIQt_oiLCGUFYaftcM55oIhgWm6O6PbUBwPu6B94,390
37
37
  convoviz/data_analysis.py,sha256=OBnElm61pclK6DTFCKdrJHRoSiXTMyL7S8h_3TZ_0Ek,3551
38
38
  convoviz/long_runs.py,sha256=lViUuD2aC-djfyzaw2iFprIiEhLaOhAcQQA1E7OD-EM,2676
39
39
  convoviz/models/__init__.py,sha256=ui47MNe4qRhx2EFZpaeU3Qo32hFVrTOtMcUvKXbv4X0,261
40
- convoviz/models/_conversation.py,sha256=63nnKhO5oI3lhTAF7zMGUXIIRCiOFoj9l70DDx85SNk,8874
40
+ convoviz/models/_conversation.py,sha256=avhvc4FHex4s4jQ_A_c78MbqbtYSsUb-iLVjHvW1YtE,9015
41
41
  convoviz/models/_conversation_set.py,sha256=0ngb3fcsy89YkYjRNIQSFpM326ZUu2u7gikPed91VC8,6600
42
- convoviz/models/_message.py,sha256=qihdl8K4D7ofJnso5dqGbiFHa2m5s3up2OzMYjMW3nk,3030
42
+ convoviz/models/_message.py,sha256=fqwGE4fQDvBfoFBWLK0_ITo5tOXFt7oDhvcmpQHqJag,2600
43
43
  convoviz/models/_node.py,sha256=TEWtqIvfkTJA3uE9exwfO1ow7MeYGK8bzSTorXbigsM,2214
44
44
  convoviz/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
45
  convoviz/utils.py,sha256=EkEMS6y7OZEvREpzwjdq04PQm1wDEszk41gnuugCk6A,7078
46
- convoviz-0.1.3.dist-info/LICENSE,sha256=LO6tqJjRNZIT4w4btugJrWzmwsxeZZcL3j7KV7qK_tM,1099
47
- convoviz-0.1.3.dist-info/METADATA,sha256=0UEd4mVAA7S3xPvmKsfTIMQVoT5ZJVJqzBLRvY7qe5Q,5458
48
- convoviz-0.1.3.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
49
- convoviz-0.1.3.dist-info/RECORD,,
46
+ convoviz-0.1.5.dist-info/LICENSE,sha256=LO6tqJjRNZIT4w4btugJrWzmwsxeZZcL3j7KV7qK_tM,1099
47
+ convoviz-0.1.5.dist-info/METADATA,sha256=mM3LFGolDM-_C2ue-0kQXV2wed15kH7AGuWggumr6_4,5458
48
+ convoviz-0.1.5.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
49
+ convoviz-0.1.5.dist-info/RECORD,,