shinychat 0.0.1a0__py3-none-any.whl → 0.0.1a1__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 +2 -2
- {shinychat-0.0.1a0.dist-info → shinychat-0.0.1a1.dist-info}/METADATA +60 -2
- {shinychat-0.0.1a0.dist-info → shinychat-0.0.1a1.dist-info}/RECORD +5 -5
- {shinychat-0.0.1a0.dist-info → shinychat-0.0.1a1.dist-info}/WHEEL +0 -0
- {shinychat-0.0.1a0.dist-info → shinychat-0.0.1a1.dist-info}/licenses/LICENSE +0 -0
shinychat/__version.py
CHANGED
@@ -17,5 +17,5 @@ __version__: str
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
18
18
|
version_tuple: VERSION_TUPLE
|
19
19
|
|
20
|
-
__version__ = version = '0.0.
|
21
|
-
__version_tuple__ = version_tuple = (0, 0, 1, '
|
20
|
+
__version__ = version = '0.0.1a1'
|
21
|
+
__version_tuple__ = version_tuple = (0, 0, 1, 'a1')
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: shinychat
|
3
|
-
Version: 0.0.
|
4
|
-
Summary:
|
3
|
+
Version: 0.0.1a1
|
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/pkg/py/
|
7
7
|
Project-URL: Repository, https://github.com/posit-dev/shinychat
|
@@ -34,3 +34,61 @@ Requires-Dist: pytest>=6.2.4; extra == 'test'
|
|
34
34
|
Requires-Dist: shinylive; extra == 'test'
|
35
35
|
Requires-Dist: shinywidgets; extra == 'test'
|
36
36
|
Requires-Dist: tox-uv>=1; extra == 'test'
|
37
|
+
Description-Content-Type: text/markdown
|
38
|
+
|
39
|
+
# shinychat
|
40
|
+
|
41
|
+
<a href="https://posit-dev.github.io/shinychat/py"><img src="https://posit-dev.github.io/shinychat/logo.svg" align="right" height="138" alt="shinychat for Python website" /></a>
|
42
|
+
|
43
|
+
Chat UI component for [Shiny for Python](https://shiny.posit.co/py/).
|
44
|
+
|
45
|
+
## Installation
|
46
|
+
|
47
|
+
You can install shinychat from PyPI with:
|
48
|
+
|
49
|
+
```bash
|
50
|
+
uv pip install shinychat
|
51
|
+
```
|
52
|
+
|
53
|
+
Or, install the development version of shinychat from [GitHub](https://github.com/posit-dev/shinychat) with:
|
54
|
+
|
55
|
+
```bash
|
56
|
+
uv pip install git+https://github.com/posit-dev/shinychat.git
|
57
|
+
```
|
58
|
+
|
59
|
+
## Example
|
60
|
+
|
61
|
+
To run this example, you'll first need to create an OpenAI API key, and set it in your environment as `OPENAI_API_KEY`.
|
62
|
+
|
63
|
+
```r
|
64
|
+
from shiny.express import render, ui
|
65
|
+
from shinychat.express import Chat
|
66
|
+
|
67
|
+
# Set some Shiny page options
|
68
|
+
ui.page_opts(title="Hello Chat")
|
69
|
+
|
70
|
+
# Create a chat instance, with an initial message
|
71
|
+
chat = Chat(
|
72
|
+
id="chat",
|
73
|
+
messages=[
|
74
|
+
{"content": "Hello! How can I help you today?", "role": "assistant"},
|
75
|
+
],
|
76
|
+
)
|
77
|
+
|
78
|
+
# Display the chat
|
79
|
+
chat.ui()
|
80
|
+
|
81
|
+
|
82
|
+
# Define a callback to run when the user submits a message
|
83
|
+
@chat.on_user_submit
|
84
|
+
async def handle_user_input(user_input: str):
|
85
|
+
await chat.append_message(f"You said: {user_input}")
|
86
|
+
|
87
|
+
|
88
|
+
"Message state:"
|
89
|
+
|
90
|
+
|
91
|
+
@render.code
|
92
|
+
def message_state():
|
93
|
+
return str(chat.messages())
|
94
|
+
```
|
@@ -1,5 +1,5 @@
|
|
1
1
|
shinychat/__init__.py,sha256=3z_WjWhaDYJ7iXrPMMyIqQn93luJazYxxxRbVoB3wAA,92
|
2
|
-
shinychat/__version.py,sha256
|
2
|
+
shinychat/__version.py,sha256=-gjVjyC22Kf6ii2gxF5wWGh_neb7Z7xKBtUcs6ekB54,519
|
3
3
|
shinychat/_chat.py,sha256=Cc0uinRRsLlVHfzKXf6Ww3AHVlGwn3VZjvEqBwQE4tU,68337
|
4
4
|
shinychat/_chat_bookmark.py,sha256=E8okr1dkN4VNDtORyPVZnCXihmfV9jFGD6UQq4Z2p5s,3027
|
5
5
|
shinychat/_chat_normalize.py,sha256=ClnKYsjaWZzu1UO4easB8mh3qQmC546fXJoFnMg_UCY,12705
|
@@ -22,7 +22,7 @@ shinychat/www/markdown-stream/markdown-stream.css,sha256=m-yRlzTkX36piqx1T8Nvx18
|
|
22
22
|
shinychat/www/markdown-stream/markdown-stream.css.map,sha256=afnnfIkD6AuwmHWnzYKDR2qpn8GBzBdqsQ8QY2wH5Xc,9191
|
23
23
|
shinychat/www/markdown-stream/markdown-stream.js,sha256=s0blvLWl0fIbMitqKjIGDpPhNbl62TvPLcmCXkJqb0c,261127
|
24
24
|
shinychat/www/markdown-stream/markdown-stream.js.map,sha256=pnOZ7K9-i0AnQOniv4oxgD9csYzRaErCcPBl-1Y4TkY,1083962
|
25
|
-
shinychat-0.0.
|
26
|
-
shinychat-0.0.
|
27
|
-
shinychat-0.0.
|
28
|
-
shinychat-0.0.
|
25
|
+
shinychat-0.0.1a1.dist-info/METADATA,sha256=8a4sBUNJSSWZuFIrXWUCifph1cYj3FaRHatVxV52UzA,2984
|
26
|
+
shinychat-0.0.1a1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
27
|
+
shinychat-0.0.1a1.dist-info/licenses/LICENSE,sha256=oB2X1GZjjWFbXGMjbtPLWg29aj7BzjbecsnG7yEaY8U,1078
|
28
|
+
shinychat-0.0.1a1.dist-info/RECORD,,
|
File without changes
|
File without changes
|