Skip to content

Commit e45f18d

Browse files
authored
feat(chat): support required toolchoice mode (#429)
As defined in https://platform.openai.com/docs/guides/function-calling#additional-configurations
1 parent 36e99cd commit e45f18d

File tree

1 file changed

+3
-0
lines changed
  • openai-core/src/commonMain/kotlin/com.aallam.openai.api/chat

1 file changed

+3
-0
lines changed

openai-core/src/commonMain/kotlin/com.aallam.openai.api/chat/ToolChoice.kt

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ public sealed interface ToolChoice {
3636
/** Represents the `none` mode. */
3737
public val None: ToolChoice = Mode("none")
3838

39+
/** Represents the `required` mode. */
40+
public val Required: ToolChoice = Mode("required")
41+
3942
/** Specifies a function for the model to call **/
4043
public fun function(name: String): ToolChoice =
4144
Named(type = ToolType.Function, function = FunctionToolChoice(name = name))

0 commit comments

Comments
 (0)