text2text icon indicating copy to clipboard operation
text2text copied to clipboard

qg not working 2024

Open andre-macdonald opened this issue 1 year ago • 2 comments

T2T error 2nd try @artitw Please Help?

andre-macdonald avatar Jul 30 '24 12:07 andre-macdonald

We're deprecating that way in favor of

import text2text as t2t
asst = t2t.Assistant()

# Streaming example
chat_history = [
    {"role": "user",  "content": """
    Generate quiz questions for the following facts:
    (1) I will go to school today and take my math exam.
    (2) I will go to school today and take my math exam.
    (3) Tomorrow is my cousin's birthday. He will turn 24 years old.
    (4) Tomorrow is my cousin's birthday. He will turn 24 years old. (Answer is 24 years old.)
    """}
]

result = asst.chat_completion(chat_history, stream=True)
for chunk in result:
  print(chunk['message']['content'], end='', flush=True)

Can you try this and let us know if it works?

artitw avatar Jul 30 '24 15:07 artitw

Working! Thank you so much.

andre-macdonald avatar Jul 31 '24 07:07 andre-macdonald