You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement support for versioned prompt files (#13)
* Update package dependencies and refactor schema property access
- Updated core and test project dependencies: Fluid.Core to 2.25.0, JsonSchema.Net to 7.4.0, OpenAI to 2.3.0, Microsoft.NET.Test.Sdk to 17.14.1, and xUnit packages to their latest versions.
- Refactored internal schema property access in OpenAi options tests to use a helper method for better maintainability.
- Introduced a private helper method `GetInternalProperty` for consistent property access logic.
* Add prompt version support and enhance PromptManager functionality
- Introduced a `Version` property to `PromptFile` with validation for negative values.
- Updated `PromptManager` to uniquely identify prompt files by name and version using the new `PromptFileIdentifier` record.
- Added `GetPromptFile` overload for version-specific retrieval and a method to list prompt filenames with versions.
- Updated tests to cover new functionalities, ensuring proper behavior and version management.
* Add support for multiple prompt versions and accompanying tests
- Added `multiple-version-prompts` directory with sample prompt versions.
- Updated project file to include new directory in the build output.
- Introduced `PromptManager_WithDifferentVersions_LoadsSuccessfully` test to validate version handling.
* Add unit tests for PromptManager version handling and invalid version exceptions
- Added tests verifying PromptManager retrieves correct prompt file when requested by name and version.
- Introduced tests confirming exceptions are thrown for invalid versions in PromptManager and PromptFile.
* Add version assertion to `PromptFileTests` to verify default `Version` property values
* Document `version` property usage in README
- Added explanation of the optional `version` property in configuration.
- Included examples of version-specific prompt file loading in code snippets.
* Add Codecov configuration with coverage threshold settings
- Introduced `codecov.yml` to manage Codecov project and patch thresholds, set at 3% for both.
Copy file name to clipboardExpand all lines: DotPrompt.Tests/Extensions/OpenAi/OpenAiExtensionsTests.cs
+24-6Lines changed: 24 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
usingSystem.Reflection;
1
2
usingDotPrompt.Extensions.OpenAi;
2
3
usingOpenAI.Chat;
3
4
@@ -105,13 +106,10 @@ public void ToOpenAiChatCompletionOptions_WithJsonSchemaFormat_ReturnsAValidOpti
105
106
106
107
conststringexpectedSchema="""{"type":"object","required":["field1"],"properties":{"field1":{"type":"string","description":"An example description for the field"},"field2":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}""";
0 commit comments