Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
node_modules
.tmp
npm-debug.log
*.env
*.venv
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@
"workbench.activityBar.visible": true,
"workbench.colorTheme": "Visual Studio Dark",
"workbench.fontAliasing": "antialiased",
"workbench.statusBar.visible": true
"workbench.statusBar.visible": true,
"cSpell.words": [
"dotenv",
"openai"
]
}
5 changes: 1 addition & 4 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
Copyright 2022 LinkedIn Corporation
Copyright 2023 LinkedIn Corporation
All Rights Reserved.

Licensed under the LinkedIn Learning Exercise File License (the "License").
See LICENSE in the project root for license information.

ATTRIBUTIONS:
[PLEASE PROVIDE ATTRIBUTIONS OR DELETE THIS AND THE ABOVE LINE “ATTRIBUTIONS”]

Please note, this project may automatically load third party code from external
repositories (for example, NPM modules, Composer packages, or other dependencies).
If so, such third party code may be subject to other license terms than as set
Expand Down
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# COURSENAME
This is the repository for the LinkedIn Learning course `course-name`. The full course is available from [LinkedIn Learning][lil-course-url].
# Building Apps with AI Tools: ChatGPT, Semantic Kernel, and Langchain
This is the repository for the LinkedIn Learning course Building Apps with AI Tools: ChatGPT, Semantic Kernel, and Langchain. The full course is available from [LinkedIn Learning][lil-course-url].

![Building Apps with AI Tools: ChatGPT, Semantic Kernel, and Langchain][lil-thumbnail-url]

New tools powered by artificial intelligence are changing the way we think about apps. And if you’re a developer looking to integrate your workflow, it’s time to supercharge your existing skills. In this course, instructor Denys Linkov offers an overview of how to build apps and integrate exciting, new open-source tools such as ChatGPT, Semantic Kernel, and LangChain.

Learn how to connect to the ChatGPT API to start building hands-on applications with code. Denys shows you the basics of app development with Semantic Kernel, from formatting to chain-of-thought reasoning, prompting, and OpenAI Whisper for text to speech. By the end of this course, you’ll also get a chance to try out your new skills building document search with LangChain and testing ChatGPT apps.


![course-name-alt-text][lil-thumbnail-url]

_See the readme file in the main branch for updated instructions and information._
## Instructions
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.

Expand All @@ -23,14 +28,20 @@ To resolve this issue:
Commit changes using this command: git commit -m "some message"

## Installing
1. To use these exercise files, you must have the following installed:
- [list of requirements for course]
1. To use these exercise files, you must have the following installed: Python
2. Clone this repository into your local machine using the terminal (Mac), CMD (Windows), or a GUI tool like SourceTree.
3. [Course-specific instructions]
3. All python dependencies are included in each branch


### Instructor

Denys Linkov

Machine Learning Lead at Voiceflow

[0]: # (Replace these placeholder URLs with actual course URLs)

[lil-course-url]: https://www.linkedin.com/learning/
[lil-thumbnail-url]: http://
Check out my other courses on [LinkedIn Learning](https://www.linkedin.com/learning/instructors/denys-linkov).

[lil-course-url]: https://www.linkedin.com/learning/building-apps-with-ai-tools-chatgpt-semantic-kernel-and-langchain?dApp=59033956&leis=LAA
[lil-thumbnail-url]: https://media.licdn.com/dms/image/D560DAQENsHoqO_7Y1Q/learning-public-crop_675_1200/0/1694035139061?e=2147483647&v=beta&t=cCnp-C_2NN9JnQM_fHZlVyjfMrGzfgpiGXv5i4Y_5mM
2 changes: 2 additions & 0 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
openai==0.27.8
python-dotenv==1.0.0
32 changes: 32 additions & 0 deletions src/rude_customer_detector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import os
import openai
from dotenv import load_dotenv
load_dotenv()
openai.api_key = os.getenv('OPENAI_API_KEY')

# test case 1 'you're the worst human i've talked to' -> RUDE
# test case 2 'hey how's your day going'
# test case 3 'I like pizza. What do you like?'
# test case 4 'I bite my thumb at you!'
# test case 5 'I think this product doesnt work!' -> RUDE
print("\n\nBot: Hey how's it going?")
while True:
user_input = input("")
if user_input == "exit" or user_input == "quit":
break
response = openai.ChatCompletion.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a pizza loving person. If someone says something rude print exactly 'RUDE', otherwise respond"},
{"role": "user", "content": user_input}
],
temperature=0.7,
max_tokens=150,
)

response_message = response["choices"][0]["message"]
response_content = response_message["content"]
if response_content == "RUDE":
print("I don't talk to rude people goodbye")
break
print("Bot:" + response_content)