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

OpenAI-DotNet 8.3.0 #369

Merged
merged 12 commits into from
Sep 19, 2024
Merged

OpenAI-DotNet 8.3.0 #369

merged 12 commits into from
Sep 19, 2024

Conversation

StephenHodgson
Copy link
Member

@StephenHodgson StephenHodgson commented Sep 15, 2024

  • Updated library to .net 8
  • Refactored TypeExtensions and JsonSchema generation
    • Improved JsonSchema generation for enums and dictionaries
    • Ensured JsonSchema properly handles nullable types
  • Ensure that function args are not re-serialized and passed back into tool function for future calls

Copilot Summary:

This pull request includes several updates across multiple files, focusing on upgrading the target framework, improving JSON schema generation, and enhancing code quality. The most important changes include upgrading the project files to use .NET 8.0, adding a new test for JSON schema generation, and refactoring the JSON schema generation logic in TypeExtensions.

Framework Upgrade:

  • Upgraded the target framework from net6.0 to net8.0 in OpenAI-DotNet-Proxy.csproj, OpenAI-DotNet-Tests-Proxy.csproj, and OpenAI-DotNet-Tests.csproj.

Testing Enhancements:

  • Added Test_02_02_GenerateJsonSchema_PrimitiveTypes method to test JSON schema generation for various primitive types.

JSON Schema Generation Refactoring:

  • Refactored TypeExtensions to improve JSON schema generation, including adding helper methods like TryGetSimpleTypeSchema, TryGetDictionaryValueType, and TryGetCollectionElementType.

Code Quality and Consistency:

  • Replaced toolList.Any() with toolList is { Count: > 0 } and added logic to clear lingering function arguments in ChatRequest.
  • Updated JsonConverter attributes to use Extensions.JsonStringEnumConverter in multiple files for consistency.

Other Changes:

  • Removed .gitattributes file to simplify repository configuration.

- Updated library to .net 8
- Refactored TypeExtensions and JsonSchema generation
  - Improved JsonSchema generation for enums and dictionaries
  - Ensured JsonSchema properly handles nullable types
Copy link
Collaborator

@ADefWebserver ADefWebserver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gave me a lot of breaking changes. I won't have time to address them until next week.

@StephenHodgson
Copy link
Member Author

StephenHodgson commented Sep 16, 2024

This gave me a lot of breaking changes. I won't have time to address them until next week.

From 8.2.x or 8.1.x?

What exactly was breaking for you?

@ADefWebserver
Copy link
Collaborator

From 8.2.x or 8.1.x?

What exactly was breaking for you?

I was on 7.7.7 😔
I get:
System.MissingMethodException: Method not found: void OpenAI.OpenAIAuthentication..ctor(string,string,string)
(I'll be offline until tomorrow)

@StephenHodgson StephenHodgson marked this pull request as ready for review September 18, 2024 13:13
@StephenHodgson StephenHodgson marked this pull request as draft September 18, 2024 13:14
@StephenHodgson StephenHodgson marked this pull request as ready for review September 19, 2024 14:08
@StephenHodgson StephenHodgson merged commit 09ddbdc into main Sep 19, 2024
5 checks passed
@StephenHodgson StephenHodgson deleted the development branch September 19, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants