|
2 | 2 |
|
3 | 3 | A simple C# .NET wrapper library to use with OpenAI's GPT-3 API. More context [on my blog](https://rogerpincombe.com/openai-dotnet-api). |
4 | 4 |
|
5 | | -## Status |
6 | | -Updated to work with the current API as of February 2, 2023. Added Files and Embedding endpoints. Removed the Search endpoint as OpenAI has removed that API. |
7 | | -Potentially breaking change with v1.4: The various endpoints (Completions, Models, etc) and related classes have each moved into their own namespaces, for example `OpenAI_API.Completions.CompletionRequest` and `OpenAI_API.Models.Model.DavinciText`. You may need to add `using`s or fully qualify names in exisitng code. |
8 | | - |
9 | | -Thank you [@GotMike](https://github.com/gotmike), [@gmilano](https://github.com/gmilano), [@metjuperry](https://github.com/metjuperry), and [@Alexei000](https://github.com/Alexei000) for your contributions! |
10 | | - |
11 | 5 | ## Quick Example |
12 | 6 |
|
13 | 7 | ```csharp |
14 | | -var api = new OpenAI_API.OpenAIAPI(); |
15 | | - |
| 8 | +var api = new OpenAI_API.OpenAIAPI("YOUR_API_KEY"); |
16 | 9 | var result = await api.Completions.GetCompletion("One Two Three One Two"); |
17 | 10 | Console.WriteLine(result); |
18 | 11 | // should print something starting with "Three" |
19 | 12 | ``` |
20 | 13 |
|
| 14 | +## Readme |
| 15 | + |
| 16 | + * [Status](#Status) |
| 17 | + * [Requirements](#requirements) |
| 18 | + * [Installation](#install-from-nuget) |
| 19 | + * [Authentication](#authentication) |
| 20 | + * [Completions API](#completions) |
| 21 | + * [Streaming completion results](#streaming) |
| 22 | + * [Embeddings API](#embeddings) |
| 23 | + * [Files API](#files-for-fine-tuning) |
| 24 | + * [Additonal Documentation](#documentation) |
| 25 | + * [License](#license) |
| 26 | + |
| 27 | +## Status |
| 28 | +Updated to work with the current API as of February 2, 2023. Added Files and Embedding endpoints. Removed the Search endpoint as OpenAI has removed that API. |
| 29 | +Potentially breaking change with v1.4: The various endpoints (Completions, Models, etc) and related classes have each moved into their own namespaces, for example `OpenAI_API.Completions.CompletionRequest` and `OpenAI_API.Models.Model.DavinciText`. You may need to add `using`s or fully qualify names in existing code. |
| 30 | + |
| 31 | +Thank you [@GotMike](https://github.com/gotmike), [@gmilano](https://github.com/gmilano), [@metjuperry](https://github.com/metjuperry), and [@Alexei000](https://github.com/Alexei000) for your contributions! |
21 | 32 |
|
22 | 33 | ## Requirements |
23 | 34 |
|
@@ -110,7 +121,7 @@ async Task<EmbeddingResult> CreateEmbeddingAsync(EmbeddingRequest request); |
110 | 121 | // for example |
111 | 122 | var result = await api.Embeddings.CreateEmbeddingAsync(new EmbeddingRequest("A test text for embedding", model: Model.AdaTextEmbedding)); |
112 | 123 | // or |
113 | | -var result = await api.Completions.CreateCompletionAsync("A test text for embedding"); |
| 124 | +var result = await api.Embeddings.CreateEmbeddingAsync("A test text for embedding"); |
114 | 125 | ``` |
115 | 126 |
|
116 | 127 | The embedding result contains a lot of metadata, the actual vector of floats is in result.Data[].Embedding. |
|
0 commit comments