Skip to content

Commit c53858a

Browse files
authored
Merge pull request #79 from datakind/bugfix/chainlit
Bugfix/chainlit
2 parents 4da88dc + 2b01ca8 commit c53858a

File tree

4 files changed

+29
-22
lines changed

4 files changed

+29
-22
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ This repo contains a docker-compose environment that will run the following comp
6363

6464
# Quick start
6565

66-
1. Install Docker if you don't have it already, see [here](https://www.docker.com/products/docker-desktop/)
66+
1. Install Docker if you don't have it already, see [here](https://www.docker.com/products/docker-desktop/). It will also be helpful to get Docker Desktop to manage the different containers. In addition, ensure you have python installed (version not later than 3.11.9).
67+
6768
2. Check out the Data Recipes AI GitHub repo
6869

6970
Go to the [repo](https://github.com/datakind/data-recipes-ai) in Github, and click the big green '<> Code' button. This provides a few options, you can download a zip file, or check the code out with git. If you have Git installed, a common method would be ...
@@ -125,7 +126,9 @@ This repo contains a docker-compose environment that will run the following comp
125126
126127
7. Restart so the assistant ID is set, `docker compose up -d`
127128
128-
8. Go to [http://localhost:8000/](http://localhost:8000/) and sign-in using the values in your `.env` file for `USER_LOGIN` and `USER_PASSWORD`
129+
8. Go to [http://localhost:8000/](http://localhost:8000/).
130+
131+
9. It will also be helpful to have a database tool like [DBeaver](https://dbeaver.io) to access and interact with your data and recipes.
129132
130133
## Stoping/Starting the environment
131134
@@ -135,6 +138,8 @@ The steps above are mostly one-time. Going forward you only need to stop and sta
135138
- To start the environment `docker compose up -d`, then go to [http://localhost:8000/](http://localhost:8000/)
136139
- To start with rebuild `docker compose up -d --build` (for more details about development, see [CONTRIBUTION](CONTRIBUTION.md))
137140
141+
You can also do the above through Docker Desktop.
142+
138143
## Using Recipes
139144
140145
We are in a phase of research to identify and improve recipes, but for now the system comes with some basic examples to illustrate. To find out the list, enter "Get all recipes" in the chat interface.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
autogenstudio==0.0.56
33
black==22.1.0
44
chainlit==1.1.301
5+
pydantic==2.10.1
56
click==8.1.7
67
datetime==4.3
78
fastparquet==2024.5.0

ui/chat-chainlit-assistant/.chainlit/config.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ custom_css = "/public/elastic.css"
9494
# custom_build = "./public/build"
9595

9696
[UI.theme]
97+
default = "light"
9798
#layout = "wide"
9899
#font_family = "Inter, sans-serif"
99100
# Override default MUI light theme. (Check theme.ts)
@@ -107,11 +108,11 @@ custom_css = "/public/elastic.css"
107108
#light = "#FFE7EB"
108109

109110
# Override default MUI dark theme. (Check theme.ts)
110-
[UI.theme.dark]
111+
#[UI.theme.dark]
111112
#background = "#FAFAFA"
112113
#paper = "#FFFFFF"
113114

114-
[UI.theme.dark.primary]
115+
#[UI.theme.dark.primary]
115116
#main = "#F80061"
116117
#dark = "#980039"
117118
#light = "#FFE7EB"

ui/chat-chainlit-assistant/app.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -697,24 +697,24 @@ async def on_audio_end(elements: list[Element]):
697697
).send()
698698

699699

700-
@cl.password_auth_callback
701-
def auth_callback(username: str, password: str):
702-
"""
703-
Authenticates a user based on the provided username and password.
704-
705-
Args:
706-
username (str): The username of the user.
707-
password (str): The password of the user.
708-
709-
Returns:
710-
cl.User or None: If the authentication is successful, returns a User object with the user's identifier, role, and provider. Otherwise, returns None.
711-
"""
712-
if (username, password) == (user, password):
713-
return cl.User(
714-
identifier=user, metadata={"role": "admin", "provider": "credentials"}
715-
)
716-
else:
717-
return None
700+
# @cl.password_auth_callback
701+
# def auth_callback(username: str, password: str):
702+
# """
703+
# Authenticates a user based on the provided username and password.
704+
705+
# Args:
706+
# username (str): The username of the user.
707+
# password (str): The password of the user.
708+
709+
# Returns:
710+
# cl.User or None: If the authentication is successful, returns a User object with the user's identifier, role, and provider. Otherwise, returns None.
711+
# """
712+
# if (username, password) == (user, password):
713+
# return cl.User(
714+
# identifier=user, metadata={"role": "admin", "provider": "credentials"}
715+
# )
716+
# else:
717+
# return None
718718

719719

720720
async def add_message_to_thread(thread_id, role, content, message=None):

0 commit comments

Comments
 (0)