convoviz 0.2.7__py3-none-any.whl → 0.2.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.
convoviz/io/assets.py CHANGED
@@ -57,6 +57,22 @@ def resolve_asset_path(source_dir: Path, asset_id: str) -> Path | None:
57
57
  except Exception:
58
58
  pass
59
59
 
60
+ # 4. Try prefix match in user-* directories (new 2025 format)
61
+ try:
62
+ for user_dir in source_dir.glob("user-*"):
63
+ if user_dir.is_dir():
64
+ user_dir = user_dir.resolve()
65
+ candidates = list(user_dir.glob(f"{asset_id}*"))
66
+ files = [
67
+ p.resolve()
68
+ for p in candidates
69
+ if p.is_file() and p.resolve().is_relative_to(user_dir)
70
+ ]
71
+ if files:
72
+ return files[0]
73
+ except Exception:
74
+ pass
75
+
60
76
  return None
61
77
 
62
78
 
@@ -28,6 +28,14 @@ class MessageContent(BaseModel):
28
28
  parts: list[Any] | None = None
29
29
  text: str | None = None
30
30
  result: str | None = None
31
+ # reasoning_recap content type
32
+ content: str | None = None
33
+ # thoughts content type (list of thought objects with summary/content/finished)
34
+ thoughts: list[Any] | None = None
35
+ # tether_quote content type
36
+ url: str | None = None
37
+ domain: str | None = None
38
+ title: str | None = None
31
39
 
32
40
 
33
41
  class MessageMetadata(BaseModel):
@@ -36,6 +44,7 @@ class MessageMetadata(BaseModel):
36
44
  model_slug: str | None = None
37
45
  invoked_plugin: dict[str, Any] | None = None
38
46
  is_user_system_message: bool | None = None
47
+ is_visually_hidden_from_conversation: bool | None = None
39
48
  user_context_message_data: dict[str, Any] | None = None
40
49
 
41
50
  model_config = ConfigDict(protected_namespaces=())
@@ -105,12 +114,48 @@ class Message(BaseModel):
105
114
  if self.content.parts:
106
115
  return ""
107
116
 
117
+ # tether_quote: render as a blockquote with attribution (check before .text)
118
+ if self.content.content_type == "tether_quote":
119
+ return self._render_tether_quote()
108
120
  if self.content.text is not None:
109
121
  return self.content.text
110
122
  if self.content.result is not None:
111
123
  return self.content.result
124
+ # reasoning_recap content type uses 'content' field
125
+ if self.content.content is not None:
126
+ return self.content.content
127
+ # thoughts content type uses 'thoughts' field (list of thought objects)
128
+ if self.content.thoughts is not None:
129
+ return self._render_thoughts()
112
130
  raise MessageContentError(self.id)
113
131
 
132
+ def _render_thoughts(self) -> str:
133
+ """Render thoughts content (list of thought objects with summary/content)."""
134
+ if not self.content.thoughts:
135
+ return ""
136
+ summaries = []
137
+ for thought in self.content.thoughts:
138
+ if isinstance(thought, dict) and (summary := thought.get("summary")):
139
+ summaries.append(summary)
140
+ return "\n".join(summaries) if summaries else ""
141
+
142
+ def _render_tether_quote(self) -> str:
143
+ """Render tether_quote content as a blockquote."""
144
+ quote_text = self.content.text or ""
145
+ if not quote_text.strip():
146
+ return ""
147
+ # Format as blockquote with source
148
+ lines = [f"> {line}" for line in quote_text.strip().split("\n")]
149
+ blockquote = "\n".join(lines)
150
+ # Add attribution if we have title/domain/url
151
+ if self.content.title and self.content.url:
152
+ blockquote += f"\n> — [{self.content.title}]({self.content.url})"
153
+ elif self.content.domain and self.content.url:
154
+ blockquote += f"\n> — [{self.content.domain}]({self.content.url})"
155
+ elif self.content.url:
156
+ blockquote += f"\n> — <{self.content.url}>"
157
+ return blockquote
158
+
114
159
  @property
115
160
  def has_content(self) -> bool:
116
161
  """Check if the message has extractable content."""
@@ -132,26 +177,42 @@ class Message(BaseModel):
132
177
 
133
178
  Hidden if:
134
179
  1. It is empty (no text, no images).
135
- 2. It is an internal system message (not custom instructions).
136
- 3. It is a browser tool output (intermediate search steps).
180
+ 2. Explicitly marked as visually hidden.
181
+ 3. It is an internal system message (not custom instructions).
182
+ 4. It is a browser tool output (intermediate search steps).
183
+ 5. It is an assistant message targeting a tool (internal call).
184
+ 6. It is code interpreter input (content_type="code").
185
+ 7. It is browsing status (tether_browsing_display).
186
+ 8. It is internal reasoning (thoughts, reasoning_recap from o1/o3).
137
187
  """
138
188
  if self.is_empty:
139
189
  return True
140
190
 
191
+ # Explicitly marked as hidden by OpenAI
192
+ if self.metadata.is_visually_hidden_from_conversation:
193
+ return True
194
+
141
195
  # Hide internal system messages
142
196
  if self.author.role == "system":
143
197
  # Only show if explicitly marked as user system message (Custom Instructions)
144
198
  return not self.metadata.is_user_system_message
145
199
 
146
- # Hide browser tool outputs (usually intermediate search steps)
200
+ # Hide browser tool outputs (intermediate search steps)
147
201
  if self.author.role == "tool" and self.author.name == "browser":
148
202
  return True
149
203
 
150
- # Hide assistant calls to browser tool (e.g. "search(...)") or code interpreter
151
- if self.author.role == "assistant" and (
152
- self.recipient == "browser" or self.content.content_type == "code"
153
- ):
204
+ # Hide assistant messages targeting tools (e.g., search(...), code input)
205
+ # recipient="all" or None means it's for the user; anything else is internal
206
+ if self.author.role == "assistant" and self.recipient not in ("all", None):
154
207
  return True
155
208
 
156
- # Hide browsing status messages
157
- return self.content.content_type == "tether_browsing_display"
209
+ # Hide code interpreter input (content_type="code")
210
+ if self.author.role == "assistant" and self.content.content_type == "code":
211
+ return True
212
+
213
+ # Hide browsing status and internal reasoning steps (o1/o3 models)
214
+ return self.content.content_type in (
215
+ "tether_browsing_display",
216
+ "thoughts",
217
+ "reasoning_recap",
218
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: convoviz
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Get analytics and visualizations on your ChatGPT data!
5
5
  Keywords: markdown,chatgpt,openai,visualization,analytics,json,export,data-analysis,obsidian
6
6
  Author: Mohamed Cheikh Sidiya
@@ -34,8 +34,7 @@ Convert your ChatGPT history into well-formatted Markdown files. Additionally, v
34
34
  ## Features
35
35
 
36
36
  - **YAML Headers**: Optional and included by default.
37
- - **Track message versions**: prompt/response edits included.
38
- - **Code Interpreter**: Environment code blocks and execution results.
37
+ - **Inline Images**: Media attachments rendered directly in Markdown.
39
38
  - **Data Visualizations**: Word clouds, graphs, and more.
40
39
  - **Custom Instructions**: All your custom instructions in one JSON file.
41
40
 
@@ -41,13 +41,13 @@ convoviz/config.py,sha256=5fklWzwr0aNyeEJG0NAggLhT0xI0kwgxhjyh9_zUvwM,3112
41
41
  convoviz/exceptions.py,sha256=bQpIKls48uOQpagEJAxpXf5LF7QoagRRfbD0MjWC7Ak,1476
42
42
  convoviz/interactive.py,sha256=VXtKgYo9tZGtsoj7zThdnbTrbjSNP5MzAZbdOs3icW4,7424
43
43
  convoviz/io/__init__.py,sha256=y70TYypJ36_kaEA04E2wa1EDaKQVjprKItoKR6MMs4M,471
44
- convoviz/io/assets.py,sha256=BykidWJG6OQAgbVfUByQ3RLTrldzpZ_NeM7HV3a5Tig,2333
44
+ convoviz/io/assets.py,sha256=WLauNEvk9QRo0Q52KE_bPyCRFa1CjM54L1j8SsTfGwg,2894
45
45
  convoviz/io/loaders.py,sha256=RuGiGzpyNcgwTxOM-m2ehhyh2mP1-k1YamK8-VynR3g,5713
46
46
  convoviz/io/writers.py,sha256=UW-JF5uq91NV62qpFVqgWTYSzzOAkLv67zDpulz2iBc,5072
47
47
  convoviz/models/__init__.py,sha256=6gAfrk6KJT2QxdvX_v15mUdfIqEw1xKxwQlKSfyA5eI,532
48
48
  convoviz/models/collection.py,sha256=L658yKMNC6IZrfxYxZBe-oO9COP_bzVfRznnNon7tfU,4467
49
49
  convoviz/models/conversation.py,sha256=ssx1Z6LM9kJIx3OucQW8JVoAc8zCdxj1iOLtie2B3ak,5678
50
- convoviz/models/message.py,sha256=mVnaUG6hypz92Oz3OgFAK1uuTgH3ZOJAWsFiCpLYneY,5459
50
+ convoviz/models/message.py,sha256=0CJ9hJ1rQiesn1SgHqFgEgKUgS7XAPGtSunQl5q8Pl4,8316
51
51
  convoviz/models/node.py,sha256=1vBAtKVscYsUBDnKAOyLxuZaK9KoVF1dFXiKXRHxUnY,1946
52
52
  convoviz/pipeline.py,sha256=IKfyy3iaNDTqox2YvwB3tnPqvL5iM0i_kMoa854glvY,5806
53
53
  convoviz/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -55,7 +55,7 @@ convoviz/renderers/__init__.py,sha256=IQgwD9NqtUgbS9zwyPBNZbBIZcFrbZ9C7WMAV-X3Xd
55
55
  convoviz/renderers/markdown.py,sha256=mpDt-xrjsPX_wt9URCDk2wicesaVv_VTWWxTHCMKiLM,7765
56
56
  convoviz/renderers/yaml.py,sha256=XG1s4VhDdx-TiqekTkgED87RZ1lVQ7IwrbA-sZHrs7k,4056
57
57
  convoviz/utils.py,sha256=IQEKYHhWOnYxlr4GwAHoquG0BXTlVRkORL80oUSaIeQ,3417
58
- convoviz-0.2.7.dist-info/WHEEL,sha256=eycQt0QpYmJMLKpE3X9iDk8R04v2ZF0x82ogq-zP6bQ,79
59
- convoviz-0.2.7.dist-info/entry_points.txt,sha256=HYsmsw5vt36yYHB05uVU48AK2WLkcwshly7m7KKuZMY,54
60
- convoviz-0.2.7.dist-info/METADATA,sha256=B3v-e0XrLNCEos-nS6_Ynw3-KGPxDMpvbrFgSEFYyHw,5820
61
- convoviz-0.2.7.dist-info/RECORD,,
58
+ convoviz-0.2.8.dist-info/WHEEL,sha256=eycQt0QpYmJMLKpE3X9iDk8R04v2ZF0x82ogq-zP6bQ,79
59
+ convoviz-0.2.8.dist-info/entry_points.txt,sha256=HYsmsw5vt36yYHB05uVU48AK2WLkcwshly7m7KKuZMY,54
60
+ convoviz-0.2.8.dist-info/METADATA,sha256=DeO9FBLgHoXlvRDnMiBBSM6qT-h-1bqyQSHqIKb1zrg,5757
61
+ convoviz-0.2.8.dist-info/RECORD,,