youngtsai commited on
Commit
e49fd5e
·
1 Parent(s): c3f0b80

response = openai_client.chat.completions.create(

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -56,9 +56,12 @@ def generate_new_article(lesson_words, original_article, original_word_count, ba
56
  "Original Article" for Reference: The example provided is {original_article}。This article serves as a model for the spirit, style, and rhythmic pattern to be emulated.
57
  """
58
 
59
- response = openai_client.Completion.create(
60
- model="text-davinci-003",
61
- prompt=prompt,
 
 
 
62
  max_tokens=1000
63
  )
64
 
 
56
  "Original Article" for Reference: The example provided is {original_article}。This article serves as a model for the spirit, style, and rhythmic pattern to be emulated.
57
  """
58
 
59
+ response = openai_client.chat.completions.create(
60
+ model="gpt-4-0125-preview",
61
+ messages=[
62
+ {"role": "system", "content": "You are a creative writer specialized in Chinese Children book. You will help me write Chinese Articles."},
63
+ {"role": "user", "content": prompt}
64
+ ],
65
  max_tokens=1000
66
  )
67