Class AssistantResponseFormatOption
- 
                    
                    - All Implemented Interfaces:
 
 public final class AssistantResponseFormatOptionSpecifies the format that the model must output. Compatible with GPT-4o, [GPT-4 - Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since - gpt-3.5-turbo-1106.
 Setting to { "type": "json_schema", "json_schema": {...} }enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.Setting to { "type": "json_object" }enables JSON mode, which ensures the message the model generates is valid JSON.Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceededmax_tokensor the conversation exceeded the max context length.
- 
                
                    
                    - 
                                
                            
                                Nested Class SummaryNested Classes Modifier and Type Class Description public interfaceAssistantResponseFormatOption.VisitorAn interface that defines how to map each variant of AssistantResponseFormatOption to a value of type T. 
 - 
                                
                            
                                Method Summary- 
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        responseFormatTextfinal Optional<ResponseFormatText> responseFormatText() Default response format. Used to generate text responses. 
 - 
                                        responseFormatJsonObjectfinal Optional<ResponseFormatJsonObject> responseFormatJsonObject() JSON object response format. An older method of generating JSON responses. Using json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
 - 
                                        responseFormatJsonSchemafinal Optional<ResponseFormatJsonSchema> responseFormatJsonSchema() JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs. 
 - 
                                        isResponseFormatTextfinal Boolean isResponseFormatText() 
 - 
                                        isResponseFormatJsonObjectfinal Boolean isResponseFormatJsonObject() 
 - 
                                        isResponseFormatJsonSchemafinal Boolean isResponseFormatJsonSchema() 
 - 
                                        asResponseFormatTextfinal ResponseFormatText asResponseFormatText() Default response format. Used to generate text responses. 
 - 
                                        asResponseFormatJsonObjectfinal ResponseFormatJsonObject asResponseFormatJsonObject() JSON object response format. An older method of generating JSON responses. Using json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
 - 
                                        asResponseFormatJsonSchemafinal ResponseFormatJsonSchema asResponseFormatJsonSchema() JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs. 
 - 
                                        acceptfinal <T extends Any> T accept(AssistantResponseFormatOption.Visitor<T> visitor) 
 - 
                                        validatefinal AssistantResponseFormatOption validate() 
 - 
                                        ofAutofinal static AssistantResponseFormatOption ofAuto() autois the default value
 - 
                                        ofResponseFormatTextfinal static AssistantResponseFormatOption ofResponseFormatText(ResponseFormatText responseFormatText) Default response format. Used to generate text responses. 
 - 
                                        ofResponseFormatJsonObjectfinal static AssistantResponseFormatOption ofResponseFormatJsonObject(ResponseFormatJsonObject responseFormatJsonObject) JSON object response format. An older method of generating JSON responses. Using json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
 - 
                                        ofResponseFormatJsonSchemafinal static AssistantResponseFormatOption ofResponseFormatJsonSchema(ResponseFormatJsonSchema responseFormatJsonSchema) JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs. 
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-