danneu / telegram-chatgpt-bot

a Telegram ChatGPT bot that supports text prompts and two-way voice memos
35 stars 8 forks source link

Support text-davinci-003 #9

Open danneu opened 1 year ago

danneu commented 1 year ago

The text completion api is useful because it's not censored like the chat completion apis. Also, sometimes pure text completion is simply useful.

My uncommitted implementation generates a chat simulation based on the db.listHistory() messages that I normally was feeding into openai.chatCompletions.

For example, I turn this:

Into something like this:

User: Give me a random color.
Assistant: Yellow.
User: Now tell me a random animal.
Assistant: 

It leaves a hanging "Assistant: " so the textCompletion api is solving text completion for something the assistant should say.

danneu commented 1 year ago

I'll close this issue when the TODO checklist is complete.

Since I'm not in the mood to handle davinci token count, I didn't want that item to block me from launching davinci support into production.