Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import streamlit as st
|
| 3 |
+
import openai
|
| 4 |
+
os.environ['OPENAI_API_KEY']='sk-proj-uHasdgbriPPlFMm99ZtJT3BlbkFJOl231YfdxCSNmQjVEpMX'
|
| 5 |
+
response=openai.chat.completions.create(
|
| 6 |
+
model="gpt-3.5-turbo",
|
| 7 |
+
messages=[
|
| 8 |
+
{"role": "system", "content": "Hello!, How can I assist you"},
|
| 9 |
+
{'role':'user','content':"Tell me about India"}
|
| 10 |
+
]
|
| 11 |
+
)
|
| 12 |
+
st.write(response.choices[0].message.content)
|