Record Class OpenAiApi.ChatCompletionRequest.ToolChoice
java.lang.Object
java.lang.Record
org.springframework.ai.openai.api.OpenAiApi.ChatCompletionRequest.ToolChoice
- Record Components:
type
- The type of the tool. Currently, only 'function' is supported.function
- single field map for type 'name':'your function name'.
- Enclosing class:
OpenAiApi.ChatCompletionRequest
public static record OpenAiApi.ChatCompletionRequest.ToolChoice(String type, Map<String,String> function)
extends Record
Specifies a tool the model should use. Use to force the model to call a specific function.
-
Constructor Summary
ConstructorsConstructorDescriptionToolChoice
(String functionName) Create a tool choice of type 'function' and name 'functionName'.ToolChoice
(String type, Map<String, String> function) Creates an instance of aToolChoice
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.function()
Returns the value of thefunction
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.
-
Constructor Details
-
ToolChoice
Create a tool choice of type 'function' and name 'functionName'.- Parameters:
functionName
- Function name of the tool.
-
ToolChoice
Creates an instance of aToolChoice
record class.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
function
Returns the value of thefunction
record component.- Returns:
- the value of the
function
record component
-