Playing with chat GPT
This commit is contained in:
@@ -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/
|
||||
@@ -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'),
|
||||
|
||||
@@ -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
@@ -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
|
||||
Reference in New Issue
Block a user