Telegram chatbot (incomplete)

you need to pass the chat history
for example of request body:

{
“n”: 1,
“model”: “gpt-3.5-turbo-0301”,
“top_p”: 1,
“messages”: [
{
“role”: “user”,
“content”: “hi my name is dorian”
},
{
“role”: “system”,
“content”: “hi dorian”
},
{
“role”: “user”,
“content”: “what is my name?”
}
],
“logit_bias”: {},
“max_tokens”: 300,
“temperature”: 1,
“response_format”: {
“type”: “text”
}
}

you need to use stored procedure and hold the chat history per chat and then pass it through the module… for example:

and here is the open.ai documentation for chat completions:
Text generation - OpenAI API

2 Likes