Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,15 +16,15 @@ def generate_legal_document(doc_type, terms, party_1, party_2):
|
|
| 16 |
Please provide a professional legal document based on these details.
|
| 17 |
"""
|
| 18 |
|
| 19 |
-
# Call OpenAI's
|
| 20 |
-
response = openai.
|
| 21 |
-
model="
|
| 22 |
-
|
| 23 |
max_tokens=1500
|
| 24 |
)
|
| 25 |
|
| 26 |
# Return the generated text
|
| 27 |
-
return response
|
| 28 |
|
| 29 |
# Streamlit UI to collect user inputs
|
| 30 |
st.title("Legal Document Generator")
|
|
|
|
| 16 |
Please provide a professional legal document based on these details.
|
| 17 |
"""
|
| 18 |
|
| 19 |
+
# Call OpenAI's new chat completion API
|
| 20 |
+
response = openai.chat_completions.create(
|
| 21 |
+
model="gpt-4", # or "gpt-3.5-turbo"
|
| 22 |
+
messages=[{"role": "user", "content": prompt}],
|
| 23 |
max_tokens=1500
|
| 24 |
)
|
| 25 |
|
| 26 |
# Return the generated text
|
| 27 |
+
return response['choices'][0]['message']['content']
|
| 28 |
|
| 29 |
# Streamlit UI to collect user inputs
|
| 30 |
st.title("Legal Document Generator")
|