Skip to content

Commit

Permalink
Code Cleanup and documentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhantolga committed Dec 26, 2022
1 parent 5dea415 commit be36c08
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion OpenAI.Playground/TestHelpers/CompletionTestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static async Task RunSimpleCompletionTest(IOpenAIService sdk)
var completionResult = await sdk.Completions.CreateCompletion(new CompletionCreateRequest()
{
Prompt = "Once upon a time",
// PromptAsList = new []{"Once upon a time"},
// PromptAsList = new []{"Once upon a time"},
MaxTokens = 5
}, Models.Davinci);

Expand Down
1 change: 1 addition & 0 deletions OpenAI.SDK/Managers/OpenAIEdits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public async Task<EditCreateResponse> CreateEdit(EditCreateRequest editCreate, s
{
editCreate.Model = ProcessEngineId(engineId);
}

return await _httpClient.PostAndReadAsAsync<EditCreateResponse>(_endpointProvider.EditCreate(), editCreate);
}
}
18 changes: 9 additions & 9 deletions OpenAI.SDK/ObjectModels/RequestModels/CreateModerationRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ namespace OpenAI.GPT3.ObjectModels.RequestModels
{
public record CreateModerationRequest : IOpenAiModels.IModel
{
/// <summary>
/// Two content moderations models are available: text-moderation-stable and text-moderation-latest.
/// The default is text-moderation-latest which will be automatically upgraded over time. This ensures you are always
/// using our most accurate model. If you use text-moderation-stable, we will provide advanced notice before updating
/// the model. Accuracy of text-moderation-stable may be slightly lower than for text-moderation-latest.
/// </summary>
[JsonPropertyName("model")]
public string? Model { get; set; }

/// <summary>
/// The input text to classify
/// </summary>
Expand Down Expand Up @@ -46,5 +37,14 @@ public IList<string>? InputCalculated
return InputAsList;
}
}

/// <summary>
/// Two content moderations models are available: text-moderation-stable and text-moderation-latest.
/// The default is text-moderation-latest which will be automatically upgraded over time. This ensures you are always
/// using our most accurate model. If you use text-moderation-stable, we will provide advanced notice before updating
/// the model. Accuracy of text-moderation-stable may be slightly lower than for text-moderation-latest.
/// </summary>
[JsonPropertyName("model")]
public string? Model { get; set; }
}
}
11 changes: 11 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ As you can guess I do not accept any damage caused by use of the library. You ar


## Changelog
### 6.6.1
* **Breaking change**.
* `EmbeddingCreateRequest.Input` was a ***string list*** type now it is a ***string*** type.
I have introduced `InputAsList` property instead of `Input`. You may need to update your code according the change.
***Both Input(string) and InputAsList(string list) avaliable for use***

* Added string and string List support for some of the propertis.
* CompletionCreateRequest --> Prompt & PromptAsList / Stop & StopAsList
* CreateModerationRequest --> Input & InputAsList
* EmbeddingCreateRequest --> Input & InputAsList

### 6.6.0
* Added support for new models (davinciv3 & edit models)
* Added support for Edit endpoint.
Expand Down

0 comments on commit be36c08

Please sign in to comment.