import openai
# Set your OpenAI API key
openai.api_key = "your-openai-api-key"
# Define the text you want to analyze or interact with
text = "I am very happy today!"
# Make a request to the OpenAI GPT-3.5 API
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo-0125",
messages=[
{"role": "system", "content": "Analyze the sentiment of the following text:"},
{"role": "user", "content": text}
]
)
# Extract the response text
response_text = response['choices'][0]['message']['content'].strip()
print("Response from GPT-3.5:", response_text)
forked from wcr2000/flask-app-gpt
-
Notifications
You must be signed in to change notification settings - Fork 0
manitchaya2004/flask-app-gpt
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Python 89.7%
- Dockerfile 10.3%