Anthropic プロバイダー
Anthropic プロバイダーは、Reveal SDK AI を Anthropic の Claude モデルと統合し、Claude ファミリーの AI アシスタントへのアクセスを提供します。
インストール
Anthropic プロバイダーの NuGet パッケージをインストールします:
dotnet add package Reveal.Sdk.AI.Anthropic
設定
基本セットアップ
Program.cs で Anthropic プロバイダーを追加します:
using Reveal.Sdk;
using Reveal.Sdk.AI;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers().AddReveal();
builder.Services.AddRevealAI()
.AddAnthropic(options =>
{
options.ApiKey = builder.Configuration["RevealAI:Anthropic:ApiKey"];
});
var app = builder.Build();
app.MapControllers();
app.Run();
appsettings.json の使用
プロバイダーは RevealAI:Anthropic 設定セクションに自動的にバインドされます:
appsettings.json
{
"RevealAI": {
"Anthropic": {
"ApiKey": "sk-ant-your-api-key-here",
"Model": "claude-opus-4-1",
"MaxTokens": 4096
}
}
}
設定バインディングを使用する場合、コードでのオプション設定は不要です:
builder.Services.AddRevealAI()
.AddAnthropic();
オプション
| プロパティ | 型 | デフォルト | 説明 |
|---|---|---|---|
ApiKey | string | "" | 必須。 Anthropic API キー。 |
Model | string | "claude-opus-4-1" | 使用する Claude モデル。 |
MaxTokens | int | 4096 | レスポンスで生成するトークンの最大数。 |