Skip to content
Merged
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
8 changes: 7 additions & 1 deletion .dotnet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@

### Features Added

- Added `OpenAIAudioModelFactory`, `OpenAIEmbeddingsModelFactory`, and `OpenAIImagesModelFactory` static classes to the `Audio`, `Embeddings`, and `Images` namespaces, respectively. Model factories can be used to instantiate OpenAI models for mocking in non-live test scenarios.
- Added the following model factories (static classes that can be used to instantiate OpenAI models for mocking in non-live test scenarios):
- `OpenAIAudioModelFactory` in the `OpenAI.Audio` namespace
- `OpenAIEmbeddingsModelFactory` in the `OpenAI.Embeddings` namespace
- `OpenAIFilesModelFactory` in the `OpenAI.Files` namespace
- `OpenAIImagesModelFactory` in the `OpenAI.Images` namespace
- `OpenAIModelsModelFactory` in the `OpenAI.Models` namespace
- `OpenAIModerationsModelFactory` in the `OpenAI.Moderations` namespace

### Breaking Changes

Expand Down
14 changes: 14 additions & 0 deletions .dotnet/api/OpenAI.netstandard2.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,10 @@ public class OpenAIFileInfoCollection : ObjectModel.ReadOnlyCollection<OpenAIFil
public static bool operator !=(OpenAIFilePurpose left, OpenAIFilePurpose right);
public override readonly string ToString();
}
public static class OpenAIFilesModelFactory {
public static OpenAIFileInfo OpenAIFileInfo(string id = null, long? sizeInBytes = null, DateTimeOffset createdAt = default, string filename = null, OpenAIFilePurpose purpose = default, OpenAIFileStatus status = default, string statusDetails = null);
public static OpenAIFileInfoCollection OpenAIFileInfoCollection(IEnumerable<OpenAIFileInfo> items = null);
}
public readonly partial struct OpenAIFileStatus : IEquatable<OpenAIFileStatus> {
private readonly object _dummy;
private readonly int _dummyPrimitive;
Expand Down Expand Up @@ -1927,6 +1931,10 @@ public class OpenAIModelInfoCollection : ObjectModel.ReadOnlyCollection<OpenAIMo
string IPersistableModel<OpenAIModelInfoCollection>.GetFormatFromOptions(ModelReaderWriterOptions options);
BinaryData IPersistableModel<OpenAIModelInfoCollection>.Write(ModelReaderWriterOptions options);
}
public static class OpenAIModelsModelFactory {
public static OpenAIModelInfo OpenAIModelInfo(string id = null, DateTimeOffset createdAt = default, string ownedBy = null);
public static OpenAIModelInfoCollection OpenAIModelInfoCollection(IEnumerable<OpenAIModelInfo> items = null);
}
}
namespace OpenAI.Moderations {
public class ModerationCategories : IJsonModel<ModerationCategories>, IPersistableModel<ModerationCategories> {
Expand Down Expand Up @@ -1999,6 +2007,12 @@ public class ModerationResult : IJsonModel<ModerationResult>, IPersistableModel<
string IPersistableModel<ModerationResult>.GetFormatFromOptions(ModelReaderWriterOptions options);
BinaryData IPersistableModel<ModerationResult>.Write(ModelReaderWriterOptions options);
}
public static class OpenAIModerationsModelFactory {
public static ModerationCategories ModerationCategories(bool hate = false, bool hateThreatening = false, bool harassment = false, bool harassmentThreatening = false, bool selfHarm = false, bool selfHarmIntent = false, bool selfHarmInstructions = false, bool sexual = false, bool sexualMinors = false, bool violence = false, bool violenceGraphic = false);
public static ModerationCategoryScores ModerationCategoryScores(float hate = 0, float hateThreatening = 0, float harassment = 0, float harassmentThreatening = 0, float selfHarm = 0, float selfHarmIntent = 0, float selfHarmInstructions = 0, float sexual = 0, float sexualMinors = 0, float violence = 0, float violenceGraphic = 0);
public static ModerationCollection ModerationCollection(string id = null, string model = null, IEnumerable<ModerationResult> items = null);
public static ModerationResult ModerationResult(bool flagged = false, ModerationCategories categories = null, ModerationCategoryScores categoryScores = null);
}
}
namespace OpenAI.VectorStores {
public abstract class FileChunkingStrategy : IJsonModel<FileChunkingStrategy>, IPersistableModel<FileChunkingStrategy> {
Expand Down