Playing with chat GPT

This commit is contained in:
Tomasz Rewak
2023-05-12 23:33:35 +02:00
parent 7ae840d3ab
commit 890e1ee5b6
4 changed files with 23 additions and 1 deletions
+4
View File
@@ -158,3 +158,7 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
# IDE
.vscode/
+3
View File
@@ -8,6 +8,9 @@ app = Dash(__name__)
Magi = load_react_component(app, 'components', 'magi.js')
WiseMan = load_react_component(app, 'components', 'wise_man.js')
# 質問 - question
# 解決 - resolution
app.layout = Magi(id='magi', children=[
WiseMan(id='melchior', name='MELCHIOR', order_number=1, status='yes'),
WiseMan(id='baltasar', name='BALTASAR', order_number=2, status='no'),
+14
View File
@@ -0,0 +1,14 @@
import openai
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the world series in 2020?"},
{"role": "assistant",
"content": "The Los Angeles Dodgers won the World Series in 2020."},
{"role": "user", "content": "Where was it played?"}
]
)
print(response)
+2 -1
View File
@@ -1,2 +1,3 @@
dash==2.9.3
dash-local-react-components==1.3.0
dash-local-react-components==1.3.0
openai==0.27.6