Skip to content

Commit

Permalink
Chat tutorials (#1206)
Browse files Browse the repository at this point in the history
* Chat feedback tutorial draft

* Typos

* Chat response editing draft

* Update chat revision tutorial

* Tutorial code formattings

* Update chat-response-revision.md

* Update chat-response-revision.md

* Edits for style

* Editorial review

* Edits
  • Loading branch information
sfc-gh-dmatthews authored Jan 28, 2025
1 parent 85cc4e6 commit 3c29f44
Show file tree
Hide file tree
Showing 14 changed files with 1,218 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ st.altair_chart(combined_chart, use_container_width=True)
### Initialize your app

1. In `your_repository`, create a file named `app.py`.
1. In a terminal, change directories to `your_repository` and start your app.
1. In a terminal, change directories to `your_repository`, and start your app:

```bash
streamlit run app.py
```

Your app will be blank since you still need to add code.
Your app will be blank because you still need to add code.

1. In `app.py`, write the following:

Expand All @@ -140,10 +140,12 @@ st.altair_chart(combined_chart, use_container_width=True)
- You'll maniputate the data using `pandas`.
- You'll define a chart using `altair`.

1. Save your `app.py` file and view your running app.
1. Click "**Always rerun**" or hit your "**A**" key in your running app.
1. Save your `app.py` file, and view your running app.
1. In your app, select "**Always rerun**", or press the "**A**" key.

Your running preview will automatically update as you save changes to `app.py`. Your preview will still be blank. Return to your code.
Your preview will be blank but will automatically update as you save changes to `app.py`.

1. Return to your code.

### Build the data layer

Expand Down
14 changes: 8 additions & 6 deletions content/develop/tutorials/elements/dataframes/row_selections.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This tutorial uses row selections, which were introduced in Streamlit version 1.

## Prerequisites

- The following must be installed in your Python environment:
- This tutorial requires the following version of Streamlit:

```text
streamlit>=1.35.0
Expand Down Expand Up @@ -135,13 +135,13 @@ Here's a look at what you'll build:
### Initialize your app

1. In `your_repository`, create a file named `app.py`.
1. In a terminal, change directories to `your_repository` and start your app.
1. In a terminal, change directories to `your_repository`, and start your app:

```bash
streamlit run app.py
```

Your app will be blank since you still need to add code.
Your app will be blank because you still need to add code.

1. In `app.py`, write the following:

Expand All @@ -159,10 +159,12 @@ Here's a look at what you'll build:
- You'll generate random activity data with `numpy`.
- You'll manipulate the data with `pandas`.

1. Save your `app.py` file and view your running app.
1. Click "**Always rerun**" or hit your "**A**" key in your running app.
1. Save your `app.py` file, and view your running app.
1. In your app, select "**Always rerun**", or press the "**A**" key.

Your running preview will automatically update as you save changes to `app.py`. Your preview will still be blank. Return to your code.
Your preview will be blank but will automatically update as you save changes to `app.py`.

1. Return to your code.

### Build a function to create random member data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Streamlit lets you turn functions into [fragments](/develop/concepts/architectur

## Prerequisites

- The following must be installed in your Python environment:
- This tutorial requires the following version of Streamlit:

```text
streamlit>=1.37.0
Expand Down Expand Up @@ -99,13 +99,13 @@ with st.sidebar:
### Initialize your app

1. In `your_repository`, create a file named `app.py`.
1. In a terminal, change directories to `your_repository` and start your app.
1. In a terminal, change directories to `your_repository`, and start your app:

```bash
streamlit run app.py
```

Your app will be blank since you still need to add code.
Your app will be blank because you still need to add code.

1. In `app.py`, write the following:

Expand All @@ -116,10 +116,12 @@ with st.sidebar:

You'll use `time.sleep()` to slow things down and see the fragments working.

1. Save your `app.py` file and view your running app.
1. Click "**Always rerun**" or hit your "**A**" key in your running app.
1. Save your `app.py` file, and view your running app.
1. In your app, select "**Always rerun**", or press the "**A**" key.

Your running preview will automatically update as you save changes to `app.py`. Your preview will still be blank. Return to your code.
Your preview will be blank but will automatically update as you save changes to `app.py`.

1. Return to your code.

### Frame out your app's containers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Streamlit lets you turn functions into [fragments](/develop/concepts/architectur

## Prerequisites

- The following must be installed in your Python environment:
- This tutorial requires the following version of Streamlit:

```text
streamlit>=1.37.0
Expand Down Expand Up @@ -102,13 +102,13 @@ show_latest_data()
### Initialize your app

1. In `your_repository`, create a file named `app.py`.
1. In a terminal, change directories to `your_repository` and start your app.
1. In a terminal, change directories to `your_repository`, and start your app:

```bash
streamlit run app.py
```

Your app will be blank since you still need to add code.
Your app will be blank because you still need to add code.

1. In `app.py`, write the following:

Expand All @@ -125,10 +125,12 @@ show_latest_data()
- You'll generate random data with `numpy`.
- The data will have `datetime.datetime` index values.

1. Save your `app.py` file and view your running app.
1. Click "**Always rerun**" or hit your "**A**" key in your running app.
1. Save your `app.py` file, and view your running app.
1. In your app, select "**Always rerun**", or press the "**A**" key.

Your running preview will automatically update as you save changes to `app.py`. Your preview will still be blank. Return to your code.
Your preview will be blank but will automatically update as you save changes to `app.py`.

1. Return to your code.

### Build a function to generate random, recent data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Streamlit lets you turn functions into [fragments](/develop/concepts/architectur

## Prerequisites

- The following must be installed in your Python environment:
- This tutorial requires the following version of Streamlit:

```text
streamlit>=1.37.0
Expand Down Expand Up @@ -137,13 +137,13 @@ with monthly:
### Initialize your app

1. In `your_repository`, create a file named `app.py`.
1. In a terminal, change directories to `your_repository` and start your app.
1. In a terminal, change directories to `your_repository`, and start your app:

```bash
streamlit run app.py
```

Your app will be blank since you still need to add code.
Your app will be blank because you still need to add code.

1. In `app.py`, write the following:

Expand All @@ -164,10 +164,12 @@ with monthly:
- The products sold will be "Widget A" through "Widget Z," so you'll use `string` for easy access to an alphabetical string.
- Optional: To help add emphasis at the end, you'll use `time.sleep()` to slow things down and see the fragment working.

1. Save your `app.py` file and view your running app.
1. Click "**Always rerun**" or hit your "**A**" key in your running app.
1. Save your `app.py` file, and view your running app.
1. In your app, select "**Always rerun**", or press the "**A**" key.

Your running preview will automatically update as you save changes to `app.py`. Your preview will still be blank. Return to your code.
Your preview will be blank but will automatically update as you save changes to `app.py`.

1. Return to your code.

### Build a function to create random sales data

Expand Down
20 changes: 19 additions & 1 deletion content/develop/tutorials/llms/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Build LLM apps
slug: /develop/tutorials/llms
slug: /develop/tutorials/chat-and-llm-apps
---

# Build LLM apps
Expand All @@ -23,4 +23,22 @@ Build a chat app using the LangChain framework with OpenAI.

</RefCard>

<RefCard href="/develop/tutorials/chat-and-llm-apps/chat-response-feedback">

<h5>Get chat response feedback</h5>

Buid a chat app and let users rate the responses.
(<i style={{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>thumb_up</i>
<i style={{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>thumb_down</i>)

</RefCard>

<RefCard href="/develop/tutorials/chat-and-llm-apps/validate-and-edit-chat-responses">

<h5>Validate and edit chat responses</h5>

Build a chat app with response validation. Let users correct or edit the responses.

</RefCard>

</TileContainer>
Loading

0 comments on commit 3c29f44

Please sign in to comment.