Skip to content

Commit 4209493

Browse files
Merge pull request #10 from sfc-gh-lacosta/weaviate-blog-post-no-posters
Weaviate blog post no posters
2 parents b48f960 + 9d9dd45 commit 4209493

File tree

10 files changed

+334177
-337
lines changed

10 files changed

+334177
-337
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ __pycache__/
1212

1313
# Environments
1414
replicatevenv/
15+
weaviatevenv/
1516

1617
# Secrets
1718
*secrets.toml
1819

20+
# Recipe specific
21+
recipes/weaviate/helpers/data/posters
22+

recipes/weaviate/.gitignore

Lines changed: 0 additions & 267 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
WEAVIATE_API_KEY = "your weaviate key goes here"
2+
WEAVIATE_URL = "your weaviate url goes here"
3+
COHERE_API_KEY = "your cohere api key goes here"

recipes/weaviate/README.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,52 @@
1-
# Weaviate recipe
1+
# How to run the demo app
2+
This is a recipe for a movie recommendation app. The app uses [Weaviate](https://weaviate.io/) to create a vector database of movie titles and [Streamlit](https://streamlit.io/) to create a recommendation chatbot.
3+
4+
Other ways to explore this recipe:
5+
* [Deployed app](https://weaviate-movie-magic.streamlit.app/)
6+
* [Video](https://youtu.be/SQD-aWlhqvM?si=t54W53G1gWnTAiwx)
7+
8+
## Prerequisites
9+
* Python >=3.8, !=3.9.7
10+
* [A Weaviate API key and URL](https://auth.wcs.api.weaviate.io/auth/realms/SeMI/login-actions/registration?client_id=wcs-frontend&tab_id=5bw6GQTdWU0)
11+
* [A Cohere API key](https://dashboard.cohere.com/welcome/register)
12+
13+
## Environment setup
14+
### Local setup
15+
16+
#### Create a virtual environment
17+
1. Clone the Cookbook repo: `git clone https://github.com/streamlit/cookbook.git`
18+
2. From the Cookbook root directory, change directory into the recipe: `cd recipes/weaviate`
19+
3. Add secrets to the `.streamlit/secrets_template.toml` file
20+
4. Update the filename from `secrets_template.toml` to `secrets.toml`: `mv .streamlit/secrets_template.toml .streamlit/secrets.toml`
21+
22+
(To learn more about secrets handling in Streamlit, refer to the documentation [here](https://docs.streamlit.io/develop/concepts/connections/secrets-management).)
23+
5. Create a virtual environment: `python3 -m venv weaviatevenv`
24+
6. Activate the virtual environment: `source weaviatevenv/bin/activate`
25+
7. Install the dependencies: `pip install -r requirements.txt`
26+
27+
#### Add data to your Weaviate Cloud
28+
1. Create a Weaviate Cloud [Collection](https://weaviate.io/developers/weaviate/config-refs/schema#introduction) and add data to it: `python3 helpers/add_data.py`
29+
2. (Optional) Verify the data: `python3 helpers/verify_data.py`
30+
3. (Optional) Use the Weaviate Cloud UI to [query the Collection](https://weaviate.io/developers/weaviate/connections/connect-query#example-query):
31+
```
32+
{ Get {MovieDemo (limit: 3
33+
where: { path: ["release_year"],
34+
operator: Equal,
35+
valueInt: 1985}) {
36+
budget
37+
movie_id
38+
overview
39+
release_year
40+
revenue
41+
tagline
42+
title
43+
vote_average
44+
vote_count
45+
}}}
46+
```
47+
48+
#### Run the app
49+
1. Run the app with: `streamlit run demo_app.py`
50+
2. The app should spin up in a new browser tab
51+
52+
(Please note that this version of the demo app does not feature the poster images so it will look different from the [deployed app](https://weaviate-movie-magic.streamlit.app/).)

0 commit comments

Comments
 (0)