corvo7's picture
Update app.py
be2c0d0 verified
raw
history blame contribute delete
463 Bytes
import openai
import os
import streamlit as s
os.environ["OPENAI_API_KEY"]="sk-proj-uHasdgbriPPlFMm99ZtJT3BlbkFJOl231YfdxCSNmQjVEpMX"
q=s.text_input("type any message")
responds=openai.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "you are a very good assistant"},# set the behaviour of
{"role": "user", "content":q}
],
temperature=0,
max_tokens=200
)
s.write(responds.choices[0].message.content)