Text Completion
Once you initialized the client and stored it as a variable, we can simply use the TextCompletion function in the client like this:
local response = client.TextCompletion({
prompt = 'Human: Hello\nAI:',
stop = {
'Human:',
'AI:'
}
})
The response variable will contain the following:
Used model "response.model" (string)
The first choice "response.choice" (table)
Token usage "response.usage" (table)
Last updated
Was this helpful?