Skip to content

Commit

Permalink
- Basic charts generation missing
Browse files Browse the repository at this point in the history
- Typography rules
  • Loading branch information
Fabien Lelaquais committed Jan 10, 2024
1 parent 8c4e6b3 commit 06a92d4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
21 changes: 11 additions & 10 deletions docs/knowledge_base/tutorials/chatbot/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ conversation = {
current_user_message = ""
```

- `context` is the initial context for the conversation, the LLM will use this to understand what behaviour is expected from it.
- `conversation` is a dictionary that will store the conversation history to be displayed
- `current_user_message` is the current message that the user is typing
- *context* is the initial context for the conversation, the LLM will use this to understand what behavior is expected from it.
- *conversation* is a dictionary that will store the conversation history to be displayed
- *current_user_message* is the current message that the user is typing

# Step 4: Create a function to generate responses

Expand All @@ -64,7 +64,7 @@ your API key [here](https://platform.openai.com/api-keys).
client = openai.Client(api_key="ENTER_YOUR_API_KEY_HERE")
```

Create a function that takes as input a string `prompt` which
Create a function that takes as input a string *prompt* which
is the user message and returns a string which is the response from the LLM.

```python
Expand Down Expand Up @@ -123,11 +123,11 @@ def send_message(state: State) -> None:
# Step 6: Create the User Interface

In Taipy, one way to define pages is to use Markdown strings. Here we use a
[table](../../../manuals/gui/viselements/table.md_template) to display the
`conversation` dictionary and an
[input](../../../manuals/gui/viselements/input) so that the
[table](../../../manuals/gui/viselements/table.md) to display the
*conversation* dictionary and an
[input](../../../manuals/gui/viselements/input.md) so that the
user can type their message. When the user presses enter,
the `send_message` function is triggered.
the *send_message()* function is triggered.

```python
page = """
Expand All @@ -153,7 +153,7 @@ And here is the result:

# Step 8: Styling

The app's style is Taipy's default stylekit. We are going to
The app's style is Taipy's default Stylekit. We are going to
make some changes so that it looks more like a chat app.

First in a `main.css` file, create styles to display user and
Expand Down Expand Up @@ -240,7 +240,7 @@ We are now going to deploy the app to Taipy Cloud so it is
accessible from anyone with a link.

Firstly we need to store the API key in an environment variable.
Replace the line that defines `client` in [Step 5](#step-5-create-a-function-to-generate-responses) with:
Replace the line that defines *client* in [Step 5](#step-5-create-a-function-to-generate-responses) with:

```python
import os
Expand All @@ -251,6 +251,7 @@ Now, instead of having our API key in the code, the app will look
for it in the environment variables.

We can now deploy the app to Taipy Cloud:

1. Connect to [Taipy Cloud](https://cloud.taipy.io/) and sign in
2. Click on "Add Machine" and fill in the fields
3. Select the created machine and click on "Add app"
Expand Down
1 change: 0 additions & 1 deletion docs/manuals/gui/viselements/chart.md_template
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,3 @@ The [Stylekit](../styling/stylekit.md) provides a specific class that you can us
Here is a list of several sub-sections that you can check to get more details on a specific
domain covered by the chart control:

- [Basic concepts](charts/basics.md)
1 change: 1 addition & 0 deletions docs/manuals/gui/viselements/charts/home.html_fragment
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Catalog content:
this is parsed by the setup_generation script.

basics:Basic concepts
line:Line charts
scatter:Scatter charts
bar:Bar charts
Expand Down
2 changes: 1 addition & 1 deletion docs/relnotes-legacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ Published on 2022-06.
See this [section](manuals/gui/binding.md#scope-for-variable-binding) for details.
- The [`chart`](manuals/gui/viselements/chart.md) control can display georeferenced data on top
of maps.<br/>
See this [example](manuals/gui/viselements/charts/others.md#plotting-on-a-map) for details.
See this [example](manuals/gui/viselements/charts/map.md#bubbles-on-map) for details.
- The [`input`](manuals/gui/viselements/input.md) and [`slider`](manuals/gui/viselements/slider.md)
controls have a new _change_delay_ property that lets you tune how fast you want to propagate
changes.<br/>
Expand Down

0 comments on commit 06a92d4

Please sign in to comment.