Class ResponseCreateParams

    • Constructor Detail

    • Method Detail

      • model

         final ChatModel model()

        Model ID used to generate the response, like gpt-4o or o1. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.

      • include

         final Optional<List<ResponseIncludable>> include()

        Specify additional output data to include in the model response. Currently supported values are:

        • file_search_call.results: Include the search results of the file search tool call.

        • message.input_image.image_url: Include image urls from the input message.

        • computer_call_output.output.image_url: Include image urls from the computer call output.

      • instructions

         final Optional<String> instructions()

        Inserts a system (or developer) message as the first item in the model's context.

        When using along with previous_response_id, the instructions from a previous response will be not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.

      • metadata

         final Optional<Metadata> metadata()

        Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.

        Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

      • store

         final Optional<Boolean> store()

        Whether to store the generated model response for later retrieval via API.

      • temperature

         final Optional<Double> temperature()

        What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.

      • tools

         final Optional<List<Tool>> tools()

        An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter.

        The two categories of tools you can provide the model are:

        • Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.

        • Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code. Learn more about function calling.

      • topP

         final Optional<Double> topP()

        An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

        We generally recommend altering this or temperature but not both.

      • truncation

         final Optional<ResponseCreateParams.Truncation> truncation()

        The truncation strategy to use for the model response.

        • auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.

        • disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.

      • user

         final Optional<String> user()

        A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

      • _model

         final JsonField<ChatModel> _model()

        Model ID used to generate the response, like gpt-4o or o1. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.

      • _include

         final JsonField<List<ResponseIncludable>> _include()

        Specify additional output data to include in the model response. Currently supported values are:

        • file_search_call.results: Include the search results of the file search tool call.

        • message.input_image.image_url: Include image urls from the input message.

        • computer_call_output.output.image_url: Include image urls from the computer call output.

      • _instructions

         final JsonField<String> _instructions()

        Inserts a system (or developer) message as the first item in the model's context.

        When using along with previous_response_id, the instructions from a previous response will be not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.

      • _metadata

         final JsonField<Metadata> _metadata()

        Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.

        Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

      • _store

         final JsonField<Boolean> _store()

        Whether to store the generated model response for later retrieval via API.

      • _temperature

         final JsonField<Double> _temperature()

        What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.

      • _tools

         final JsonField<List<Tool>> _tools()

        An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter.

        The two categories of tools you can provide the model are:

        • Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.

        • Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code. Learn more about function calling.

      • _topP

         final JsonField<Double> _topP()

        An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

        We generally recommend altering this or temperature but not both.

      • _truncation

         final JsonField<ResponseCreateParams.Truncation> _truncation()

        The truncation strategy to use for the model response.

        • auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.

        • disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.

      • _user

         final JsonField<String> _user()

        A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

      • _headers

         Headers _headers()

        The full set of headers in the parameters, including both fixed and additional headers.

      • _queryParams

         QueryParams _queryParams()

        The full set of query params in the parameters, including both fixed and additional query params.