diff --git a/dotnet/src/Agents/OpenAI/Extensions/KernelFunctionExtensions.cs b/dotnet/src/Agents/OpenAI/Extensions/KernelFunctionExtensions.cs index c4acca58770f..1a4b6fc2fbf6 100644 --- a/dotnet/src/Agents/OpenAI/Extensions/KernelFunctionExtensions.cs +++ b/dotnet/src/Agents/OpenAI/Extensions/KernelFunctionExtensions.cs @@ -81,6 +81,11 @@ private static string ConvertType(Type? type) return "array"; } + if (type == typeof(DateTime) || type == typeof(DateTimeOffset)) + { + return "date-time"; + } + return Type.GetTypeCode(type) switch { TypeCode.SByte or TypeCode.Byte or diff --git a/dotnet/src/Agents/UnitTests/OpenAI/Extensions/KernelFunctionExtensionsTests.cs b/dotnet/src/Agents/UnitTests/OpenAI/Extensions/KernelFunctionExtensionsTests.cs index acf195840366..3710b4841ab3 100644 --- a/dotnet/src/Agents/UnitTests/OpenAI/Extensions/KernelFunctionExtensionsTests.cs +++ b/dotnet/src/Agents/UnitTests/OpenAI/Extensions/KernelFunctionExtensionsTests.cs @@ -58,7 +58,7 @@ public void TestFunction1() { } [KernelFunction] [Description("test description")] #pragma warning disable IDE0060 // Unused parameter for mock kernel function - public void TestFunction2(string p1, bool p2, int p3, string[] p4, ConsoleColor p5, OpenAIAssistantDefinition p6) { } + public void TestFunction2(string p1, bool p2, int p3, string[] p4, ConsoleColor p5, OpenAIAssistantDefinition p6, DateTime p7) { } #pragma warning restore IDE0060 // Unused parameter } }