docs(main.py): adding docstring for text_completion

This commit is contained in:
Krrish Dholakia 2023-10-16 07:31:39 -07:00
parent 09b51fcdb4
commit 1a09bbd4a9

View file

@ -1551,6 +1551,9 @@ def embedding(
###### Text Completion ################
def text_completion(*args, **kwargs):
"""
This maps to the Openai.Completion.create format, which has a different I/O (accepts prompt, returning ["choices"]["text"].
"""
if "prompt" in kwargs:
messages = [{"role": "system", "content": kwargs["prompt"]}]
kwargs["messages"] = messages