Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Support DateTime parameters in tools for Assistants API #9940 #10037

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Loading