Spaces:
Runtime error
Runtime error
Commit
Β·
ae46f37
1
Parent(s):
4209f7e
chainlit integration
Browse files- .chainlit/config.toml +78 -0
- Dockerfile +1 -1
- app.py +11 -0
- chainlit.md +14 -0
- requirements.txt +1 -0
.chainlit/config.toml
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[project]
|
2 |
+
# Whether to enable telemetry (default: true). No personal data is collected.
|
3 |
+
enable_telemetry = true
|
4 |
+
|
5 |
+
# List of environment variables to be provided by each user to use the app.
|
6 |
+
user_env = []
|
7 |
+
|
8 |
+
# Duration (in seconds) during which the session is saved when the connection is lost
|
9 |
+
session_timeout = 3600
|
10 |
+
|
11 |
+
# Enable third parties caching (e.g LangChain cache)
|
12 |
+
cache = false
|
13 |
+
|
14 |
+
# Follow symlink for asset mount (see https://github.com/Chainlit/chainlit/issues/317)
|
15 |
+
# follow_symlink = false
|
16 |
+
|
17 |
+
[features]
|
18 |
+
# Show the prompt playground
|
19 |
+
prompt_playground = true
|
20 |
+
|
21 |
+
# Authorize users to upload files with messages
|
22 |
+
multi_modal = true
|
23 |
+
|
24 |
+
# Allows user to use speech to text
|
25 |
+
[features.speech_to_text]
|
26 |
+
enabled = false
|
27 |
+
# See all languages here https://github.com/JamesBrill/react-speech-recognition/blob/HEAD/docs/API.md#language-string
|
28 |
+
# language = "en-US"
|
29 |
+
|
30 |
+
[UI]
|
31 |
+
# Name of the app and chatbot.
|
32 |
+
name = "Chatbot"
|
33 |
+
|
34 |
+
# Show the readme while the conversation is empty.
|
35 |
+
show_readme_as_default = true
|
36 |
+
|
37 |
+
# Description of the app and chatbot. This is used for HTML tags.
|
38 |
+
# description = ""
|
39 |
+
|
40 |
+
# Large size content are by default collapsed for a cleaner ui
|
41 |
+
default_collapse_content = true
|
42 |
+
|
43 |
+
# The default value for the expand messages settings.
|
44 |
+
default_expand_messages = false
|
45 |
+
|
46 |
+
# Hide the chain of thought details from the user in the UI.
|
47 |
+
hide_cot = false
|
48 |
+
|
49 |
+
# Link to your github repo. This will add a github button in the UI's header.
|
50 |
+
# github = ""
|
51 |
+
|
52 |
+
# Specify a CSS file that can be used to customize the user interface.
|
53 |
+
# The CSS file can be served from the public directory or via an external link.
|
54 |
+
# custom_css = "/public/test.css"
|
55 |
+
|
56 |
+
# Override default MUI light theme. (Check theme.ts)
|
57 |
+
[UI.theme.light]
|
58 |
+
#background = "#FAFAFA"
|
59 |
+
#paper = "#FFFFFF"
|
60 |
+
|
61 |
+
[UI.theme.light.primary]
|
62 |
+
#main = "#F80061"
|
63 |
+
#dark = "#980039"
|
64 |
+
#light = "#FFE7EB"
|
65 |
+
|
66 |
+
# Override default MUI dark theme. (Check theme.ts)
|
67 |
+
[UI.theme.dark]
|
68 |
+
#background = "#FAFAFA"
|
69 |
+
#paper = "#FFFFFF"
|
70 |
+
|
71 |
+
[UI.theme.dark.primary]
|
72 |
+
#main = "#F80061"
|
73 |
+
#dark = "#980039"
|
74 |
+
#light = "#FFE7EB"
|
75 |
+
|
76 |
+
|
77 |
+
[meta]
|
78 |
+
generated_by = "0.7.603"
|
Dockerfile
CHANGED
@@ -8,4 +8,4 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
8 |
|
9 |
COPY . .
|
10 |
|
11 |
-
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
8 |
|
9 |
COPY . .
|
10 |
|
11 |
+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import chainlit as cl
|
2 |
+
|
3 |
+
|
4 |
+
@cl.on_message
|
5 |
+
async def main(message: cl.Message):
|
6 |
+
# Your custom logic goes here...
|
7 |
+
|
8 |
+
# Send a response back to the user
|
9 |
+
await cl.Message(
|
10 |
+
content=f"Received: {message.content}",
|
11 |
+
).send()
|
chainlit.md
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Welcome to Chainlit! ππ€
|
2 |
+
|
3 |
+
Hi there, Developer! π We're excited to have you on board. Chainlit is a powerful tool designed to help you prototype, debug and share applications built on top of LLMs.
|
4 |
+
|
5 |
+
## Useful Links π
|
6 |
+
|
7 |
+
- **Documentation:** Get started with our comprehensive [Chainlit Documentation](https://docs.chainlit.io) π
|
8 |
+
- **Discord Community:** Join our friendly [Chainlit Discord](https://discord.gg/k73SQ3FyUh) to ask questions, share your projects, and connect with other developers! π¬
|
9 |
+
|
10 |
+
We can't wait to see what you create with Chainlit! Happy coding! π»π
|
11 |
+
|
12 |
+
## Welcome screen
|
13 |
+
|
14 |
+
To modify the welcome screen, edit the `chainlit.md` file at the root of your project. If you do not want a welcome screen, just leave this file empty.
|
requirements.txt
CHANGED
@@ -1 +1,2 @@
|
|
|
|
1 |
uvicorn
|
|
|
1 |
+
chainlit
|
2 |
uvicorn
|