Spaces:
Sleeping
Sleeping
| 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) | |