diff --git a/README.md b/README.md index 6a80c39..5ce9f8a 100644 --- a/README.md +++ b/README.md @@ -5,31 +5,30 @@ [![License: MIT](https://img.shields.io/github/license/tryAGI/AI21)](https://github.com/tryAGI/AI21/blob/main/LICENSE.txt) [![Discord](https://img.shields.io/discord/1115206893015662663?label=Discord&logo=discord&logoColor=white&color=d82679)](https://discord.gg/Ca2xhfBf3v) -Generated C# SDK based on AI21 OpenAPI specification using NSwag. -Includes [tokenizer](https://github.com/tryAGI/Tiktoken) and some helper methods. +## Features 🔥 +- Fully generated C# SDK based on [official OpenAPI specification](https://api.ai21.com/openapi.json) using [OpenApiGenerator](https://github.com/HavenDV/OpenApiGenerator) +- Same day update to support new features +- Updated and supported automatically if there are no breaking changes +- All modern .NET features - nullability, trimming, NativeAOT, etc. +- Support .Net Framework/.Net Standard 2.0 ### Usage ```csharp using AI21; -using var client = new HttpClient(); -var api = new AI21Api(apiKey, client); -var response = await api.GenerateTextAsync( - RecommendedModelIds.Gpt2, - new GenerateTextRequest - { - Inputs = "Hello", - Parameters = new GenerateTextRequestParameters - { - Max_new_tokens = 250, - Return_full_text = false, - }, - Options = new GenerateTextRequestOptions +usung var api = new Ai21Api(apiKey); + +await api.Chat.V1J2UltraChatAsync( + messages: + [ + new ChatMessage { - Use_cache = true, - Wait_for_model = false, - }, - }); + Text = "Hello", + Role = RoleType.User, + } + ], + system: string.Empty, + cancellationToken: CancellationToken.None); ``` ## Support