slide-narrator 0.2.2__tar.gz → 0.3.0__tar.gz

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.

Potentially problematic release.


This version of slide-narrator might be problematic. Click here for more details.

Files changed (20) hide show
  1. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/.gitignore +3 -0
  2. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/PKG-INFO +1 -1
  3. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/__init__.py +1 -1
  4. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/database/storage_backend.py +7 -5
  5. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/database/thread_store.py +7 -5
  6. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/pyproject.toml +4 -1
  7. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/LICENSE +0 -0
  8. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/README.md +0 -0
  9. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/database/__init__.py +0 -0
  10. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/database/cli.py +0 -0
  11. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/database/migrations/__init__.py +0 -0
  12. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/database/models.py +0 -0
  13. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/models/__init__.py +0 -0
  14. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/models/attachment.py +0 -0
  15. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/models/message.py +0 -0
  16. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/models/thread.py +0 -0
  17. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/storage/__init__.py +0 -0
  18. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/storage/file_store.py +0 -0
  19. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/utils/__init__.py +0 -0
  20. {slide_narrator-0.2.2 → slide_narrator-0.3.0}/narrator/utils/logging.py +0 -0
@@ -311,3 +311,6 @@ output/*.csv
311
311
  output/*.json
312
312
  temp/*.csv
313
313
  temp/*.json
314
+
315
+ # Ignore Code Workspace files
316
+ *.code-workspace
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: slide-narrator
3
- Version: 0.2.2
3
+ Version: 0.3.0
4
4
  Summary: Thread and file storage components for conversational AI - the companion to Tyler AI framework
5
5
  Project-URL: Homepage, https://github.com/adamwdraper/slide
6
6
  Project-URL: Repository, https://github.com/adamwdraper/slide
@@ -8,7 +8,7 @@ from .models.thread import Thread
8
8
  from .models.message import Message
9
9
  from .models.attachment import Attachment
10
10
 
11
- __version__ = "0.2.2"
11
+ __version__ = "0.3.0"
12
12
  __all__ = [
13
13
  "ThreadStore",
14
14
  "FileStore",
@@ -1,6 +1,6 @@
1
1
  """Storage backend implementations for ThreadStore."""
2
2
  from abc import ABC, abstractmethod
3
- from typing import List, Optional, Dict, Any
3
+ from typing import List, Optional, Dict, Any, Union
4
4
  from datetime import datetime, UTC
5
5
  import json
6
6
  import os
@@ -64,7 +64,7 @@ class StorageBackend(ABC):
64
64
  pass
65
65
 
66
66
  @abstractmethod
67
- async def find_messages_by_attribute(self, path: str, value: Any) -> List[MessageRecord]:
67
+ async def find_messages_by_attribute(self, path: str, value: Any) -> Union[List[Message], List[MessageRecord]]:
68
68
  """
69
69
  Find messages that have a specific attribute at a given JSON path.
70
70
  Uses efficient SQL JSON path queries for PostgreSQL and falls back to
@@ -138,7 +138,7 @@ class MemoryBackend(StorageBackend):
138
138
  threads = threads[:limit]
139
139
  return threads
140
140
 
141
- async def find_messages_by_attribute(self, path: str, value: Any) -> List[MessageRecord]:
141
+ async def find_messages_by_attribute(self, path: str, value: Any) -> List[Message]:
142
142
  """
143
143
  Check if any messages exist with a specific attribute at a given JSON path.
144
144
 
@@ -147,7 +147,7 @@ class MemoryBackend(StorageBackend):
147
147
  value: The value to search for
148
148
 
149
149
  Returns:
150
- True if any messages match, False otherwise
150
+ List of messages matching the criteria (possibly empty)
151
151
  """
152
152
  # Traverse all threads and messages
153
153
  for thread in self._threads.values():
@@ -166,7 +166,9 @@ class MemoryBackend(StorageBackend):
166
166
 
167
167
  # Check if we found a match
168
168
  if current == value:
169
- return [self._create_message_record(message, thread.id, 0)]
169
+ # For MemoryBackend, we can't return MessageRecord objects
170
+ # Return a list containing the message data that the ThreadStore can handle
171
+ return [message]
170
172
 
171
173
  return []
172
174
 
@@ -190,13 +190,15 @@ class ThreadStore:
190
190
  """
191
191
  await self._ensure_initialized()
192
192
  if hasattr(self._backend, 'find_messages_by_attribute'):
193
- message_records = await self._backend.find_messages_by_attribute(path, value)
193
+ results = await self._backend.find_messages_by_attribute(path, value)
194
194
 
195
- # Convert MessageRecord objects to Message objects
195
+ # Handle different return types from different backends
196
196
  messages = []
197
- if hasattr(self._backend, '_create_message_from_record'):
198
- for record in message_records:
199
- message = self._backend._create_message_from_record(record)
197
+ for item in results:
198
+ if hasattr(item, 'model_dump'): # It's a Message object (from MemoryBackend)
199
+ messages.append(item)
200
+ elif hasattr(self._backend, '_create_message_from_record'): # It's a MessageRecord (from SQLBackend)
201
+ message = self._backend._create_message_from_record(item)
200
202
  messages.append(message)
201
203
 
202
204
  return messages
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "slide-narrator"
7
- version = "0.2.2"
7
+ version = "0.3.0"
8
8
  description = "Thread and file storage components for conversational AI - the companion to Tyler AI framework"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -50,6 +50,9 @@ Repository = "https://github.com/adamwdraper/slide"
50
50
  [project.scripts]
51
51
  narrator-db = "narrator.database.cli:main"
52
52
 
53
+ [tool.uv.sources]
54
+ # No workspace dependencies for narrator currently
55
+
53
56
  [tool.hatch.build.targets.wheel]
54
57
  packages = ["narrator"]
55
58
 
File without changes
File without changes