Class ThreadCreateAndRunParams.Builder
- 
                    
                    - All Implemented Interfaces:
 
 public final class ThreadCreateAndRunParams.BuilderA builder for ThreadCreateAndRunParams. 
- 
                
                    
                    - 
                                
                            
                                Method Summary- 
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        bodyfinal ThreadCreateAndRunParams.Builder body(ThreadCreateAndRunParams.Body body) Sets the entire request body. This is generally only useful if you are already constructing the body separately. Otherwise, it's more convenient to use the top-level setters instead: 
 - 
                                        assistantIdfinal ThreadCreateAndRunParams.Builder assistantId(String assistantId) The ID of the assistant to use to execute this run. 
 - 
                                        assistantIdfinal ThreadCreateAndRunParams.Builder assistantId(JsonField<String> assistantId) Sets Builder.assistantId to an arbitrary JSON value. You should usually call Builder.assistantId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        instructionsfinal ThreadCreateAndRunParams.Builder instructions(String instructions) Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. 
 - 
                                        instructionsfinal ThreadCreateAndRunParams.Builder instructions(Optional<String> instructions) Alias for calling Builder.instructions with instructions.orElse(null).
 - 
                                        instructionsfinal ThreadCreateAndRunParams.Builder instructions(JsonField<String> instructions) Sets Builder.instructions to an arbitrary JSON value. You should usually call Builder.instructions with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        maxCompletionTokensfinal ThreadCreateAndRunParams.Builder maxCompletionTokens(Long maxCompletionTokens) The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status incomplete. Seeincomplete_detailsfor more info.
 - 
                                        maxCompletionTokensfinal ThreadCreateAndRunParams.Builder maxCompletionTokens(Long maxCompletionTokens) Alias for Builder.maxCompletionTokens. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        maxCompletionTokensfinal ThreadCreateAndRunParams.Builder maxCompletionTokens(Optional<Long> maxCompletionTokens) Alias for calling Builder.maxCompletionTokens with maxCompletionTokens.orElse(null).
 - 
                                        maxCompletionTokensfinal ThreadCreateAndRunParams.Builder maxCompletionTokens(JsonField<Long> maxCompletionTokens) Sets Builder.maxCompletionTokens to an arbitrary JSON value. You should usually call Builder.maxCompletionTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        maxPromptTokensfinal ThreadCreateAndRunParams.Builder maxPromptTokens(Long maxPromptTokens) The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status incomplete. Seeincomplete_detailsfor more info.
 - 
                                        maxPromptTokensfinal ThreadCreateAndRunParams.Builder maxPromptTokens(Long maxPromptTokens) Alias for Builder.maxPromptTokens. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        maxPromptTokensfinal ThreadCreateAndRunParams.Builder maxPromptTokens(Optional<Long> maxPromptTokens) Alias for calling Builder.maxPromptTokens with maxPromptTokens.orElse(null).
 - 
                                        maxPromptTokensfinal ThreadCreateAndRunParams.Builder maxPromptTokens(JsonField<Long> maxPromptTokens) Sets Builder.maxPromptTokens to an arbitrary JSON value. You should usually call Builder.maxPromptTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        metadatafinal ThreadCreateAndRunParams.Builder metadata(ThreadCreateAndRunParams.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. 
 - 
                                        metadatafinal ThreadCreateAndRunParams.Builder metadata(Optional<ThreadCreateAndRunParams.Metadata> metadata) Alias for calling Builder.metadata with metadata.orElse(null).
 - 
                                        metadatafinal ThreadCreateAndRunParams.Builder metadata(JsonField<ThreadCreateAndRunParams.Metadata> metadata) Sets Builder.metadata to an arbitrary JSON value. You should usually call Builder.metadata with a well-typed Metadata value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        modelfinal ThreadCreateAndRunParams.Builder model(ChatModel model) The ID of the Model to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. 
 - 
                                        modelfinal ThreadCreateAndRunParams.Builder model(Optional<ChatModel> model) Alias for calling Builder.model with model.orElse(null).
 - 
                                        modelfinal ThreadCreateAndRunParams.Builder model(JsonField<ChatModel> model) Sets Builder.model to an arbitrary JSON value. You should usually call Builder.model with a well-typed ChatModel value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        modelfinal ThreadCreateAndRunParams.Builder model(String value) Sets model to an arbitrary String. You should usually call model with a well-typed ChatModel constant instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        parallelToolCallsfinal ThreadCreateAndRunParams.Builder parallelToolCalls(Boolean parallelToolCalls) Whether to enable parallel function calling during tool use. 
 - 
                                        parallelToolCallsfinal ThreadCreateAndRunParams.Builder parallelToolCalls(JsonField<Boolean> parallelToolCalls) Sets Builder.parallelToolCalls to an arbitrary JSON value. You should usually call Builder.parallelToolCalls with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        responseFormatfinal ThreadCreateAndRunParams.Builder responseFormat(AssistantResponseFormatOption responseFormat) Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 * Turbo, 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.
 - 
                                        responseFormatfinal ThreadCreateAndRunParams.Builder responseFormat(Optional<AssistantResponseFormatOption> responseFormat) Alias for calling Builder.responseFormat with responseFormat.orElse(null).
 - 
                                        responseFormatfinal ThreadCreateAndRunParams.Builder responseFormat(JsonField<AssistantResponseFormatOption> responseFormat) Sets Builder.responseFormat to an arbitrary JSON value. You should usually call Builder.responseFormat with a well-typed AssistantResponseFormatOption value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        responseFormatfinal ThreadCreateAndRunParams.Builder responseFormat(ResponseFormatText responseFormatText) Alias for calling responseFormat with AssistantResponseFormatOption.ofResponseFormatText(responseFormatText).
 - 
                                        responseFormatfinal ThreadCreateAndRunParams.Builder responseFormat(ResponseFormatJsonObject responseFormatJsonObject) Alias for calling responseFormat with AssistantResponseFormatOption.ofResponseFormatJsonObject(responseFormatJsonObject).
 - 
                                        responseFormatfinal ThreadCreateAndRunParams.Builder responseFormat(ResponseFormatJsonSchema responseFormatJsonSchema) Alias for calling responseFormat with AssistantResponseFormatOption.ofResponseFormatJsonSchema(responseFormatJsonSchema).
 - 
                                        responseFormatAutofinal ThreadCreateAndRunParams.Builder responseFormatAuto() Alias for calling responseFormat with AssistantResponseFormatOption.ofAuto().
 - 
                                        temperaturefinal ThreadCreateAndRunParams.Builder temperature(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. 
 - 
                                        temperaturefinal ThreadCreateAndRunParams.Builder temperature(Double temperature) Alias for Builder.temperature. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        temperaturefinal ThreadCreateAndRunParams.Builder temperature(Optional<Double> temperature) Alias for calling Builder.temperature with temperature.orElse(null).
 - 
                                        temperaturefinal ThreadCreateAndRunParams.Builder temperature(JsonField<Double> temperature) Sets Builder.temperature to an arbitrary JSON value. You should usually call Builder.temperature with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        threadfinal ThreadCreateAndRunParams.Builder thread(ThreadCreateAndRunParams.Thread thread) Options to create a new thread. If no thread is provided when running a request, an empty thread will be created. 
 - 
                                        threadfinal ThreadCreateAndRunParams.Builder thread(JsonField<ThreadCreateAndRunParams.Thread> thread) Sets Builder.thread to an arbitrary JSON value. You should usually call Builder.thread with a well-typed Thread value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        toolChoicefinal ThreadCreateAndRunParams.Builder toolChoice(AssistantToolChoiceOption toolChoice) Controls which (if any) tool is called by the model. nonemeans the model will not call any tools and instead generates a message.autois the default value and means the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools before responding to the user. Specifying a particular tool like{"type": "file_search"}or{"type": "function", "function": {"name": "my_function"}}forces the model to call that tool.
 - 
                                        toolChoicefinal ThreadCreateAndRunParams.Builder toolChoice(Optional<AssistantToolChoiceOption> toolChoice) Alias for calling Builder.toolChoice with toolChoice.orElse(null).
 - 
                                        toolChoicefinal ThreadCreateAndRunParams.Builder toolChoice(JsonField<AssistantToolChoiceOption> toolChoice) Sets Builder.toolChoice to an arbitrary JSON value. You should usually call Builder.toolChoice with a well-typed AssistantToolChoiceOption value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        toolChoicefinal ThreadCreateAndRunParams.Builder toolChoice(AssistantToolChoiceOption.Auto auto) Alias for calling toolChoice with AssistantToolChoiceOption.ofAuto(auto).
 - 
                                        toolChoicefinal ThreadCreateAndRunParams.Builder toolChoice(AssistantToolChoice assistantToolChoice) Alias for calling toolChoice with AssistantToolChoiceOption.ofAssistantToolChoice(assistantToolChoice).
 - 
                                        toolResourcesfinal ThreadCreateAndRunParams.Builder toolResources(ThreadCreateAndRunParams.ToolResources toolResources) A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the code_interpretertool requires a list of file IDs, while thefile_searchtool requires a list of vector store IDs.
 - 
                                        toolResourcesfinal ThreadCreateAndRunParams.Builder toolResources(Optional<ThreadCreateAndRunParams.ToolResources> toolResources) Alias for calling Builder.toolResources with toolResources.orElse(null).
 - 
                                        toolResourcesfinal ThreadCreateAndRunParams.Builder toolResources(JsonField<ThreadCreateAndRunParams.ToolResources> toolResources) Sets Builder.toolResources to an arbitrary JSON value. You should usually call Builder.toolResources with a well-typed ToolResources value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        toolsfinal ThreadCreateAndRunParams.Builder tools(List<AssistantTool> tools) Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. 
 - 
                                        toolsfinal ThreadCreateAndRunParams.Builder tools(Optional<List<AssistantTool>> tools) Alias for calling Builder.tools with tools.orElse(null).
 - 
                                        toolsfinal ThreadCreateAndRunParams.Builder tools(JsonField<List<AssistantTool>> tools) Sets Builder.tools to an arbitrary JSON value. You should usually call Builder.tools with a well-typed List<AssistantTool>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 - 
                                        addToolfinal ThreadCreateAndRunParams.Builder addTool(AssistantTool tool) Adds a single AssistantTool to tools. 
 - 
                                        addToolfinal ThreadCreateAndRunParams.Builder addTool(CodeInterpreterTool codeInterpreter) Alias for calling addTool with AssistantTool.ofCodeInterpreter(codeInterpreter).
 - 
                                        addToolfinal ThreadCreateAndRunParams.Builder addTool(FileSearchTool fileSearch) Alias for calling addTool with AssistantTool.ofFileSearch(fileSearch).
 - 
                                        addToolfinal ThreadCreateAndRunParams.Builder addTool(FunctionTool function) Alias for calling addTool with AssistantTool.ofFunction(function).
 - 
                                        addFunctionToolfinal ThreadCreateAndRunParams.Builder addFunctionTool(FunctionDefinition function) Alias for calling addTool with the following: FunctionTool.builder() .function(function) .build()
 - 
                                        topPfinal ThreadCreateAndRunParams.Builder topP(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. 
 - 
                                        topPfinal ThreadCreateAndRunParams.Builder topP(Double topP) Alias for Builder.topP. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        topPfinal ThreadCreateAndRunParams.Builder topP(Optional<Double> topP) Alias for calling Builder.topP with topP.orElse(null).
 - 
                                        topPfinal ThreadCreateAndRunParams.Builder topP(JsonField<Double> topP) Sets Builder.topP to an arbitrary JSON value. You should usually call Builder.topP with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        truncationStrategyfinal ThreadCreateAndRunParams.Builder truncationStrategy(ThreadCreateAndRunParams.TruncationStrategy truncationStrategy) Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. 
 - 
                                        truncationStrategyfinal ThreadCreateAndRunParams.Builder truncationStrategy(Optional<ThreadCreateAndRunParams.TruncationStrategy> truncationStrategy) Alias for calling Builder.truncationStrategy with truncationStrategy.orElse(null).
 - 
                                        truncationStrategyfinal ThreadCreateAndRunParams.Builder truncationStrategy(JsonField<ThreadCreateAndRunParams.TruncationStrategy> truncationStrategy) Sets Builder.truncationStrategy to an arbitrary JSON value. You should usually call Builder.truncationStrategy with a well-typed TruncationStrategy value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        additionalBodyPropertiesfinal ThreadCreateAndRunParams.Builder additionalBodyProperties(Map<String, JsonValue> additionalBodyProperties) 
 - 
                                        putAdditionalBodyPropertyfinal ThreadCreateAndRunParams.Builder putAdditionalBodyProperty(String key, JsonValue value) 
 - 
                                        putAllAdditionalBodyPropertiesfinal ThreadCreateAndRunParams.Builder putAllAdditionalBodyProperties(Map<String, JsonValue> additionalBodyProperties) 
 - 
                                        removeAdditionalBodyPropertyfinal ThreadCreateAndRunParams.Builder removeAdditionalBodyProperty(String key) 
 - 
                                        removeAllAdditionalBodyPropertiesfinal ThreadCreateAndRunParams.Builder removeAllAdditionalBodyProperties(Set<String> keys) 
 - 
                                        additionalHeadersfinal ThreadCreateAndRunParams.Builder additionalHeaders(Headers additionalHeaders) 
 - 
                                        additionalHeadersfinal ThreadCreateAndRunParams.Builder additionalHeaders(Map<String, Iterable<String>> additionalHeaders) 
 - 
                                        putAdditionalHeaderfinal ThreadCreateAndRunParams.Builder putAdditionalHeader(String name, String value) 
 - 
                                        putAdditionalHeadersfinal ThreadCreateAndRunParams.Builder putAdditionalHeaders(String name, Iterable<String> values) 
 - 
                                        putAllAdditionalHeadersfinal ThreadCreateAndRunParams.Builder putAllAdditionalHeaders(Headers additionalHeaders) 
 - 
                                        putAllAdditionalHeadersfinal ThreadCreateAndRunParams.Builder putAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders) 
 - 
                                        replaceAdditionalHeadersfinal ThreadCreateAndRunParams.Builder replaceAdditionalHeaders(String name, String value) 
 - 
                                        replaceAdditionalHeadersfinal ThreadCreateAndRunParams.Builder replaceAdditionalHeaders(String name, Iterable<String> values) 
 - 
                                        replaceAllAdditionalHeadersfinal ThreadCreateAndRunParams.Builder replaceAllAdditionalHeaders(Headers additionalHeaders) 
 - 
                                        replaceAllAdditionalHeadersfinal ThreadCreateAndRunParams.Builder replaceAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders) 
 - 
                                        removeAdditionalHeadersfinal ThreadCreateAndRunParams.Builder removeAdditionalHeaders(String name) 
 - 
                                        removeAllAdditionalHeadersfinal ThreadCreateAndRunParams.Builder removeAllAdditionalHeaders(Set<String> names) 
 - 
                                        additionalQueryParamsfinal ThreadCreateAndRunParams.Builder additionalQueryParams(QueryParams additionalQueryParams) 
 - 
                                        additionalQueryParamsfinal ThreadCreateAndRunParams.Builder additionalQueryParams(Map<String, Iterable<String>> additionalQueryParams) 
 - 
                                        putAdditionalQueryParamfinal ThreadCreateAndRunParams.Builder putAdditionalQueryParam(String key, String value) 
 - 
                                        putAdditionalQueryParamsfinal ThreadCreateAndRunParams.Builder putAdditionalQueryParams(String key, Iterable<String> values) 
 - 
                                        putAllAdditionalQueryParamsfinal ThreadCreateAndRunParams.Builder putAllAdditionalQueryParams(QueryParams additionalQueryParams) 
 - 
                                        putAllAdditionalQueryParamsfinal ThreadCreateAndRunParams.Builder putAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams) 
 - 
                                        replaceAdditionalQueryParamsfinal ThreadCreateAndRunParams.Builder replaceAdditionalQueryParams(String key, String value) 
 - 
                                        replaceAdditionalQueryParamsfinal ThreadCreateAndRunParams.Builder replaceAdditionalQueryParams(String key, Iterable<String> values) 
 - 
                                        replaceAllAdditionalQueryParamsfinal ThreadCreateAndRunParams.Builder replaceAllAdditionalQueryParams(QueryParams additionalQueryParams) 
 - 
                                        replaceAllAdditionalQueryParamsfinal ThreadCreateAndRunParams.Builder replaceAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams) 
 - 
                                        removeAdditionalQueryParamsfinal ThreadCreateAndRunParams.Builder removeAdditionalQueryParams(String key) 
 - 
                                        removeAllAdditionalQueryParamsfinal ThreadCreateAndRunParams.Builder removeAllAdditionalQueryParams(Set<String> keys) 
 - 
                                        buildfinal ThreadCreateAndRunParams build() Returns an immutable instance of ThreadCreateAndRunParams. Further updates to this Builder will not mutate the returned instance. The following fields are required: .assistantId()
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-