gpt4-playground icon indicating copy to clipboard operation
gpt4-playground copied to clipboard

Changing the response message of the model

Open othmanelhoufi opened this issue 2 years ago • 1 comments

Hello,

Thanks for this great tool, I am actually trying to adapt your code for Azure OpenAI API, and I am using the chat completion models, here is the API Response :

{
 'id': 'chatcmpl-6p9XYPYSTTRi0xEviKjjilqrWU2Ve',
 'object': 'chat.completion',
 'created': 1677649420,
 'model': 'gpt-3.5-turbo',
 'usage': {'prompt_tokens': 56, 'completion_tokens': 31, 'total_tokens': 87},
 'choices': [
   {
    'message': {
      'role': 'assistant',
      'content': 'The 2020 World Series was played in Arlington, Texas at the Globe Life Field, which was the new home stadium for the Texas Rangers.'},
    'finish_reason': 'stop',
    'index': 0
   }
  ]
}

Can you please tell me how to modify the message object you wrote (id, role, content) so that it takes into account the new reponse.

Thanks,

othmanelhoufi avatar Apr 08 '23 12:04 othmanelhoufi

I can certainly take a look at that!

Nashex avatar Apr 08 '23 17:04 Nashex