openai icon indicating copy to clipboard operation
openai copied to clipboard

feat: Add support for custom types in function parameters

Open Cheyenne1025 opened this issue 11 months ago • 3 comments

  • Update GetFunctionDefinition method to handle custom types as function parameters
  • Recursively process properties of custom types
  • Generate object type property definitions for custom types
  • Add GetPropertyDefinition method to create property definitions based on property type
  • Update CallFunction method to handle custom type parameters
  • Add tests for custom type support
  • VerifyGetFunctionDefinition_CustomType test to verify function definition generation for custom types
  • VerifyCallFunction_CustomType test to verify function calling with custom type parameters
  • Add tests for complex custom types
  • VerifyGetFunctionDefinition_ComplexCustomType test to verify function definition generation for complex custom types with nested custom types
  • VerifyCallFunction_ComplexCustomType test to verify function calling with complex custom type parameters
  • Add CustomType and ComplexCustomType classes for testing purposes

Cheyenne1025 avatar Mar 20 '24 06:03 Cheyenne1025

It seems we have to set the dev branch as the target of our PR.

Removable avatar Mar 22 '24 03:03 Removable

The unit test you wrote is failing. Could you please fix it?

kayhantolga avatar Apr 03 '24 17:04 kayhantolga

The code is unable to handle self-referenced objects. Please test with the following complex object:

public class ABC
{
   public string A { get; set; }
   public ABC b { get; set; }
}

kayhantolga avatar Apr 03 '24 17:04 kayhantolga