docs(main.py): adding docstring for text_completion

This commit is contained in:
Krrish Dholakia 2023-10-16 07:31:39 -07:00
parent 1e438fc626
commit 38fa9827d5

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