HanLee commited on
Commit
845ed2b
·
1 Parent(s): ceaa8ef

feat: 01_06b

Browse files
Files changed (2) hide show
  1. README.md +21 -21
  2. app/app.py +11 -1
README.md CHANGED
@@ -2,33 +2,33 @@
2
  This is the repository for the LinkedIn Learning course `Hands-On AI: Building and Deploying LLM-Powered Apps`. The full course is available from [LinkedIn Learning][lil-course-url].
3
 
4
  _See the readme file in the main branch for updated instructions and information._
5
- ## Instructions
6
- This repository has branches for each of the videos in the course. You can use the branch pop up menu in github to switch to a specific branch and take a look at the course at that stage, or you can add `/tree/BRANCH_NAME` to the URL to go to the branch you want to access.
7
 
8
- ## Branches
9
- The branches are structured to correspond to the videos in the course. The naming convention is `CHAPTER#_MOVIE#`. As an example, the branch named `02_03` corresponds to the second chapter and the third video in that chapter.
10
- Some branches will have a beginning and an end state. These are marked with the letters `b` for "beginning" and `e` for "end". The `b` branch contains the code as it is at the beginning of the movie. The `e` branch contains the code as it is at the end of the movie. The `main` branch holds the final state of the code when in the course.
11
 
12
- When switching from one exercise files branch to the next after making changes to the files, you may get a message like this:
13
 
14
- error: Your local changes to the following files would be overwritten by checkout: [files]
15
- Please commit your changes or stash them before you switch branches.
16
- Aborting
17
 
18
- To resolve this issue:
19
-
20
- Add changes to git using this command: git add .
21
- Commit changes using this command: git commit -m "some message"
22
 
23
- ## Installing
24
- 1. To use these exercise files, you must have the following installed:
25
- - [list of requirements for course]
26
- 2. Clone this repository into your local machine using the terminal (Mac), CMD (Windows), or a GUI tool like SourceTree.
27
- 3. [Course-specific instructions]
28
 
 
29
 
30
- [0]: # (Replace these placeholder URLs with actual course URLs)
31
 
32
- [lil-course-url]: https://www.linkedin.com/learning/
33
- [lil-thumbnail-url]: http://
34
 
 
 
 
 
 
 
 
 
2
  This is the repository for the LinkedIn Learning course `Hands-On AI: Building and Deploying LLM-Powered Apps`. The full course is available from [LinkedIn Learning][lil-course-url].
3
 
4
  _See the readme file in the main branch for updated instructions and information._
5
+ ## Lab1: Introduction to Chainlit
6
+ We will be using [Chainlit](https://docs.chainlit.io/get-started/overview) as the frontend framework to develop our LLM Powered applications. Chainlit is an open-source Python package that makes it incredibly fast to build Chat GPT like applications with your own business logic and data.
7
 
8
+ In this lab, we will put up a very simple Chainlit application that echos a user's query.
 
 
9
 
10
+ For example, if user says
11
 
12
+ ```
13
+ hello
14
+ ```
15
 
16
+ Our Chainlit app will respond with
 
 
 
17
 
18
+ ```
19
+ Received: hello
20
+ ```
 
 
21
 
22
+ The learning objective is to familiarize with Chainlit's framework and to launch the application.
23
 
24
+ ## Exercises
25
 
26
+ We have created some template code in `app/app.py` in the `app folder`.
 
27
 
28
+ 1. Please go through [Chainlit's documentation](https://docs.chainlit.io/get-started/pure-python) and answer the questions in `app/app.py`
29
+
30
+ 2. Please lanuch the application by running the following command on the Terminal:
31
+
32
+ ```bash
33
+ chainlit run app/app.py -w
34
+ ```
app/app.py CHANGED
@@ -1,9 +1,19 @@
1
  import chainlit as cl
2
 
3
 
4
- @cl.on_message
 
 
 
 
5
  async def main(message: cl.Message):
6
 
 
 
 
 
 
 
7
  response = message.content
8
 
9
  await cl.Message(content=response).send()
 
1
  import chainlit as cl
2
 
3
 
4
+ ##############################################################################
5
+ # Exercise 1a:
6
+ # Please add the proper decorator to this main function so Chainlit will call
7
+ # this function when it receives a message
8
+ ##############################################################################
9
  async def main(message: cl.Message):
10
 
11
+ ##############################################################################
12
+ # Exercise 1b:
13
+ # Please get the content of the chainlit Message and send it back as a
14
+ # response
15
+ #
16
+ ##############################################################################
17
  response = message.content
18
 
19
  await cl.Message(content=response).send()