openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
OpenAI.Responses/src/Custom/Tools/Internal/InternalToolChoiceOptions.Serialization.cs
15lines · modecode
| 1 | namespace OpenAI.Responses; |
| 2 | |
| 3 | internal static partial class InternalToolChoiceOptionsExtensions |
| 4 | { |
| 5 | internal static ResponseToolChoiceKind ToResponseToolChoiceKind(this InternalToolChoiceOptions options) |
| 6 | { |
| 7 | return options.ToString() switch |
| 8 | { |
| 9 | "none" => ResponseToolChoiceKind.None, |
| 10 | "auto" => ResponseToolChoiceKind.Auto, |
| 11 | "required" => ResponseToolChoiceKind.Required, |
| 12 | _ => ResponseToolChoiceKind.Unknown, |
| 13 | }; |
| 14 | } |
| 15 | } |