Just marking the necessity of the response format and Function Calling features that was recently added by OpenAI to their API
response = openai.Completion.create(
model="gpt-4",
prompt="Translate the following English text to French: 'Hello, how are you?'",
response_format={ "type": "json_object" }
)
this is an example py call for the response format which makes the response adhere to a format in the response and makes it return only JSON so it can be very easily parsed and worked with.
Just marking the necessity of the response format and Function Calling features that was recently added by OpenAI to their API
this is an example py call for the response format which makes the response adhere to a format in the response and makes it return only JSON so it can be very easily parsed and worked with.