Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
from dotenv import load_dotenv
|
| 2 |
import os
|
| 3 |
import gradio as gr
|
|
|
|
| 4 |
import openai
|
| 5 |
|
| 6 |
|
|
@@ -11,7 +12,7 @@ openai.api_key = os.getenv("OPENAI_API_KEY")
|
|
| 11 |
def generate_itinerary(destination):
|
| 12 |
prompt = f"Create a personalized 3-day itinerary for a trip to {destination}. Include activities, restaurants, and general tips."
|
| 13 |
|
| 14 |
-
response = openai.
|
| 15 |
model="text-davinci-003",
|
| 16 |
prompt=prompt,
|
| 17 |
max_tokens=500
|
|
|
|
| 1 |
from dotenv import load_dotenv
|
| 2 |
import os
|
| 3 |
import gradio as gr
|
| 4 |
+
#from openai import AsyncOpenAI
|
| 5 |
import openai
|
| 6 |
|
| 7 |
|
|
|
|
| 12 |
def generate_itinerary(destination):
|
| 13 |
prompt = f"Create a personalized 3-day itinerary for a trip to {destination}. Include activities, restaurants, and general tips."
|
| 14 |
|
| 15 |
+
response = openai.chat.completions.create(
|
| 16 |
model="text-davinci-003",
|
| 17 |
prompt=prompt,
|
| 18 |
max_tokens=500
|