shinychat 0.2.1__py3-none-any.whl → 0.2.2__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.
shinychat/__version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.2.1'
32
- __version_tuple__ = version_tuple = (0, 2, 1)
31
+ __version__ = version = '0.2.2'
32
+ __version_tuple__ = version_tuple = (0, 2, 2)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -44,6 +44,8 @@ def message_content(message):
44
44
  """
45
45
  if isinstance(message, (str, HTML)) or message is None:
46
46
  return ChatMessage(content=message)
47
+ if isinstance(message, ChatMessage):
48
+ return message
47
49
  if isinstance(message, dict):
48
50
  if "content" not in message:
49
51
  raise ValueError("Message dictionary must have a 'content' key")
@@ -90,6 +92,8 @@ def message_content_chunk(chunk):
90
92
  """
91
93
  if isinstance(chunk, (str, HTML)) or chunk is None:
92
94
  return ChatMessage(content=chunk)
95
+ if isinstance(chunk, ChatMessage):
96
+ return chunk
93
97
  if isinstance(chunk, dict):
94
98
  if "content" not in chunk:
95
99
  raise ValueError("Chunk dictionary must have a 'content' key")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shinychat
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: An AI Chat interface for Shiny apps.
5
5
  Project-URL: Homepage, https://posit-dev.github.io/shinychat/
6
6
  Project-URL: Documentation, https://posit-dev.github.io/shinychat/py/
@@ -1,8 +1,8 @@
1
1
  shinychat/__init__.py,sha256=wT_dA5RTwONRhUx2MpVKu9o-eLkSqUDX8sU9W2GQYLY,316
2
- shinychat/__version.py,sha256=vYqoJTG51NOUmYyL0xt8asRK8vUT4lGAdal_EZ59mvw,704
2
+ shinychat/__version.py,sha256=o3ZTescp-19Z9cvBGq9dQnbppljgzdUYUf98Nov0spY,704
3
3
  shinychat/_chat.py,sha256=xI32fiiDPx8UCGES1klfneqmxiEWdSWY2F0V0g42pd4,65831
4
4
  shinychat/_chat_bookmark.py,sha256=E8okr1dkN4VNDtORyPVZnCXihmfV9jFGD6UQq4Z2p5s,3027
5
- shinychat/_chat_normalize.py,sha256=e3cOFoCZowvcp_9XosA1XodZ1gZ2fBy9vH-XpdswCRQ,9860
5
+ shinychat/_chat_normalize.py,sha256=zItuC1OXK-f_mqwfMPW2cWqlWyI8eKiHjBk_cUSA34s,9984
6
6
  shinychat/_chat_normalize_chatlas.py,sha256=6iMObxHHSPZ0odWiWNTRUX52Vt8q0ocRaWvsdRjw9zk,12925
7
7
  shinychat/_chat_provider_types.py,sha256=gsBPAs0uro1YcepS1xEiCXyh4JMhpE7kjs28_LSspk0,4328
8
8
  shinychat/_chat_tokenizer.py,sha256=m-YS8j5TC5oJ2uTsIus04_NRYeldFbpHzsoanL2EA-E,1868
@@ -25,7 +25,7 @@ shinychat/www/markdown-stream/markdown-stream.css,sha256=m-yRlzTkX36piqx1T8Nvx18
25
25
  shinychat/www/markdown-stream/markdown-stream.css.map,sha256=afnnfIkD6AuwmHWnzYKDR2qpn8GBzBdqsQ8QY2wH5Xc,9191
26
26
  shinychat/www/markdown-stream/markdown-stream.js,sha256=mcbHHYdKP1tSBAhV830UPOo36q4NBcs6VOvN_i3xC7g,272842
27
27
  shinychat/www/markdown-stream/markdown-stream.js.map,sha256=P7IdHoJhgJ_M9VlIHhzmzwDurBvIIS3FAkfsV86cMz0,1119239
28
- shinychat-0.2.1.dist-info/METADATA,sha256=-OuxX322mVM3m9lt22Rw5GJc1t9-mrVYJhqQCBxMShU,3203
29
- shinychat-0.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
30
- shinychat-0.2.1.dist-info/licenses/LICENSE,sha256=oB2X1GZjjWFbXGMjbtPLWg29aj7BzjbecsnG7yEaY8U,1078
31
- shinychat-0.2.1.dist-info/RECORD,,
28
+ shinychat-0.2.2.dist-info/METADATA,sha256=YX1F15v16SQxoQBcHEOn24UJ0pbQSM_1bE58_4rStJM,3203
29
+ shinychat-0.2.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
30
+ shinychat-0.2.2.dist-info/licenses/LICENSE,sha256=oB2X1GZjjWFbXGMjbtPLWg29aj7BzjbecsnG7yEaY8U,1078
31
+ shinychat-0.2.2.dist-info/RECORD,,