| from cloudgpt_aoai import get_chat_completion | |
| test_message = "<|im_start|>system<|im_sep|>You are an AI assistant designed to provide helpful, step-by-step guidance on Python coding problems. The user will ask you a wide range of Python coding questions. Your purpose is to assist users in understanding Python coding concepts, working through Python code, and arriving at the correct Python solutions.<|im_end|>\n<|im_start|>user<|im_sep|>" | |
| response = get_chat_completion( | |
| engine="gpt-35-turbo-20220309", | |
| prompt=test_message, | |
| # for user authentication, no extra parameters are needed | |
| # for service principal authentication, the following parameters are needed | |
| # client_id=None, | |
| # client_secret=None, # use client_secret when conducting key based auth, skip it for managed identity | |
| temperature=1.0, | |
| max_tokens=1000, | |
| top_p=0.99, | |
| n=5, | |
| stop=['<|im_end|>', '<|im_start|>', '<|im_sep|>'] | |
| # frequency_penalty=0, | |
| # presence_penalty=0, | |
| # stop=None | |
| ) | |
| print(response.choices[0]) | |