Skip to content

Commit

Permalink
docs: Updated README.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Aug 29, 2024
1 parent ec9aac1 commit 155ab92
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 155ab92

Please sign in to comment.