From e5df759bc956c65d3b3e8f6f2e47d318c9ce342b Mon Sep 17 00:00:00 2001 From: Brian Lagunas <835562+brianlagunas@users.noreply.github.com> Date: Thu, 26 Feb 2026 15:02:53 -0700 Subject: [PATCH 1/6] updating API docs with latest changes --- docs/ai/chat.md | 39 +++--- docs/ai/getting-started-html.md | 73 +++++------ docs/ai/insights.md | 4 +- docs/ai/metadata-catalog.md | 116 +++++++----------- docs/ai/overview.md | 56 +++------ .../current/ai/chat.md | 39 +++--- .../current/ai/getting-started-html.md | 73 +++++------ .../current/ai/insights.md | 4 +- .../current/ai/metadata-catalog.md | 116 +++++++----------- .../current/ai/overview.md | 56 +++------ 10 files changed, 224 insertions(+), 352 deletions(-) diff --git a/docs/ai/chat.md b/docs/ai/chat.md index 0e29c365..c7782857 100644 --- a/docs/ai/chat.md +++ b/docs/ai/chat.md @@ -119,11 +119,11 @@ Common progress messages: - "Adding filters to visualizations" - "Modifying visualization" -##### textchunk Event +##### text Event Contains fragments of the explanation text as it's generated. ```json -event: textchunk +event: text data: {"content": "Based on your data, I've created"} ``` @@ -213,35 +213,34 @@ No additional controller or routing configuration is needed. Both POST and DELET Chat requires a **metadata catalog** to understand your datasource structure. The catalog defines which datasources are available to the AI and how they are configured. -The simplest approach is to define datasources in `appsettings.json`: +The simplest approach is to create a catalog JSON file and point the builder at it: -```json title="appsettings.json" +```json title="config/catalog.json" { - "RevealAI": { - "OpenAI": { - "ApiKey": "sk-your-api-key-here" + "Datasources": [ + { + "Id": "SampleExcel", + "Provider": "WebService" }, - "MetadataCatalog": { - "Datasources": [ - { - "Id": "SampleExcel", - "Provider": "WebService" - }, - { - "Id": "SqlServerData", - "Provider": "SQLServer" - } - ] + { + "Id": "SqlServerData", + "Provider": "SQLServer" } - } + ] } ``` +```csharp title="Program.cs" +builder.Services.AddRevealAI() + .UseMetadataCatalogFile("config/catalog.json") + .AddOpenAI(); +``` + The `datasourceId` parameter in chat requests must match an `Id` defined in your catalog. :::info -The metadata catalog supports multiple sources beyond `appsettings.json`, including external JSON files and custom providers (e.g., database-backed). See the [Metadata Catalog](metadata-catalog.md) topic for the full catalog schema, advanced configuration options, and examples. +The metadata catalog also supports custom providers (e.g., database-backed) via the `IMetadataCatalogProvider` interface. See the [Metadata Catalog](metadata-catalog.md) topic for the full catalog schema, advanced configuration options, and examples. ::: diff --git a/docs/ai/getting-started-html.md b/docs/ai/getting-started-html.md index 8ae470e1..73998a36 100644 --- a/docs/ai/getting-started-html.md +++ b/docs/ai/getting-started-html.md @@ -413,29 +413,25 @@ Create a new file `index.html` in your project root (or a separate `client` fold try { if (streamingEnabled) { // Streaming mode - responses arrive in real-time - const result = await client.ai.insights.get( - options, - { - onProgress: (message) => { - console.log('Progress:', message); - displayInsight(`*${message}*\n\n`, true); - }, - onTextChunk: (text) => { - console.log('Text chunk:', text); - displayInsight(text, true); - }, - onComplete: () => { - console.log('Insight complete'); - }, - onError: (error, details) => { - console.error('Error:', error, details); - displayInsight(`**Error:** ${error}`); - } - }, - { - streamExplanation: true - } - ); + options.stream = true; + const stream = await client.ai.insights.get(options); + + stream.on('progress', (message) => { + console.log('Progress:', message); + displayInsight(`*${message}*\n\n`, true); + }); + + stream.on('text', (content) => { + console.log('Text:', content); + displayInsight(content, true); + }); + + stream.on('error', (error) => { + console.error('Error:', error); + displayInsight(`**Error:** ${error}`); + }); + + await stream.finalResponse(); } else { // Await mode - wait for complete response const result = await client.ai.insights.get(options); @@ -550,25 +546,22 @@ console.log(result.explanation); **Streaming Mode** - Real-time, ChatGPT-like experience: ```javascript -const result = await client.ai.insights.get( - { - dashboard: dashboard, - insightType: rv.InsightType.Summary - }, - { - onTextChunk: (text) => { - // Append each chunk as it arrives - displayInsight(text, true); - }, - onComplete: () => { - console.log('Done!'); - } - }, - { streamExplanation: true } -); +const stream = await client.ai.insights.get({ + dashboard: dashboard, + insightType: rv.InsightType.Summary, + stream: true +}); + +stream.on('text', (content) => { + // Append each chunk as it arrives + displayInsight(content, true); +}); + +const result = await stream.finalResponse(); +console.log('Done!'); ``` -**Key difference**: Same API call, different handling. Streaming provides callbacks for progressive updates, while await waits for the complete response. +**Key difference**: Adding `stream: true` returns an `AIStream` object with event listeners instead of a direct result. Use `.on()` for real-time updates and `.finalResponse()` to get the complete response. ### Dashboard vs Visualization Insights diff --git a/docs/ai/insights.md b/docs/ai/insights.md index 7e6dcc7a..9cc01205 100644 --- a/docs/ai/insights.md +++ b/docs/ai/insights.md @@ -102,11 +102,11 @@ event: progress data: {"message": "Analyzing dashboard data..."} ``` -##### textchunk Event +##### text Event Contains fragments of the explanation text as it's generated. ```json -event: textchunk +event: text data: {"content": "Sales revenue reached $2.4M in Q4 2024"} ``` diff --git a/docs/ai/metadata-catalog.md b/docs/ai/metadata-catalog.md index 05c5bac3..0332fca6 100644 --- a/docs/ai/metadata-catalog.md +++ b/docs/ai/metadata-catalog.md @@ -14,11 +14,11 @@ The **metadata catalog** is the central definition of datasources available to R The metadata system has three distinct responsibilities: -| Concern | Config Section | Purpose | -|---------|---------------|---------| -| **Metadata Catalog** | `RevealAI:MetadataCatalog` | *What* datasources exist and how they are structured | -| **Metadata Manager** | `RevealAI:MetadataManager` | *Where* generated metadata files are written on disk | -| **Metadata Service** | `RevealAI:MetadataService` | *When* metadata generation runs (startup, schedule) | +| Concern | Purpose | +|---------|---------| +| **Metadata Catalog** | *What* datasources exist and how they are structured | +| **Metadata Manager** | *Where* generated metadata files are written on disk | +| **Metadata Service** | *When* metadata generation runs (startup, schedule) | The **catalog** is the only piece you must configure. The manager and service have sensible defaults and are optional. @@ -133,43 +133,11 @@ Common provider values: ## Catalog Sources -By default, the catalog is loaded from `appsettings.json`. You can change the source to a JSON file on disk or a completely custom provider (e.g., database-backed). +The catalog can be loaded from a JSON file on disk or from a completely custom provider (e.g., database-backed). -### Option 1: appsettings.json (Default) +### Option 1: JSON File on Disk -Define datasources directly in `appsettings.json` under the `RevealAI:MetadataCatalog` section. This is the simplest option and requires no additional configuration. - -```json title="appsettings.json" -{ - "RevealAI": { - "OpenAI": { - "ApiKey": "sk-your-api-key-here" - }, - "MetadataCatalog": { - "Datasources": [ - { - "Id": "NorthwindDB", - "Provider": "SQLServer" - }, - { - "Id": "AnalyticsExcel", - "Provider": "WebService" - } - ] - } - } -} -``` - -```csharp title="Program.cs" -// No additional configuration needed — appsettings is the default source -builder.Services.AddRevealAI() - .AddOpenAI(); -``` - -### Option 2: JSON File on Disk - -Store the catalog in a standalone JSON file. This is useful when you want to manage datasource definitions separately from application settings, share them across environments, or generate them from a CI/CD pipeline. +Store the catalog in a standalone JSON file. This is the simplest approach and is useful when you want to manage datasource definitions separately from application settings, share them across environments, or generate them from a CI/CD pipeline. **1. Create a catalog file:** @@ -205,7 +173,7 @@ builder.Services.AddRevealAI() Both absolute and relative paths are supported. Relative paths are resolved against the application's current working directory. -### Option 3: Custom Provider +### Option 2: Custom Provider Implement `IMetadataCatalogProvider` to load datasource definitions from any source — a database, an API, a key vault, or anything else. @@ -295,46 +263,49 @@ The **Metadata Service** controls *when* metadata is generated. You can trigger ## Complete Configuration Example -Here is a full `appsettings.json` showing all three sections together: +Here is a complete example showing a catalog file, `appsettings.json` for the manager and service options, and the `Program.cs` setup: -```json title="appsettings.json" +```json title="config/catalog.json" { - "RevealAI": { - "OpenAI": { - "ApiKey": "sk-your-api-key-here" - }, - "MetadataCatalog": { - "Datasources": [ + "Datasources": [ + { + "Id": "NorthwindDB", + "Provider": "SQLServer", + "Databases": [ { - "Id": "NorthwindDB", - "Provider": "SQLServer", - "Databases": [ + "Name": "Northwind", + "DiscoveryMode": "Restricted", + "Tables": [ { - "Name": "Northwind", - "DiscoveryMode": "Restricted", - "Tables": [ - { - "Name": "dbo.Orders", - "Description": "Customer purchase orders", - "Fields": [ - { "Name": "OrderDate", "Alias": "Order Date", "Description": "Date the order was placed" }, - { "Name": "ShipCountry", "Alias": "Ship Country" } - ] - }, - { - "Name": "dbo.Customers", - "Description": "Customer contact information" - } + "Name": "dbo.Orders", + "Description": "Customer purchase orders", + "Fields": [ + { "Name": "OrderDate", "Alias": "Order Date", "Description": "Date the order was placed" }, + { "Name": "ShipCountry", "Alias": "Ship Country" } ] + }, + { + "Name": "dbo.Customers", + "Description": "Customer contact information" } ] - }, - { - "Id": "SalesExcel", - "Provider": "WebService" } ] }, + { + "Id": "SalesExcel", + "Provider": "WebService" + } + ] +} +``` + +```json title="appsettings.json" +{ + "RevealAI": { + "OpenAI": { + "ApiKey": "sk-your-api-key-here" + }, "MetadataManager": { "OutputPath": "D:\\metadata\\output" }, @@ -348,7 +319,6 @@ Here is a full `appsettings.json` showing all three sections together: ```csharp title="Program.cs" builder.Services.AddRevealAI() + .UseMetadataCatalogFile("config/catalog.json") .AddOpenAI(); ``` - -No additional code is needed — the catalog, manager, and service are all configured from `appsettings.json` automatically. diff --git a/docs/ai/overview.md b/docs/ai/overview.md index 14b9176a..6a98b267 100644 --- a/docs/ai/overview.md +++ b/docs/ai/overview.md @@ -8,16 +8,14 @@ import BetaWarning from './_beta-message.md' # Reveal SDK AI Overview -The Reveal SDK AI adds powerful artificial intelligence capabilities to your Reveal BI applications, enabling users to gain insights, generate dashboards, and interact with data through natural language. +The Reveal SDK AI adds powerful artificial intelligence capabilities to your Reveal BI applications, enabling users to gain insights and interact with data through natural language. ## What is Reveal SDK AI? Reveal SDK AI is an extension of the Reveal SDK that integrates large language models (LLMs) to provide: - **AI-Generated Insights**: Automatically generate summaries, analyses, and forecasts for your dashboards and visualizations -- **Natural Language Dashboard Generation**: Create dashboards by describing what you want in plain language - **Conversational Analytics**: Chat with your data to explore, analyze, and visualize information -- **Smart Data Discovery**: AI-powered datasource exploration and metadata understanding ## Key Features @@ -31,33 +29,12 @@ Generate intelligent insights from your data with three types of analysis: All insights can be streamed in real-time for a ChatGPT-like user experience. -### Dashboard Generation - -Users can generate complete dashboards by simply describing what they want to see: - -```typescript -const response = await client.ai.dashboards.generate({ - userPrompt: 'Show me sales by region with a trend over time', - datasourceId: 'my-datasource' -}); -``` - -The AI analyzes your datasource schema and creates appropriate visualizations automatically. - -### Dashboard Editing - -Modify existing dashboards using natural language: - -- **Edit Content**: Add, remove, or modify visualizations -- **Edit Filters**: Adjust visualization-level or global filters -- **Describe Dashboards**: Get AI-generated descriptions of dashboard content - ### Conversational AI Chat Build chat interfaces where users can: - Ask questions about their data in natural language -- Get instant dashboard and visualization results +- Generate and modify dashboards conversationally - Maintain conversation context for follow-up questions - Stream responses in real-time @@ -76,22 +53,19 @@ console.log(result.explanation); **Streaming Pattern** - Real-time updates: ```typescript -const result = await client.ai.insights.get( - { - dashboardId: 'sales-dashboard', - insightType: InsightType.Summary - }, - { - onTextChunk: (chunk) => { - // Display text as it arrives - console.log(chunk); - }, - onComplete: (message, result) => { - console.log('Complete!'); - } - }, - { streamExplanation: true } -); +const stream = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + insightType: InsightType.Summary, + stream: true, +}); + +stream.on('text', (content) => { + // Display text as it arrives + console.log(content); +}); + +const result = await stream.finalResponse(); +console.log('Complete!'); ``` ## Architecture diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/chat.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/chat.md index b74d28aa..171474a0 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ai/chat.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/chat.md @@ -119,11 +119,11 @@ data: {"message": "Creating a new dashboard"} - 「表示形式にフィルターを追加しています」 - 「表示形式を変更しています」 -##### textchunk イベント +##### text イベント 生成される説明テキストのフラグメントを含みます。 ```json -event: textchunk +event: text data: {"content": "Based on your data, I've created"} ``` @@ -214,35 +214,34 @@ app.Run(); チャットは、データ ソース構造を理解するために**メタデータ カタログ**が必要です。カタログは、AI が使用可能なデータ ソースとその構成を定義します。 -最も簡単な方法は、`appsettings.json` でデータ ソースを定義することです: +最も簡単な方法は、カタログ JSON ファイルを作成し、ビルダーでファイルを指定することです: -```json title="appsettings.json" +```json title="config/catalog.json" { - "RevealAI": { - "OpenAI": { - "ApiKey": "sk-your-api-key-here" + "Datasources": [ + { + "Id": "SampleExcel", + "Provider": "WebService" }, - "MetadataCatalog": { - "Datasources": [ - { - "Id": "SampleExcel", - "Provider": "WebService" - }, - { - "Id": "SqlServerData", - "Provider": "SQLServer" - } - ] + { + "Id": "SqlServerData", + "Provider": "SQLServer" } - } + ] } ``` +```csharp title="Program.cs" +builder.Services.AddRevealAI() + .UseMetadataCatalogFile("config/catalog.json") + .AddOpenAI(); +``` + チャット リクエストの `datasourceId` パラメーターは、カタログで定義された `Id` と一致する必要があります。 :::info -メタデータ カタログは、`appsettings.json` 以外にも、外部 JSON ファイルやカスタム プロバイダー (データベースなど) など、複数のソースをサポートしています。完全なカタログ スキーマ、高度な構成オプション、およびサンプルについては、[メタデータ カタログ](metadata-catalog.md) トピックを参照してください。 +メタデータ カタログは、`IMetadataCatalogProvider` インターフェイスを使用したカスタム プロバイダー (データベースなど) もサポートしています。完全なカタログ スキーマ、高度な構成オプション、およびサンプルについては、[メタデータ カタログ](metadata-catalog.md) トピックを参照してください。 ::: diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/getting-started-html.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/getting-started-html.md index 061e02b7..cc8fa223 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ai/getting-started-html.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/getting-started-html.md @@ -414,29 +414,25 @@ dotnet run try { if (streamingEnabled) { // Streaming モード - レスポンスがリアルタイムで到着 - const result = await client.ai.insights.get( - options, - { - onProgress: (message) => { - console.log('Progress:', message); - displayInsight(`*${message}*\n\n`, true); - }, - onTextChunk: (text) => { - console.log('Text chunk:', text); - displayInsight(text, true); - }, - onComplete: () => { - console.log('Insight complete'); - }, - onError: (error, details) => { - console.error('Error:', error, details); - displayInsight(`**Error:** ${error}`); - } - }, - { - streamExplanation: true - } - ); + options.stream = true; + const stream = await client.ai.insights.get(options); + + stream.on('progress', (message) => { + console.log('Progress:', message); + displayInsight(`*${message}*\n\n`, true); + }); + + stream.on('text', (content) => { + console.log('Text:', content); + displayInsight(content, true); + }); + + stream.on('error', (error) => { + console.error('Error:', error); + displayInsight(`**Error:** ${error}`); + }); + + await stream.finalResponse(); } else { // Await モード - 完全なレスポンスを待機 const result = await client.ai.insights.get(options); @@ -551,25 +547,22 @@ console.log(result.explanation); **ストリーミング モード** - リアルタイム、ChatGPT のようなエクスペリエンス: ```javascript -const result = await client.ai.insights.get( - { - dashboard: dashboard, - insightType: rv.InsightType.Summary - }, - { - onTextChunk: (text) => { - // 到着したチャンクごとに追加 - displayInsight(text, true); - }, - onComplete: () => { - console.log('Done!'); - } - }, - { streamExplanation: true } -); +const stream = await client.ai.insights.get({ + dashboard: dashboard, + insightType: rv.InsightType.Summary, + stream: true +}); + +stream.on('text', (content) => { + // 到着したチャンクごとに追加 + displayInsight(content, true); +}); + +const result = await stream.finalResponse(); +console.log('Done!'); ``` -**重要な違い**: 同じ API 呼び出しですが、処理が異なります。ストリーミングはプログレッシブ更新のためのコールバックを提供し、await は完全なレスポンスを待ちます。 +**重要な違い**: `stream: true` を追加すると、直接の結果ではなく、イベント リスナーを持つ `AIStream` オブジェクトが返されます。リアルタイム更新には `.on()` を使用し、完全なレスポンスを取得するには `.finalResponse()` を使用します。 ### ダッシュボード vs 表示形式のインサイト diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/insights.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/insights.md index 44a31154..fb883bfa 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ai/insights.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/insights.md @@ -102,11 +102,11 @@ event: progress data: {"message": "Analyzing dashboard data..."} ``` -##### textchunk イベント +##### text イベント 生成される説明テキストのフラグメントを含みます。 ```json -event: textchunk +event: text data: {"content": "Sales revenue reached $2.4M in Q4 2024"} ``` diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/metadata-catalog.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/metadata-catalog.md index 93c2250a..a247f797 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ai/metadata-catalog.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/metadata-catalog.md @@ -14,11 +14,11 @@ import BetaWarning from './_beta-message.md' メタデータ システムには 3 つの異なる責務があります: -| 対象 | 構成セクション | 目的 | -|---------|---------------|---------| -| **メタデータ カタログ** | `RevealAI:MetadataCatalog` | どのデータ ソースが存在し、どのように構成されているか | -| **メタデータ マネージャー** | `RevealAI:MetadataManager` | 生成されたメタデータ ファイルがディスクに書き込まれる場所 | -| **メタデータ サービス** | `RevealAI:MetadataService` | メタデータ生成がいつ実行されるか (起動時、スケジュール) | +| 対象 | 目的 | +|---------|---------| +| **メタデータ カタログ** | どのデータ ソースが存在し、どのように構成されているか | +| **メタデータ マネージャー** | 生成されたメタデータ ファイルがディスクに書き込まれる場所 | +| **メタデータ サービス** | メタデータ生成がいつ実行されるか (起動時、スケジュール) | **カタログ**は、構成が必要な唯一の要素です。マネージャーとサービスには適切なデフォルト値があり、オプションです。 @@ -133,43 +133,11 @@ import BetaWarning from './_beta-message.md' ## カタログ ソース -デフォルトでは、カタログは `appsettings.json` から読み込まれます。ソースをディスク上の JSON ファイルや完全なカスタム プロバイダー (データベースなど) に変更できます。 +カタログは、ディスク上の JSON ファイルまたは完全なカスタム プロバイダー (データベースなど) から読み込むことができます。 -### オプション 1: appsettings.json (デフォルト) +### オプション 1: ディスク上の JSON ファイル -`appsettings.json` の `RevealAI:MetadataCatalog` セクションでデータ ソースを直接定義します。最も簡単なオプションで、追加の構成は不要です。 - -```json title="appsettings.json" -{ - "RevealAI": { - "OpenAI": { - "ApiKey": "sk-your-api-key-here" - }, - "MetadataCatalog": { - "Datasources": [ - { - "Id": "NorthwindDB", - "Provider": "SQLServer" - }, - { - "Id": "AnalyticsExcel", - "Provider": "WebService" - } - ] - } - } -} -``` - -```csharp title="Program.cs" -// 追加の構成は不要 — appsettings がデフォルトのソースです -builder.Services.AddRevealAI() - .AddOpenAI(); -``` - -### オプション 2: ディスク上の JSON ファイル - -カタログをスタンドアロンの JSON ファイルに保存します。データ ソース定義をアプリケーション設定とは別に管理したい場合、環境間で共有したい場合、または CI/CD パイプラインから生成したい場合に便利です。 +カタログをスタンドアロンの JSON ファイルに保存します。これは最も簡単な方法で、データ ソース定義をアプリケーション設定とは別に管理したい場合、環境間で共有したい場合、または CI/CD パイプラインから生成したい場合に便利です。 **1. カタログ ファイルを作成:** @@ -205,7 +173,7 @@ builder.Services.AddRevealAI() 絶対パスと相対パスの両方がサポートされています。相対パスは、アプリケーションの現在の作業ディレクトリに対して解決されます。 -### オプション 3: カスタム プロバイダー +### オプション 2: カスタム プロバイダー `IMetadataCatalogProvider` を実装して、データベース、API、キー ボールト、またはその他のソースからデータ ソース定義を読み込みます。 @@ -295,46 +263,49 @@ builder.Services.AddRevealAI() ## 完全な構成サンプル -3 つのセクションすべてを含む完全な `appsettings.json` を以下に示します: +カタログ ファイル、マネージャーとサービス オプション用の `appsettings.json`、および `Program.cs` のセットアップを含む完全なサンプルを以下に示します: -```json title="appsettings.json" +```json title="config/catalog.json" { - "RevealAI": { - "OpenAI": { - "ApiKey": "sk-your-api-key-here" - }, - "MetadataCatalog": { - "Datasources": [ + "Datasources": [ + { + "Id": "NorthwindDB", + "Provider": "SQLServer", + "Databases": [ { - "Id": "NorthwindDB", - "Provider": "SQLServer", - "Databases": [ + "Name": "Northwind", + "DiscoveryMode": "Restricted", + "Tables": [ { - "Name": "Northwind", - "DiscoveryMode": "Restricted", - "Tables": [ - { - "Name": "dbo.Orders", - "Description": "Customer purchase orders", - "Fields": [ - { "Name": "OrderDate", "Alias": "Order Date", "Description": "Date the order was placed" }, - { "Name": "ShipCountry", "Alias": "Ship Country" } - ] - }, - { - "Name": "dbo.Customers", - "Description": "Customer contact information" - } + "Name": "dbo.Orders", + "Description": "Customer purchase orders", + "Fields": [ + { "Name": "OrderDate", "Alias": "Order Date", "Description": "Date the order was placed" }, + { "Name": "ShipCountry", "Alias": "Ship Country" } ] + }, + { + "Name": "dbo.Customers", + "Description": "Customer contact information" } ] - }, - { - "Id": "SalesExcel", - "Provider": "WebService" } ] }, + { + "Id": "SalesExcel", + "Provider": "WebService" + } + ] +} +``` + +```json title="appsettings.json" +{ + "RevealAI": { + "OpenAI": { + "ApiKey": "sk-your-api-key-here" + }, "MetadataManager": { "OutputPath": "D:\\metadata\\output" }, @@ -348,7 +319,6 @@ builder.Services.AddRevealAI() ```csharp title="Program.cs" builder.Services.AddRevealAI() + .UseMetadataCatalogFile("config/catalog.json") .AddOpenAI(); ``` - -追加のコードは不要です。カタログ、マネージャー、サービスはすべて `appsettings.json` から自動的に構成されます。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/overview.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/overview.md index a3924d53..87ec5f24 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ai/overview.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/overview.md @@ -8,16 +8,14 @@ import BetaWarning from './_beta-message.md' # Reveal SDK AI の概要 -Reveal SDK AI は、Reveal BI アプリケーションに強力な人工知能機能を追加し、ユーザーがインサイトを取得し、ダッシュボードを生成し、自然言語を通じてデータとやり取りできるようにします。 +Reveal SDK AI は、Reveal BI アプリケーションに強力な人工知能機能を追加し、ユーザーがインサイトを取得し、自然言語を通じてデータとやり取りできるようにします。 ## Reveal SDK AI とは? Reveal SDK AI は、大規模言語モデル (LLM) を統合して以下の機能を提供する Reveal SDK の拡張機能です: - **AI 生成インサイト**: ダッシュボードと表示形式の要約、分析、予測を自動的に生成します -- **自然言語によるダッシュボードの生成**: プレーン言語で必要なものを説明してダッシュボードを作成します - **会話分析**: データに基づき、チャットで情報を探索、分析、視覚化します -- **スマート データ ディスカバリー**: AI を活用したデータ ソースの探索とメタデータの理解 ## 主要機能 @@ -31,33 +29,12 @@ Reveal SDK AI は、大規模言語モデル (LLM) を統合して以下の機 すべてのインサイトは、ChatGPT のようなユーザー エクスペリエンスのためにリアルタイムでストリーミングできます。 -### ダッシュボードの生成 - -ユーザーは、見たいものを説明するだけで完全なダッシュボードを生成できます: - -```typescript -const response = await client.ai.dashboards.generate({ - userPrompt: 'Show me sales by region with a trend over time', - datasourceId: 'my-datasource' -}); -``` - -AI はデータ ソース スキーマを分析し、適切な表示形式を自動的に作成します。 - -### ダッシュボードの編集 - -自然言語を使用して既存のダッシュボードを変更します: - -- **コンテンツの編集**: 表示形式を追加、削除、または変更します -- **フィルターの編集**: 表示形式レベルまたはグローバル フィルターを調整します -- **ダッシュボードの説明**: AI によって生成されたダッシュボード コンテンツの説明を取得します - ### 会話型 AI チャット ユーザーによる以下の操作を実行できるチャット インターフェイスを構築します: - 自然言語でデータに関する質問をします -- 即座にダッシュボードと表示形式の結果を取得します +- 会話を通じてダッシュボードを生成および変更します - フォローアップ質問のために会話コンテキストを維持します - リアルタイムでレスポンスをストリーミングします @@ -76,22 +53,19 @@ console.log(result.explanation); **Streaming パターン** - リアルタイム更新: ```typescript -const result = await client.ai.insights.get( - { - dashboardId: 'sales-dashboard', - insightType: InsightType.Summary - }, - { - onTextChunk: (chunk) => { - // 到着したテキストを表示 - console.log(chunk); - }, - onComplete: (message, result) => { - console.log('Complete!'); - } - }, - { streamExplanation: true } -); +const stream = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + insightType: InsightType.Summary, + stream: true, +}); + +stream.on('text', (content) => { + // 到着したテキストを表示 + console.log(content); +}); + +const result = await stream.finalResponse(); +console.log('Complete!'); ``` ## アーキテクチャー From d8da5e79af0057fd6f62c70eb6ac427a2dfb5938 Mon Sep 17 00:00:00 2001 From: Brian Lagunas <835562+brianlagunas@users.noreply.github.com> Date: Thu, 26 Feb 2026 16:14:25 -0700 Subject: [PATCH 2/6] restructured ai topics --- .claude/settings.local.json | 4 +- docs/ai/_beta-message.md | 5 - docs/ai/chat.md | 423 +----------------------- docs/ai/getting-started-html.md | 371 +++------------------ docs/ai/guide-chat-interface.md | 99 ++++++ docs/ai/guide-insights-context-menus.md | 110 ++++++ docs/ai/guide-streaming-display.md | 67 ++++ docs/ai/insights.md | 339 +------------------ docs/ai/install-client-sdk.md | 3 - docs/ai/install-server-sdk.md | 3 - docs/ai/metadata-catalog.md | 3 - docs/ai/overview.md | 3 - docs/ai/sdk-chat.md | 113 +++++++ docs/ai/sdk-error-handling.md | 83 +++++ docs/ai/sdk-insights.md | 107 ++++++ docs/ai/sdk-overview.md | 101 ++++++ docs/ai/sdk-streaming.md | 101 ++++++ docs/ai/system-requirements.md | 3 - sidebars.ts | 53 ++- 19 files changed, 887 insertions(+), 1104 deletions(-) delete mode 100644 docs/ai/_beta-message.md create mode 100644 docs/ai/guide-chat-interface.md create mode 100644 docs/ai/guide-insights-context-menus.md create mode 100644 docs/ai/guide-streaming-display.md create mode 100644 docs/ai/sdk-chat.md create mode 100644 docs/ai/sdk-error-handling.md create mode 100644 docs/ai/sdk-insights.md create mode 100644 docs/ai/sdk-overview.md create mode 100644 docs/ai/sdk-streaming.md diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 505c1bca..d4252a5a 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -23,7 +23,9 @@ "mcp__playwright__browser_snapshot", "Bash(node -e \"JSON.parse\\(require\\(''fs''\\).readFileSync\\(''D:/Repos/Reveal/Documentation/i18n/en/code.json'',''utf8''\\)\\); console.log\\(''Valid JSON''\\)\")", "mcp__playwright__browser_wait_for", - "Bash(node -e \"JSON.parse\\(require\\(''fs''\\).readFileSync\\(''D:/Repos/Reveal/Documentation/i18n/ja/code.json'',''utf8''\\)\\); console.log\\(''Valid JSON''\\)\")" + "Bash(node -e \"JSON.parse\\(require\\(''fs''\\).readFileSync\\(''D:/Repos/Reveal/Documentation/i18n/ja/code.json'',''utf8''\\)\\); console.log\\(''Valid JSON''\\)\")", + "mcp__filesystem__list_directory_with_sizes", + "Bash(npx docusaurus clear)" ] } } diff --git a/docs/ai/_beta-message.md b/docs/ai/_beta-message.md deleted file mode 100644 index 1228a7e5..00000000 --- a/docs/ai/_beta-message.md +++ /dev/null @@ -1,5 +0,0 @@ -:::danger Product in Beta -The Reveal SDK AI features are currently in beta, and we welcome your feedback to help us improve for the final release. - -Please report any issues or suggestions through our support channels. -::: diff --git a/docs/ai/chat.md b/docs/ai/chat.md index c7782857..33cd99d2 100644 --- a/docs/ai/chat.md +++ b/docs/ai/chat.md @@ -1,12 +1,9 @@ --- -sidebar_label: Chat +sidebar_label: Chat Endpoint --- -import BetaWarning from './_beta-message.md' - - -# AI Chat +# Chat Endpoint AI Chat transforms data analytics into a conversation. Instead of manually building dashboards or writing queries, users simply describe what they want to see or understand. The AI interprets the request, processes the data, and responds with insights, explanations, or generates/modifies dashboards automatically (based both on the current user message and the conversation history). @@ -26,11 +23,7 @@ The AI maintains conversation history, allowing follow-up questions and refineme --- -## Server API - -The Chat API provides endpoints for sending messages and managing conversation sessions. It supports two response modes: a plain JSON response for simple request/response workflows, and a streaming SSE response for real-time progress and text updates. - -### Endpoints +## Endpoints **Send Message** ``` @@ -42,7 +35,7 @@ POST /api/reveal/ai/chat DELETE /api/reveal/ai/chat ``` -### Request Format +## Request Format ```typescript { @@ -62,7 +55,7 @@ DELETE /api/reveal/ai/chat } ``` -#### Request Parameters +### Request Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| @@ -80,9 +73,9 @@ DELETE /api/reveal/ai/chat - **`datasourceId`**: Required for all requests. Provides context about available data structures. - **`dashboard`**: Provide when editing existing dashboards or analyzing dashboard content. -### Response Format +## Response Format -#### Non-Streaming (default) +### Non-Streaming (default) When `stream` is `false` or omitted, the endpoint returns a plain JSON response: @@ -101,11 +94,11 @@ On error, the response includes an error message with the appropriate HTTP statu } ``` -#### Streaming +### Streaming When `stream` is `true`, the endpoint returns Server-Sent Events (SSE) with the following event types: -##### progress Event +#### progress Event Sent during processing to indicate current status. ```json @@ -119,7 +112,7 @@ Common progress messages: - "Adding filters to visualizations" - "Modifying visualization" -##### text Event +#### text Event Contains fragments of the explanation text as it's generated. ```json @@ -129,7 +122,7 @@ data: {"content": "Based on your data, I've created"} Text chunks are delivered in ~8 word segments with 20ms delays for natural, ChatGPT-like streaming. -##### complete Event +#### complete Event Sent when processing finishes successfully. Always contains the full result. ```json @@ -147,7 +140,7 @@ data: { - `explanation`: Natural language explanation of what was done - `dashboard`: Generated or modified dashboard JSON (when applicable) -##### error Event +#### error Event Sent if processing fails. ```json @@ -155,7 +148,7 @@ event: error data: {"error": "Datasource not found"} ``` -### Conversation History +## Conversation History Chat maintains server-side conversation history per user and datasource. This enables contextual follow-up questions and iterative refinements. @@ -176,7 +169,7 @@ Chat maintains server-side conversation history per user and datasource. This en - **Clear history**: Send `DELETE /api/reveal/ai/chat` to reset the session -### Server-Side Implementation +## Server-Side Implementation The Chat endpoint is automatically registered when you configure Reveal AI in your ASP.NET Core application: @@ -209,394 +202,12 @@ app.Run(); No additional controller or routing configuration is needed. Both POST and DELETE endpoints are ready to use once you call `AddRevealAI()`. -### Metadata Configuration - -Chat requires a **metadata catalog** to understand your datasource structure. The catalog defines which datasources are available to the AI and how they are configured. - -The simplest approach is to create a catalog JSON file and point the builder at it: - -```json title="config/catalog.json" -{ - "Datasources": [ - { - "Id": "SampleExcel", - "Provider": "WebService" - }, - { - "Id": "SqlServerData", - "Provider": "SQLServer" - } - ] -} -``` - -```csharp title="Program.cs" -builder.Services.AddRevealAI() - .UseMetadataCatalogFile("config/catalog.json") - .AddOpenAI(); -``` +## Metadata Configuration -The `datasourceId` parameter in chat requests must match an `Id` defined in your catalog. +Chat requires a **metadata catalog** to understand your datasource structure. The `datasourceId` parameter in chat requests must match an `Id` defined in your catalog. :::info -The metadata catalog also supports custom providers (e.g., database-backed) via the `IMetadataCatalogProvider` interface. See the [Metadata Catalog](metadata-catalog.md) topic for the full catalog schema, advanced configuration options, and examples. +See the [Metadata Catalog](./metadata-catalog.md) topic for the full catalog schema, configuration options, and examples. ::: - -**Clearing Session Example:** - -```csharp -// Client makes DELETE request to clear conversation -// DELETE /api/reveal/ai/chat -// Response: 204 No Content -``` - ---- - -## Client API - -The Reveal SDK AI Client provides a TypeScript API for conversational interactions from your web application. The `client.ai.chat.sendMessage()` method uses a single request object for all parameters and supports both non-streaming and streaming modes. - -### Non-Streaming (Default) - -Wait for the complete result before displaying. Returns `Promise`. - -```typescript -import { RevealSdkClient } from '@revealbi/api'; - -const client = RevealSdkClient.getInstance(); - -// Send a message and get the complete response -const response = await client.ai.chat.sendMessage({ - message: 'Show me sales trends for the last quarter', - datasourceId: 'my-datasource', -}); - -console.log(response.explanation); -// "I've analyzed your sales data for Q4 2024..." - -if (response.dashboard) { - // Load the generated dashboard - loadDashboard(response.dashboard); -} -``` - -### Streaming - -Add `stream: true` to the request to get an `AIStream` that yields events as they arrive. The stream supports three consumption patterns. - -#### Pattern 1: for-await (Full Control) - -```typescript -const stream = await client.ai.chat.sendMessage({ - message: 'Create a dashboard showing customer distribution by region', - datasourceId: 'my-datasource', - stream: true, -}); - -for await (const event of stream) { - switch (event.type) { - case 'progress': console.log('Status:', event.message); break; - case 'text': document.getElementById('chat-message').textContent += event.content; break; - case 'error': console.error('Error:', event.error); break; - } -} -``` - -#### Pattern 2: Event Listeners (Simple UI Wiring) - -```typescript -const stream = await client.ai.chat.sendMessage({ - message: 'Create a dashboard showing customer distribution by region', - datasourceId: 'my-datasource', - stream: true, -}); - -stream.on('progress', (message) => console.log('Status:', message)); -stream.on('text', (content) => { - document.getElementById('chat-message').textContent += content; -}); -stream.on('error', (error) => console.error('Error:', error)); - -const result = await stream.finalResponse(); -console.log('Complete:', result.explanation); - -if (result.dashboard) { - loadDashboard(result.dashboard); -} -``` - -#### Pattern 3: Aggregated Result from Stream - -```typescript -const stream = await client.ai.chat.sendMessage({ - message: 'Create a dashboard showing customer distribution by region', - datasourceId: 'my-datasource', - stream: true, -}); - -// Wait for completion, returns ChatResponse -const result = await stream.finalResponse(); -console.log(result.explanation); - -if (result.dashboard) { - loadDashboard(result.dashboard); -} -``` - -### Managing Conversation - -Clear the conversation history to start fresh: - -```typescript -// Reset the conversation context -await client.ai.chat.resetContext(); - -console.log('Conversation history cleared'); -``` - -Use this when: -- Starting a new topic -- Switching datasources -- User explicitly requests to "start over" - -### Dashboard Context - -Provide an existing dashboard for editing or analysis: - -```typescript -// Edit an existing dashboard -const response = await client.ai.chat.sendMessage({ - message: 'Add a date filter to this dashboard', - datasourceId: 'my-datasource', - dashboard: existingDashboardJson, // Provide current dashboard JSON -}); - -if (response.dashboard) { - // Load the modified dashboard - loadDashboard(response.dashboard); -} -``` - -**Using RVDashboard Objects:** - -```typescript -// From RevealView -const currentDashboard = revealView.dashboard; - -const response = await client.ai.chat.sendMessage({ - message: 'Explain what this dashboard shows', - datasourceId: 'my-datasource', - dashboard: currentDashboard, // Accepts RVDashboard object -}); - -console.log(response.explanation); -``` - -### Request Parameters - -All parameters are passed in a single request object: - -```typescript -// Non-streaming request -interface ChatRequest { - message: string; // User's natural language input (required) - datasourceId?: string; // Datasource identifier - dashboard?: string | RVDashboard; // Dashboard JSON or RVDashboard object - visualizationId?: string; // Visualization ID for visualization-specific context - intent?: string; // Intent for freeform LLM queries - updateChatState?: boolean; // Whether to update chat state - model?: string; // Override LLM model - signal?: AbortSignal; // For request cancellation - stream?: false; // Non-streaming (default) -} - -// Streaming request -interface ChatStreamRequest { - // ...same fields as above, plus: - stream: true; // Enable streaming -} -``` - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `message` | `string` | Yes | User's natural language message or request | -| `datasourceId` | `string` | No | Datasource identifier for context | -| `dashboard` | `string \| RVDashboard` | No | Dashboard JSON or RVDashboard object for editing/analysis | -| `visualizationId` | `string` | No | Visualization ID for visualization-specific context | -| `intent` | `string` | No | Intent for freeform LLM queries | -| `updateChatState` | `boolean` | No | Whether to update the chat state after this query | -| `model` | `string` | No | Name of specific LLM model to use | -| `signal` | `AbortSignal` | No | AbortSignal for cancelling the request | -| `stream` | `boolean` | No | Enable streaming mode (default: `false`) | - -### Response Types - -#### ChatResponse - -```typescript -interface ChatResponse { - explanation?: string; // AI-generated explanation - dashboard?: string; // Generated/modified dashboard JSON - error?: string; // Error message if request failed -} -``` - -The response contains an `explanation` field with the AI's natural language response. The `dashboard` field is populated when dashboards are generated or modified. - -#### AIStream (Streaming) - -When `stream: true`, the return type is `AIStream`, which provides: - -| Method / Pattern | Description | -|---------|-------------| -| `for await (const event of stream)` | Iterate over events as they arrive | -| `.on(event, handler)` | Register event-specific listeners | -| `.finalResponse()` | Returns a promise that resolves with the complete `ChatResponse` | -| `.abort()` | Cancel the stream | - -#### Stream Events - -```typescript -type AIStreamEvent = - | { type: 'progress'; message: string } - | { type: 'text'; content: string } - | { type: 'error'; error: string; details?: unknown }; -``` - -| Event Type | Description | -|------------|-------------| -| `progress` | Status messages during processing (e.g., "Creating a new dashboard") | -| `text` | Text fragments of the explanation as they are generated | -| `error` | Error information if processing fails | - ---- - -## Common Patterns - -### Building a Chat Interface - -Create a complete chat UI with message history and streaming: - -```typescript -const messages: Array<{role: 'user' | 'assistant', content: string}> = []; - -async function sendChatMessage(userInput: string) { - // Add user message to UI - messages.push({ role: 'user', content: userInput }); - renderMessages(); - - let currentMessage = ''; - - const stream = await client.ai.chat.sendMessage({ - message: userInput, - datasourceId: 'my-datasource', - stream: true, - }); - - stream.on('progress', (message) => { - showProgressIndicator(message); - }); - - stream.on('text', (content) => { - currentMessage += content; - // Update streaming message in UI - updateStreamingMessage(currentMessage); - scrollToBottom(); - }); - - stream.on('error', (error) => { - showError(error); - }); - - const result = await stream.finalResponse(); - - // Finalize message - messages.push({ role: 'assistant', content: currentMessage }); - renderMessages(); - - if (result.dashboard) { - loadDashboard(result.dashboard); - } - - hideProgressIndicator(); -} - -// Clear conversation -async function resetConversation() { - await client.ai.chat.resetContext(); - messages.length = 0; - renderMessages(); -} -``` - -### Error Handling - -Handle errors gracefully in both non-streaming and streaming modes: - -```typescript -// Non-streaming error handling -try { - const response = await client.ai.chat.sendMessage({ - message: 'Show me sales trends', - datasourceId: 'my-datasource', - }); - displayResponse(response.explanation); - - if (response.dashboard) { - loadDashboard(response.dashboard); - } -} catch (error) { - console.error('Chat request failed:', error); - showErrorMessage(error.message); -} - -// Streaming error handling -const stream = await client.ai.chat.sendMessage({ - message: 'Show me sales trends', - datasourceId: 'my-datasource', - stream: true, -}); - -stream.on('text', (content) => appendToUI(content)); -stream.on('error', (error, details) => { - console.error('Chat error:', error); - showErrorMessage(error); -}); - -const result = await stream.finalResponse(); - -if (result.dashboard) { - loadDashboard(result.dashboard); -} -``` - -### Request Cancellation - -Cancel an in-progress request using `AbortSignal`: - -```typescript -const controller = new AbortController(); - -// Non-streaming -const promise = client.ai.chat.sendMessage({ - message: 'Analyze my data', - datasourceId: 'my-datasource', - signal: controller.signal, -}); - -// Cancel after 5 seconds -setTimeout(() => controller.abort(), 5000); - -// Streaming -const stream = await client.ai.chat.sendMessage({ - message: 'Analyze my data', - datasourceId: 'my-datasource', - stream: true, - signal: controller.signal, -}); - -// Or abort the stream directly -stream.abort(); -``` diff --git a/docs/ai/getting-started-html.md b/docs/ai/getting-started-html.md index 73998a36..77067e11 100644 --- a/docs/ai/getting-started-html.md +++ b/docs/ai/getting-started-html.md @@ -2,9 +2,6 @@ sidebar_label: Getting Started - HTML/JavaScript --- -import BetaWarning from './_beta-message.md' - - # Getting Started with Reveal SDK AI - HTML/JavaScript @@ -17,8 +14,7 @@ This guide will walk you through creating your first AI-powered analytics applic A web application that: - Displays a Reveal dashboard - Adds AI-powered context menu items to the dashboard -- Generates three types of insights: Summary, Analysis, and Forecast -- Shows AI responses with optional streaming (ChatGPT-like experience) +- Generates AI insights (Summary, Analysis, and Forecast) ## Prerequisites @@ -54,6 +50,7 @@ Open `Program.cs` and replace its contents with: ```csharp title="Program.cs" using Reveal.Sdk; using Reveal.Sdk.AI; +using RevealAiServer.Reveal; var builder = WebApplication.CreateBuilder(args); @@ -66,8 +63,11 @@ builder.Services.AddCors(options => .AllowAnyMethod()); }); -// Add Reveal SDK -builder.Services.AddControllers().AddReveal(); +// Add Reveal SDK with data source provider +builder.Services.AddControllers().AddReveal(builder => +{ + builder.AddDataSourceProvider(); +}); // Add Reveal AI with OpenAI provider builder.Services.AddRevealAI() @@ -85,11 +85,6 @@ app.MapControllers(); app.Run(); ``` -That's it! Just three main steps: -1. Add CORS for local development -2. Add Reveal SDK with `AddReveal()` -3. Add AI services with `AddRevealAI()` and configure your LLM provider - ### 1.4 Configure Your API Key **Option A: Using appsettings.json** (not recommended for production) @@ -156,51 +151,6 @@ public class DataSourceProvider : IRVDataSourceProvider } ``` -Update `Program.cs` to register the provider: - -```csharp title="Program.cs" {16-19} -using Reveal.Sdk; -using Reveal.Sdk.AI; -using RevealAiServer.Reveal; - -var builder = WebApplication.CreateBuilder(args); - -builder.Services.AddCors(options => -{ - options.AddPolicy("AllowAll", - policy => policy.AllowAnyOrigin() - .AllowAnyHeader() - .AllowAnyMethod()); -}); - -// Add Reveal SDK with data source provider -builder.Services.AddControllers().AddReveal(builder => -{ - builder.AddDataSourceProvider(); -}); - -// Add Reveal AI with OpenAI provider -builder.Services.AddRevealAI() - .AddOpenAI(options => - { - options.ApiKey = builder.Configuration["RevealAI:OpenAI:ApiKey"]; - options.ModelId = "gpt-4.1"; - }); - -var app = builder.Build(); - -app.UseCors("AllowAll"); -app.MapControllers(); - -app.Run(); -``` - -:::info - -While AI insights don't directly require datasource configuration, the Reveal SDK itself needs a data source provider registered. In a real application, you'd already have this configured for your dashboards. - -::: - ### 1.6 Add the Sample Dashboard and Data Create the necessary folders in your project root: @@ -253,224 +203,66 @@ Create a new file `index.html` in your project root (or a separate `client` fold Reveal AI - Insights Demo -
-
- - -
-
- AI Insights - -
-
-

- Right-click on the dashboard or a visualization to generate AI insights. - Try "Summary", "Analysis", or "Forecast". -

-
-
+
Use the dashboard overflow menu and select an AI insight option.
- - - - - - - - - - - - - - - ``` -または jsDelivr を使用: +または jsDelivr を使用する場合: ```html @@ -44,13 +41,13 @@ npm install @revealbi/api ## TypeScript サポート -AI クライアント SDK は TypeScript で記述されており、完全な型定義が含まれています。追加の `@types` パッケージは必要ありません。 +AI クライアント SDK は TypeScript で記述されており、完全な型定義を含んでいます。追加の `@types` パッケージは必要ありません。 -## フレームワーク固有のセットアップ +## フレームワーク別のセットアップ -### 素の JavaScript +### バニラ JavaScript -#### ES モジュールの使用 +#### ES Modules を使用する場合 ```html @@ -72,7 +69,7 @@ AI クライアント SDK は TypeScript で記述されており、完全な型 ``` -#### UMD バンドルの使用 +#### UMD バンドルを使用する場合 ```html @@ -95,7 +92,7 @@ AI クライアント SDK は TypeScript で記述されており、完全な型 ### Angular -`main.ts` ファイルで、アプリケーションをブートストラップする前に初期化します: +`main.ts` ファイルで、アプリケーションのブートストラップ前に初期化します: ```typescript import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; @@ -113,7 +110,7 @@ platformBrowserDynamic() ### React -`index.tsx` または `main.tsx` ファイルで、レンダリングする前に初期化します: +`index.tsx` または `main.tsx` ファイルで、レンダリング前に初期化します: ```typescript import React from 'react'; @@ -134,7 +131,7 @@ ReactDOM.createRoot(document.getElementById('root')!).render( ### Vue -`main.ts` ファイルで、アプリケーションをマウントする前に初期化します: +`main.ts` ファイルで、アプリケーションのマウント前に初期化します: ```typescript import { createApp } from 'vue'; diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/install-server-sdk.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/install-server-sdk.md index f569a4ab..8954af17 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ai/install-server-sdk.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/install-server-sdk.md @@ -2,54 +2,51 @@ sidebar_label: サーバー SDK のインストール --- -import BetaWarning from './_beta-message.md' - - # AI サーバー SDK のインストール -Reveal SDK AI サーバーは、アプリケーションで AI 機能を強化するために必要なバックエンド サービスを提供します。LLM プロバイダーと統合し、インサイト生成、ダッシュボード作成、会話型分析などの AI 操作を管理します。 +Reveal SDK AI サーバーは、アプリケーションで AI 機能を動作させるために必要なバックエンドサービスを提供します。LLM プロバイダーと統合し、インサイト生成、ダッシュボード作成、会話型アナリティクスなどの AI 操作を管理します。 ## 前提条件 -AI サーバー SDK をインストールする前に、以下を確認してください: +AI サーバー SDK をインストールする前に、以下を確認してください: -1. 基本の [Reveal SDK サーバー](/web/install-server-sdk)がインストールされ、設定されていること -2. .NET 8.0 以上であること -3. 少なくとも 1 つの LLM プロバイダー (OpenAI、Anthropic、Google など) へのアクセス権があること -4. LLM プロバイダーの API キーが設定されていること +1. ベースの [Reveal SDK サーバー](/web/install-server-sdk) がインストールおよび設定済みであること +2. .NET 8.0 以上 +3. 少なくとも1つの LLM プロバイダー(OpenAI、Anthropic、Google など)へのアクセス +4. LLM プロバイダーの API キーが設定済みであること ## インストール方法 ### ASP.NET Core -ASP.NET Core 用 AI サーバー SDK は NuGet パッケージとして配布されています。 +ASP.NET Core 用の AI サーバー SDK は NuGet パッケージとして配布されています。 -#### 手順 1: NuGet パッケージのインストール +#### ステップ 1: NuGet パッケージのインストール -ソリューションまたはプロジェクトを右クリックし、ソリューションの **[NuGet パッケージの管理]** を選択します。 +ソリューションまたはプロジェクトを右クリックし、**Manage NuGet Packages** for Solution を選択します。 ![](../web/images/getting-started-nuget-packages-manage.jpg) -パッケージ マネージャー ダイアログで **[参照]** タブを開き、**Reveal.Sdk.AI.AspNetCore** NuGet パッケージをプロジェクトにインストールします。 +パッケージマネージャーダイアログで **Browse** タブを開き、**Reveal.Sdk.AI.AspNetCore** NuGet パッケージをプロジェクトにインストールします。 **パッケージ名:** `Reveal.Sdk.AI.AspNetCore` -または、パッケージ マネージャー コンソールを使用する場合: +または Package Manager Console を使用する場合: ```bash Install-Package Reveal.Sdk.AI.AspNetCore ``` -または、.NET CLI を使用する場合: +または .NET CLI を使用する場合: ```bash dotnet add package Reveal.Sdk.AI.AspNetCore ``` -#### 手順 2: サービスの構成 +#### ステップ 2: サービスの設定 -`Program.cs` ファイルを開いて変更し、AI サービスを追加します。AI SDK は基本の Reveal SDK を拡張するため、両方を設定する必要があります: +`Program.cs` ファイルを開いて変更し、AI サービスを追加します。AI SDK はベースの Reveal SDK を拡張するため、両方の設定が必要です: ```csharp using Reveal.Sdk; @@ -57,21 +54,21 @@ using Reveal.Sdk.AI; var builder = WebApplication.CreateBuilder(args); -// Reveal SDK を追加 (必須) +// Add Reveal SDK (required) builder.Services.AddControllers().AddReveal(); -// Reveal AI サービスを追加 +// Add Reveal AI services builder.Services.AddRevealAI(); var app = builder.Build(); app.Run(); ``` -#### 手順 3: LLM プロバイダーの設定 +#### ステップ 3: LLM プロバイダーの設定 -少なくとも 1 つの LLM プロバイダーを設定します。`AddRevealAI()` の後にこの構成を追加します: +少なくとも1つの LLM プロバイダーを設定します。`AddRevealAI()` の後にこの設定を追加してください: -**OpenAI の場合:** +**OpenAI の場合:** ```csharp builder.Services.AddRevealAI() @@ -82,7 +79,7 @@ builder.Services.AddRevealAI() }); ``` -**Azure OpenAI の場合:** +**Azure OpenAI の場合:** ```csharp builder.Services.AddRevealAI() @@ -94,7 +91,7 @@ builder.Services.AddRevealAI() }); ``` -**Anthropic Claude の場合:** +**Anthropic Claude の場合:** ```csharp builder.Services.AddRevealAI() @@ -105,9 +102,9 @@ builder.Services.AddRevealAI() }); ``` -#### 手順 4: API キーを安全に保存 +#### ステップ 4: API キーの安全な保管 -LLM プロバイダーの API キーを `appsettings.json` またはユーザー シークレットに保存します: +LLM プロバイダーの API キーを `appsettings.json` または User Secrets に保存します: ```json title="appsettings.json" { @@ -125,13 +122,13 @@ LLM プロバイダーの API キーを `appsettings.json` またはユーザー :::danger API キーをコミットしないでください -API キーをソース管理にコミットしないでください。常にユーザー シークレット、環境変数、または安全なキー管理サービスを使用してください。 +API キーをソースコントロールにコミットしないでください。常に環境変数、User Secrets、または安全なキー管理サービスを使用してください。 ::: #### 完全な例 -AI 機能が設定された完全な `Program.cs` を次に示します: +AI 機能が設定された完全な `Program.cs` の例を以下に示します: ```csharp title="Program.cs" using Reveal.Sdk; @@ -139,7 +136,7 @@ using Reveal.Sdk.AI; var builder = WebApplication.CreateBuilder(args); -// クロスオリジン リクエスト用の CORS を追加 +// Add CORS for cross-origin requests builder.Services.AddCors(options => { options.AddDefaultPolicy(policy => @@ -150,7 +147,7 @@ builder.Services.AddCors(options => }); }); -// ベース Reveal SDK を追加 +// Add base Reveal SDK builder.Services.AddControllers().AddReveal(revealBuilder => { revealBuilder.AddSettings(settings => @@ -159,7 +156,7 @@ builder.Services.AddControllers().AddReveal(revealBuilder => }); }); -// OpenAI プロバイダーで Reveal AI を追加 +// Add Reveal AI with OpenAI provider builder.Services.AddRevealAI() .AddOpenAI(options => { @@ -175,39 +172,39 @@ app.MapControllers(); app.Run(); ``` -### Node.js (近日公開) +### Node.js(近日公開) -AI サーバー SDK の Node.js サポートは開発中であり、今後のリリースで利用可能になる予定です。 +AI サーバー SDK の Node.js サポートは現在開発中であり、将来のリリースで提供される予定です。 -現時点では、AI 機能には ASP.NET Core が推奨されるサーバー プラットフォームです。 +現時点では、AI 機能には ASP.NET Core が推奨サーバープラットフォームです。 -### Java (近日公開) +### Java(近日公開) -AI サーバー SDK の Java サポートは開発中であり、今後のリリースで利用可能になる予定です。 +AI サーバー SDK の Java サポートは現在開発中であり、将来のリリースで提供される予定です。 -現時点では、AI 機能には ASP.NET Core が推奨されるサーバー プラットフォームです。 +現時点では、AI 機能には ASP.NET Core が推奨サーバープラットフォームです。 ## インストールの確認 -インストール後、AI SDK が正しく設定されていることを確認します: +インストール後、AI SDK が正しく設定されていることを確認します: -### 手順 1: アプリケーションの実行 +### ステップ 1: アプリケーションの実行 ```bash dotnet run ``` -### 手順 2: AI エンドポイントの確認 +### ステップ 2: AI エンドポイントの確認 -AI SDK は `/api/reveal/ai/` の下にいくつかのエンドポイントを追加します: +AI SDK は `/api/reveal/ai/` 配下にいくつかのエンドポイントを追加します: -プロバイダー エンドポイントをテストします: +プロバイダーエンドポイントをテストします: ```bash curl http://localhost:5000/api/reveal/ai/providers ``` -期待されるレスポンス: +期待されるレスポンス: ```json { "providers": ["openai", "anthropic"] diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/metadata-catalog.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/metadata-catalog.md index a247f797..af84c7a7 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ai/metadata-catalog.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/metadata-catalog.md @@ -1,36 +1,33 @@ --- -sidebar_label: メタデータ カタログ +sidebar_label: メタデータカタログ --- -import BetaWarning from './_beta-message.md' - +# メタデータカタログ -# メタデータ カタログ - -**メタデータ カタログ**は、Reveal SDK AI で使用可能なデータ ソースの中央定義です。各データ接続の存在、使用するプロバイダー、およびオプションのデータベース、テーブル、フィールドの説明を AI に伝えます。**チャット**と**メタデータ サービス**の両方の機能が、データの全体像を理解するためにカタログに依存しています。 +**メタデータカタログ**は、Reveal SDK AI で利用可能なデータソースの中心的な定義です。AI に対して、どのようなデータ接続が存在し、各接続がどのプロバイダーを使用し、オプションでそのデータベース、テーブル、フィールドを記述します。**チャット**と**メタデータサービス**の両機能は、データの全体像を理解するためにカタログに依存しています。 ## 仕組み -メタデータ システムには 3 つの異なる責務があります: +メタデータシステムには、3つの異なる責務があります: -| 対象 | 目的 | +| 関心事 | 目的 | |---------|---------| -| **メタデータ カタログ** | どのデータ ソースが存在し、どのように構成されているか | -| **メタデータ マネージャー** | 生成されたメタデータ ファイルがディスクに書き込まれる場所 | -| **メタデータ サービス** | メタデータ生成がいつ実行されるか (起動時、スケジュール) | +| **メタデータカタログ** | どのデータソースが存在し、どのような構造になっているか | +| **メタデータマネージャー** | 生成されたメタデータファイルがディスク上のどこに書き込まれるか | +| **メタデータサービス** | メタデータ生成がいつ実行されるか(起動時、スケジュール) | -**カタログ**は、構成が必要な唯一の要素です。マネージャーとサービスには適切なデフォルト値があり、オプションです。 +設定が必要なのは**カタログ**のみです。マネージャーとサービスには適切なデフォルト値があり、設定は任意です。 --- -## カタログ スキーマ +## カタログスキーマ -カタログは、`Datasources` 配列を持つ JSON オブジェクトです。各エントリは、プロバイダーとオプションのスキーマ詳細を含むデータ ソースを定義します。 +カタログは `Datasources` 配列を持つ JSON オブジェクトです。各エントリは、プロバイダーとオプションのスキーマ詳細を含むデータソースを定義します。 -### 最小限のサンプル +### 最小限の例 -最低限、各データ ソースには `Id` と `Provider` が必要です: +最低限、各データソースには `Id` と `Provider` が必要です: ```json { @@ -75,41 +72,41 @@ import BetaWarning from './_beta-message.md' } ``` -### スキーマ リファレンス +### スキーマリファレンス -#### データ ソース +#### データソース -| プロパティ | タイプ | 必須 | 説明 | +| プロパティ | 型 | 必須 | 説明 | |----------|------|----------|-------------| -| `Id` | string | はい | データ ソースの一意の識別子。API リクエストで `datasourceId` として使用されます。 | -| `Provider` | string | はい | データ プロバイダー タイプ (下記の[プロバイダー タイプ](#プロバイダー-タイプ)を参照) | -| `Databases` | array | いいえ | このデータ ソースで使用可能なデータベース スキーマのリスト | +| `Id` | string | はい | データソースの一意の識別子。API リクエストで `datasourceId` として使用されます。 | +| `Provider` | string | はい | データプロバイダーの種類(以下の[プロバイダータイプ](#provider-types)を参照) | +| `Databases` | array | いいえ | このデータソースで利用可能なデータベーススキーマのリスト | #### データベース -| プロパティ | タイプ | 必須 | 説明 | +| プロパティ | 型 | 必須 | 説明 | |----------|------|----------|-------------| | `Name` | string | はい | データベースの名前 | -| `DiscoveryMode` | string | いいえ | `"Default"` (すべてのテーブルを検出) または `"Restricted"` (一覧表示されたテーブルのみ)。デフォルトは `"Default"`。 | -| `Tables` | array | いいえ | このデータベースのテーブル スキーマのリスト | +| `DiscoveryMode` | string | いいえ | `"Default"`(すべてのテーブルを検出)または `"Restricted"`(リストされたテーブルのみ)。デフォルトは `"Default"` です。 | +| `Tables` | array | いいえ | このデータベース内のテーブルスキーマのリスト | #### テーブル -| プロパティ | タイプ | 必須 | 説明 | +| プロパティ | 型 | 必須 | 説明 | |----------|------|----------|-------------| -| `Name` | string | はい | 完全修飾テーブル名 (例: `"dbo.Orders"`) | -| `Description` | string | いいえ | テーブルの内容を AI が理解するのに役立つ説明。 | -| `Fields` | array | いいえ | このテーブルのフィールド スキーマのリスト | +| `Name` | string | はい | 完全修飾テーブル名(例: `"dbo.Orders"`) | +| `Description` | string | いいえ | 人間が読める説明。テーブルの内容を AI が理解するのに役立ちます。 | +| `Fields` | array | いいえ | このテーブル内のフィールドスキーマのリスト | #### フィールド -| プロパティ | タイプ | 必須 | 説明 | +| プロパティ | 型 | 必須 | 説明 | |----------|------|----------|-------------| -| `Name` | string | はい | データベースの実際の列名 | -| `Alias` | string | いいえ | フィールドの表示エイリアス (例: `"OrderDate"` に対する `"Order Date"`) | -| `Description` | string | いいえ | フィールドが何を表すかを AI が理解するのに役立つ説明。 | +| `Name` | string | はい | データベース内の実際のカラム名 | +| `Alias` | string | いいえ | フィールドの表示エイリアス(例: `"OrderDate"` に対して `"Order Date"`) | +| `Description` | string | いいえ | 人間が読める説明。フィールドが何を表しているかを AI が理解するのに役立ちます。 | -### プロバイダー タイプ +### プロバイダータイプ {#provider-types} 一般的なプロバイダー値: @@ -118,10 +115,10 @@ import BetaWarning from './_beta-message.md' | `SQLServer` | Microsoft SQL Server | | `PostgreSQL` | PostgreSQL | | `MySQL` | MySQL | -| `Oracle` | Oracle (サービス名) | -| `OracleSID` | Oracle (SID) | +| `Oracle` | Oracle(サービス名) | +| `OracleSID` | Oracle(SID) | | `SSAS` | SQL Server Analysis Services | -| `SSASHTTP` | SQL Server Analysis Services (HTTP) | +| `SSASHTTP` | SQL Server Analysis Services(HTTP) | | `Snowflake` | Snowflake | | `BigQuery` | Google BigQuery | | `AmazonAthena` | Amazon Athena | @@ -131,15 +128,15 @@ import BetaWarning from './_beta-message.md' --- -## カタログ ソース +## カタログソース -カタログは、ディスク上の JSON ファイルまたは完全なカスタム プロバイダー (データベースなど) から読み込むことができます。 +カタログは、ディスク上の JSON ファイルから読み込むか、完全なカスタムプロバイダー(例: データベースバックエンド)から読み込むことができます。 ### オプション 1: ディスク上の JSON ファイル -カタログをスタンドアロンの JSON ファイルに保存します。これは最も簡単な方法で、データ ソース定義をアプリケーション設定とは別に管理したい場合、環境間で共有したい場合、または CI/CD パイプラインから生成したい場合に便利です。 +カタログを独立した JSON ファイルに保存します。これは最もシンプルなアプローチで、データソース定義をアプリケーション設定とは別に管理したい場合、環境間で共有したい場合、または CI/CD パイプラインから生成したい場合に便利です。 -**1. カタログ ファイルを作成:** +**1. カタログファイルの作成:** ```json title="config/catalog.json" { @@ -171,13 +168,13 @@ builder.Services.AddRevealAI() .AddOpenAI(); ``` -絶対パスと相対パスの両方がサポートされています。相対パスは、アプリケーションの現在の作業ディレクトリに対して解決されます。 +絶対パスと相対パスの両方がサポートされています。相対パスはアプリケーションの現在の作業ディレクトリを基準に解決されます。 -### オプション 2: カスタム プロバイダー +### オプション 2: カスタムプロバイダー -`IMetadataCatalogProvider` を実装して、データベース、API、キー ボールト、またはその他のソースからデータ ソース定義を読み込みます。 +`IMetadataCatalogProvider` を実装して、任意のソース(データベース、API、キー保管庫など)からデータソース定義を読み込みます。 -**1. インターフェイスを実装:** +**1. インターフェースの実装:** ```csharp title="DatabaseCatalogProvider.cs" using Reveal.Sdk.AI.Metadata.Catalog; @@ -207,7 +204,7 @@ public class DatabaseCatalogProvider : IMetadataCatalogProvider } ``` -**2. プロバイダーを登録:** +**2. プロバイダーの登録:** ```csharp title="Program.cs" builder.Services.AddRevealAI() @@ -215,13 +212,13 @@ builder.Services.AddRevealAI() .AddOpenAI(); ``` -プロバイダー クラスは依存関係の注入 (DI) を通じて解決されるため、コンストラクターで必要なサービスを注入できます。 +プロバイダークラスは依存性注入を通じて解決されるため、コンストラクタで必要なサービスを注入できます。 --- -## メタデータ マネージャー オプション +## メタデータマネージャーオプション -**メタデータ マネージャー**は、生成されたメタデータ ファイルがディスクに書き込まれる場所を制御します。これらのファイルは一時的なもので、自動的に生成され、いつでも再生成できます。 +**メタデータマネージャー**は、生成されたメタデータファイルがディスク上のどこに書き込まれるかを制御します。これらのファイルは一時的なものであり、自動的に生成され、いつでも再生成できます。 ```json title="appsettings.json" { @@ -233,15 +230,15 @@ builder.Services.AddRevealAI() } ``` -| プロパティ | タイプ | 必須 | 説明 | +| プロパティ | 型 | 必須 | 説明 | |----------|------|----------|-------------| -| `OutputPath` | string | いいえ | 生成されたメタデータ ファイルが保存されるディレクトリ。デフォルトは `{user-home}/reveal/ai/metadata`。 | +| `OutputPath` | string | いいえ | 生成されたメタデータファイルが保存されるディレクトリ。デフォルトは `{user-home}/reveal/ai/metadata` です。 | --- -## メタデータ サービス オプション +## メタデータサービスオプション -**メタデータ サービス**は、メタデータが生成されるタイミングを制御します。アプリケーションの起動時、定期的なスケジュール、またはその両方で生成をトリガーできます。 +**メタデータサービス**は、メタデータがいつ生成されるかを制御します。アプリケーション起動時、定期的なスケジュール、またはその両方で生成をトリガーできます。 ```json title="appsettings.json" { @@ -254,16 +251,16 @@ builder.Services.AddRevealAI() } ``` -| プロパティ | タイプ | 必須 | 説明 | +| プロパティ | 型 | 必須 | 説明 | |----------|------|----------|-------------| -| `GenerateOnStartup` | boolean | いいえ | `true` の場合、アプリケーションの起動時にメタデータを生成します。デフォルトは `false`。 | -| `CronSchedule` | string | いいえ | 定期的なメタデータ生成の Cron 式 (例: `"0 0 * * *"` は毎日深夜)。 | +| `GenerateOnStartup` | boolean | いいえ | `true` の場合、アプリケーション起動時にメタデータを生成します。デフォルトは `false` です。 | +| `CronSchedule` | string | いいえ | 定期的なメタデータ生成のための Cron 式(例: 毎日深夜に実行する場合は `"0 0 * * *"`)。 | --- -## 完全な構成サンプル +## 完全な設定例 -カタログ ファイル、マネージャーとサービス オプション用の `appsettings.json`、および `Program.cs` のセットアップを含む完全なサンプルを以下に示します: +カタログファイル、マネージャーとサービスオプション用の `appsettings.json`、および `Program.cs` のセットアップを示す完全な例を以下に示します: ```json title="config/catalog.json" { diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/overview.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/overview.md index 87ec5f24..eab65079 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ai/overview.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/overview.md @@ -2,47 +2,44 @@ sidebar_label: 概要 --- -import BetaWarning from './_beta-message.md' - - # Reveal SDK AI の概要 -Reveal SDK AI は、Reveal BI アプリケーションに強力な人工知能機能を追加し、ユーザーがインサイトを取得し、自然言語を通じてデータとやり取りできるようにします。 +Reveal SDK AI は、Reveal BI アプリケーションに強力な人工知能機能を追加し、ユーザーが自然言語を通じてインサイトを取得しデータと対話できるようにします。 -## Reveal SDK AI とは? +## Reveal SDK AI とは? -Reveal SDK AI は、大規模言語モデル (LLM) を統合して以下の機能を提供する Reveal SDK の拡張機能です: +Reveal SDK AI は、大規模言語モデル(LLM)を統合して以下の機能を提供する Reveal SDK の拡張機能です: -- **AI 生成インサイト**: ダッシュボードと表示形式の要約、分析、予測を自動的に生成します -- **会話分析**: データに基づき、チャットで情報を探索、分析、視覚化します +- **AI 生成インサイト**: ダッシュボードやビジュアライゼーションのサマリー、分析、予測を自動的に生成します +- **会話型アナリティクス**: データとチャットして、情報の探索、分析、可視化を行います -## 主要機能 +## 主な機能 ### AI インサイト -3 つのタイプの分析でデータからインテリジェントなインサイトを生成します: +3種類の分析により、データからインテリジェントなインサイトを生成します: -- **要約**: データが示す内容を簡潔に説明します -- **解析**: トレンド、パターン、異常の詳細な解釈を受け取ります -- **予測**: 履歴データに基づいて将来の値を予測します +- **サマリー**: データが示す内容の簡潔な説明を取得します +- **分析**: トレンド、パターン、異常値の詳細な解釈を受け取ります +- **予測**: 過去のデータに基づいて将来の値を予測します -すべてのインサイトは、ChatGPT のようなユーザー エクスペリエンスのためにリアルタイムでストリーミングできます。 +すべてのインサイトは、ChatGPT のようなユーザーエクスペリエンスを実現するために、リアルタイムでストリーミングできます。 ### 会話型 AI チャット -ユーザーによる以下の操作を実行できるチャット インターフェイスを構築します: +ユーザーが以下のことを行えるチャットインターフェースを構築します: -- 自然言語でデータに関する質問をします -- 会話を通じてダッシュボードを生成および変更します -- フォローアップ質問のために会話コンテキストを維持します -- リアルタイムでレスポンスをストリーミングします +- 自然言語でデータに関する質問をする +- 会話を通じてダッシュボードを生成・変更する +- フォローアップの質問のために会話コンテキストを維持する +- レスポンスをリアルタイムでストリーミングする ### 柔軟な API パターン -ユースケースに適したパターンを選択します: +ユースケースに合ったパターンを選択できます: -**Await パターン** - シンプルで分かりやすい: +**Await パターン** - シンプルで直感的: ```typescript const result = await client.ai.insights.get({ dashboardId: 'sales-dashboard', @@ -51,7 +48,7 @@ const result = await client.ai.insights.get({ console.log(result.explanation); ``` -**Streaming パターン** - リアルタイム更新: +**ストリーミングパターン** - リアルタイム更新: ```typescript const stream = await client.ai.insights.get({ dashboardId: 'sales-dashboard', @@ -60,7 +57,7 @@ const stream = await client.ai.insights.get({ }); stream.on('text', (content) => { - // 到着したテキストを表示 + // Display text as it arrives console.log(content); }); @@ -68,31 +65,31 @@ const result = await stream.finalResponse(); console.log('Complete!'); ``` -## アーキテクチャー +## アーキテクチャ -Reveal SDK AI は 2 つの主要コンポーネントで構成されています: +Reveal SDK AI は2つの主要コンポーネントで構成されています: ### クライアント SDK (TypeScript/JavaScript) -クライアント SDK は Web アプリケーションで実行され、以下を提供します: +クライアント SDK はウェブアプリケーション内で動作し、以下を提供します: -- シンプルな初期化と構成 +- シンプルな初期化と設定 - すべての AI 操作に対する型安全な API -- Server-Sent Events (SSE) による組み込みストリーミング サポート -- リクエストのキャンセルとエラー処理 +- Server-Sent Events (SSE) による組み込みストリーミングサポート +- リクエストのキャンセルとエラーハンドリング ### サーバー SDK (ASP.NET Core) -サーバー SDK は以下を処理します: +サーバー SDK は以下を処理します: -- LLM プロバイダーとの統合 (OpenAI、Anthropic、Google など) -- データ ソース メタデータの生成とキャッシュ -- インテント ベースの LLM ルーティング +- LLM プロバイダーの統合 (OpenAI、Anthropic、Google など) +- データソースメタデータの生成とキャッシング +- インテントベースの LLM ルーティング - 会話型 AI のコンテキスト管理 - セキュリティと認証 -## ベータ版の状態 +## ベータ版について -Reveal SDK AI は現在ベータ版です。コア機能は安定しており開発の準備ができていますが、ユーザーのフィードバックに基づいて API が進化する可能性があります。ぜひお試しいただき、体験を共有してください。 +Reveal SDK AI は現在ベータ版です。コア機能は安定しており開発に使用できますが、ユーザーのフィードバックに基づいて API が変更される可能性があります。ぜひお試しいただき、ご感想をお聞かせください。 -インテリジェントな分析エクスペリエンスを一緒に構築しましょう! +一緒にインテリジェントなアナリティクス体験を構築しましょう! diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-chat.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-chat.md new file mode 100644 index 00000000..cf344d02 --- /dev/null +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-chat.md @@ -0,0 +1,113 @@ +--- +sidebar_label: チャット +--- + + +# チャット + +`client.ai.chat.sendMessage()` メソッドは、会話型アナリティクスを実現します。ユーザーが見たいものや理解したいことを自然言語で記述すると、AI がインサイト、説明、またはダッシュボードの生成・変更で応答します。 + +## 基本的な使い方 + +```typescript +import { RevealSdkClient } from '@revealbi/api'; + +const client = RevealSdkClient.getInstance(); + +// Send a message and get the complete response +const response = await client.ai.chat.sendMessage({ + message: 'Show me sales trends for the last quarter', + datasourceId: 'my-datasource', +}); + +console.log(response.explanation); +// "I've analyzed your sales data for Q4 2024..." + +if (response.dashboard) { + // Load the generated dashboard + loadDashboard(response.dashboard); +} +``` + +## 会話の管理 + +AI はサーバー側で会話履歴を保持しており、文脈に沿ったフォローアップの質問が可能です。履歴をクリアして最初からやり直すことができます。 + +```typescript +// Reset the conversation context +await client.ai.chat.resetContext(); + +console.log('Conversation history cleared'); +``` + +以下の場合に使用します: +- 新しいトピックを開始するとき +- データソースを切り替えるとき +- ユーザーが明示的に「最初からやり直す」ことをリクエストしたとき + +## ダッシュボードコンテキスト + +編集や分析のために既存のダッシュボードを提供します。 + +```typescript +// Edit an existing dashboard +const response = await client.ai.chat.sendMessage({ + message: 'Add a date filter to this dashboard', + datasourceId: 'my-datasource', + dashboard: existingDashboardJson, // Provide current dashboard JSON +}); + +if (response.dashboard) { + // Load the modified dashboard + loadDashboard(response.dashboard); +} +``` + +**RVDashboard オブジェクトの使用:** + +```typescript +// From RevealView +const currentDashboard = revealView.dashboard; + +const response = await client.ai.chat.sendMessage({ + message: 'Explain what this dashboard shows', + datasourceId: 'my-datasource', + dashboard: currentDashboard, // Accepts RVDashboard object +}); + +console.log(response.explanation); +``` + +## ストリーミング + +任意のリクエストに `stream: true` を追加すると、レスポンスをリアルタイムで受信できます。利用パターンと例については、[ストリーミングレスポンス](./sdk-streaming.md) を参照してください。 + +--- + +## リクエストパラメーター + +すべてのパラメーターは単一のリクエストオブジェクトで渡します。 + +| パラメーター | 型 | 必須 | 説明 | +|-----------|------|----------|-------------| +| `message` | `string` | はい | ユーザーの自然言語メッセージまたはリクエスト | +| `datasourceId` | `string` | いいえ | コンテキスト用のデータソース識別子 | +| `dashboard` | `string \| RVDashboard` | いいえ | 編集・分析用のダッシュボード JSON または RVDashboard オブジェクト | +| `visualizationId` | `string` | いいえ | ビジュアライゼーション固有のコンテキスト用のビジュアライゼーション ID | +| `intent` | `string` | いいえ | 自由形式の LLM クエリ用のインテント | +| `updateChatState` | `boolean` | いいえ | このクエリの後にチャットの状態を更新するかどうか | +| `model` | `string` | いいえ | 使用する特定の LLM モデルの名前 | +| `signal` | `AbortSignal` | いいえ | リクエストをキャンセルするための AbortSignal | +| `stream` | `boolean` | いいえ | ストリーミングモードを有効にする(デフォルト: `false`) | + +## レスポンスの型 + +```typescript +interface ChatResponse { + explanation?: string; // AI-generated explanation + dashboard?: string; // Generated/modified dashboard JSON + error?: string; // Error message if request failed +} +``` + +`explanation` フィールドには AI の自然言語レスポンスが含まれます。`dashboard` フィールドはダッシュボードが生成または変更された場合に値が設定されます。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-error-handling.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-error-handling.md new file mode 100644 index 00000000..31c31133 --- /dev/null +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-error-handling.md @@ -0,0 +1,83 @@ +--- +sidebar_label: エラーハンドリング +--- + + +# エラーハンドリング + +このトピックでは、Reveal SDK AI クライアントを使用する際のエラー処理方法について説明します。 + +## エラーハンドリング + +### 非ストリーミング + +リクエストを try/catch ブロックで囲みます。 + +```typescript +try { + const insight = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + type: 'summary', + }); + displayInsight(insight.explanation); +} catch (error) { + console.error('Request failed:', error); + showErrorMessage(error.message); +} +``` + +チャットにも同じパターンが適用されます。 + +```typescript +try { + const response = await client.ai.chat.sendMessage({ + message: 'Show me sales trends', + datasourceId: 'my-datasource', + }); + displayResponse(response.explanation); + + if (response.dashboard) { + loadDashboard(response.dashboard); + } +} catch (error) { + console.error('Chat request failed:', error); + showErrorMessage(error.message); +} +``` + +### ストリーミング + +ストリームの `error` イベントをリッスンします。 + +```typescript +const stream = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + type: 'summary', + stream: true, +}); + +stream.on('text', (content) => appendToUI(content)); +stream.on('error', (error, details) => { + console.error('Stream error:', error); + showErrorMessage(error); +}); + +await stream.finalResponse(); +``` + +`for-await` パターンでもエラーを処理できます。 + +```typescript +const stream = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + type: 'summary', + stream: true, +}); + +for await (const event of stream) { + switch (event.type) { + case 'text': appendToUI(event.content); break; + case 'error': showErrorMessage(event.error); break; + } +} +``` diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-insights.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-insights.md new file mode 100644 index 00000000..1926b099 --- /dev/null +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-insights.md @@ -0,0 +1,107 @@ +--- +sidebar_label: インサイト +--- + + +# インサイト + +`client.ai.insights.get()` メソッドは、ダッシュボードやビジュアライゼーションから AI を活用したサマリー、分析、予測を生成します。 + +## 基本的な使い方 + +```typescript +import { RevealSdkClient } from '@revealbi/api'; + +const client = RevealSdkClient.getInstance(); + +// Get a summary for an entire dashboard +const insight = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + type: 'summary', +}); + +console.log(insight.explanation); +// "Sales revenue reached $2.4M in Q4 2024..." +``` + +## インサイトタイプ + +`type` パラメーターを指定して、分析の種類を制御します: + +```typescript +// Summary - concise overview of key metrics +const summary = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + type: 'summary', +}); + +// Analysis - detailed interpretation of trends and patterns +const analysis = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + type: 'analysis', +}); + +// Forecast - predictions based on historical data +const forecast = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + type: 'forecast', + forecastPeriods: 12, // Forecast 12 periods ahead (default: 6) +}); +``` + +## ダッシュボードオブジェクトの使用 + +ダッシュボード ID の代わりに、ダッシュボードオブジェクトを直接渡すこともできます: + +```typescript +// Using RVDashboard object from RevealView +const insight = await client.ai.insights.get({ + dashboard: revealView.dashboard, // RVDashboard object + type: 'analysis', +}); +``` + +## ビジュアライゼーションレベルのインサイト + +ビジュアライゼーション ID を指定して、特定のビジュアライゼーションを分析します: + +```typescript +const insight = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + visualizationId: 'sales-by-region-chart', // Specific visualization + type: 'summary', +}); +``` + +## ストリーミング + +任意のリクエストに `stream: true` を追加すると、リアルタイムでレスポンスを受信できます。利用パターンと例については、[ストリーミングレスポンス](./sdk-streaming.md)を参照してください。 + +--- + +## リクエストパラメーター + +すべてのパラメーターは単一のリクエストオブジェクトで渡します: + +| パラメーター | 型 | 必須 | 説明 | +|-----------|------|----------|-------------| +| `dashboard` | `string \| RVDashboard` | * | RevealView からのダッシュボードオブジェクトまたは JSON 文字列 | +| `dashboardId` | `string` | * | ダッシュボード識別子 | +| `visualizationId` | `string` | いいえ | 分析対象のビジュアライゼーション ID | +| `type` | `InsightType` | はい | タイプ: `'summary'`、`'analysis'`、`'forecast'` | +| `forecastPeriods` | `number` | いいえ | 予測する期間数(デフォルト: 6) | +| `model` | `string` | いいえ | 使用する特定の LLM モデルの名前 | +| `signal` | `AbortSignal` | いいえ | リクエストをキャンセルするための AbortSignal | +| `stream` | `boolean` | いいえ | ストリーミングモードを有効にする(デフォルト: `false`) | + +\* `dashboard` または `dashboardId` のいずれかを指定する必要があります + +## レスポンスタイプ + +```typescript +interface InsightResponse { + explanation: string; // Complete AI-generated explanation +} +``` + +`explanation` フィールドには、非ストリーミングモードでもストリーミングモードでも、完全なインサイトテキストが含まれます。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-overview.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-overview.md new file mode 100644 index 00000000..a9eea992 --- /dev/null +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-overview.md @@ -0,0 +1,101 @@ +--- +sidebar_label: 概要 +--- + + +# SDK の使い方 + +Reveal SDK AI クライアントは、Web アプリケーションに AI 機能を提供する TypeScript/JavaScript ライブラリです。**インサイト**(データ分析の生成)と**チャット**(対話型アナリティクス)の2つの主要な API を公開しており、どちらも単一のクライアントインスタンスからアクセスできます。 + +## 初期化 + +AI 機能を使用する前に、サーバー URL を指定してクライアントを初期化します: + +```typescript +import { RevealSdkClient } from '@revealbi/api'; + +RevealSdkClient.initialize({ + hostUrl: 'https://your-server.com' +}); +``` + +UMD/CDN を使用する場合: + +```typescript +rv.RevealSdkClient.initialize({ + hostUrl: 'https://your-server.com' +}); +``` + +:::info + +クライアント SDK を使用するには、[AI サーバー SDK](/ai/install-server-sdk) がインストールされ、実行されている必要があります。すべての AI リクエストは、設定された LLM プロバイダーによってサーバーサイドで処理されます。 + +::: + +## クライアントインスタンスの取得 + +初期化後、アプリケーション内のどこからでも共有クライアントインスタンスを取得できます: + +```typescript +const client = RevealSdkClient.getInstance(); +``` + +## API サーフェス + +クライアントは `client.ai` 名前空間を通じて AI 機能を公開します: + +### インサイト + +ダッシュボードやビジュアライゼーションからサマリー、分析、予測を生成します: + +```typescript +const insight = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + type: 'summary', +}); + +console.log(insight.explanation); +``` + +詳しくは[インサイト](./sdk-insights.md)をご覧ください。 + +### チャット + +ユーザーが自然言語でデータと対話できる会話型インターフェースを構築します: + +```typescript +const response = await client.ai.chat.sendMessage({ + message: 'Show me sales by region for Q4', + datasourceId: 'my-datasource', +}); + +console.log(response.explanation); +``` + +詳しくは[チャット](./sdk-chat.md)をご覧ください。 + +## ストリーミングと非ストリーミング + +両方の API で2つのレスポンスモードがサポートされています: + +- **非ストリーミング**(デフォルト): 完全なレスポンスを待ちます。シンプルで分かりやすい方式です。 +- **ストリーミング**: テキストが生成されるとリアルタイムで受信し、ChatGPT のような体験を提供します。 + +ストリーミングを有効にするには、任意のリクエストに `stream: true` を追加します: + +```typescript +const stream = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + type: 'summary', + stream: true, +}); + +stream.on('text', (content) => { + console.log(content); // Text arrives in chunks +}); + +const result = await stream.finalResponse(); +``` + +詳しくは[ストリーミングレスポンス](./sdk-streaming.md)をご覧ください。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-streaming.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-streaming.md new file mode 100644 index 00000000..ae9e2ebc --- /dev/null +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/sdk-streaming.md @@ -0,0 +1,101 @@ +--- +sidebar_label: ストリーミングレスポンス +--- + + +# ストリーミングレスポンス + +[インサイト](./sdk-insights.md) と [チャット](./sdk-chat.md) の両方の API はストリーミングモードをサポートしており、生成されたレスポンスをリアルタイムで配信します。これにより、ユーザーは完全なレスポンスを待つのではなく、テキストが徐々に表示される ChatGPT のような体験が得られます。 + +任意のリクエストに `stream: true` を追加することでストリーミングを有効にできます。ストリーミングが有効な場合、メソッドは直接のレスポンスの代わりに `AIStream` オブジェクトを返します。 + +## 利用パターン + +`AIStream` はイベントを利用する 3 つの方法をサポートしています。ユースケースに合ったパターンを選択してください。 + +### パターン 1: for-await(フルコントロール) + +すべてのイベントを反復処理して、各イベントタイプを最大限に制御します。 + +```typescript +const stream = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + type: 'summary', + stream: true, +}); + +for await (const event of stream) { + switch (event.type) { + case 'progress': console.log('Status:', event.message); break; + case 'text': document.getElementById('output').textContent += event.content; break; + case 'error': console.error('Error:', event.error); break; + } +} +``` + +### パターン 2: イベントリスナー(シンプルな UI 連携) + +特定のイベントタイプのハンドラーを登録します。 + +```typescript +const stream = await client.ai.chat.sendMessage({ + message: 'Show me sales by region', + datasourceId: 'my-datasource', + stream: true, +}); + +stream.on('progress', (message) => console.log('Status:', message)); +stream.on('text', (content) => { + document.getElementById('output').textContent += content; +}); +stream.on('error', (error) => console.error('Error:', error)); + +const result = await stream.finalResponse(); +console.log('Complete:', result.explanation); +``` + +### パターン 3: ストリームからの集約結果 + +通信上はストリーミングを使用しつつ、完全なレスポンスを待ちます。 + +```typescript +const stream = await client.ai.insights.get({ + dashboardId: 'sales-dashboard', + type: 'summary', + stream: true, +}); + +// Wait for completion, returns InsightResponse +const result = await stream.finalResponse(); +console.log(result.explanation); +``` + +これは、個々のイベントを処理せずに、サーバー側のストリーミングのメリット(長時間実行リクエストのタイムアウト回避など)を活用したい場合に便利です。 + +--- + +## AIStream リファレンス + +`stream: true` の場合、戻り値の型は `AIStream` になります。ここで `T` はレスポンスの型(`InsightResponse` または `ChatResponse`)です。 + +| メソッド / パターン | 説明 | +|---------|-------------| +| `for await (const event of stream)` | イベントが到着するたびに反復処理する | +| `.on(event, handler)` | イベント固有のリスナーを登録する | +| `.finalResponse()` | 完全なレスポンスで解決される Promise を返す | +| `.abort()` | ストリームをキャンセルする | + +## ストリームイベント + +```typescript +type AIStreamEvent = + | { type: 'progress'; message: string } + | { type: 'text'; content: string } + | { type: 'error'; error: string; details?: unknown }; +``` + +| イベントタイプ | 説明 | +|------------|-------------| +| `progress` | 生成中のステータスメッセージ(例: "Analyzing dashboard data..."、"Creating a new dashboard") | +| `text` | 生成されたレスポンスのテキストフラグメント | +| `error` | 生成が失敗した場合のエラー情報 | diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/system-requirements.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/system-requirements.md index 5bfb362f..c4f951d8 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ai/system-requirements.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/system-requirements.md @@ -2,62 +2,58 @@ sidebar_label: システム要件 --- -import BetaWarning from './_beta-message.md' - - # システム要件 -Reveal SDK AI 機能を使用するには、次の前提条件が必要です: +Reveal SDK AI 機能を使用するには、以下の前提条件が必要です: ## クライアント SDK の要件 -### Web ブラウザー +### ウェブブラウザー -Reveal SDK AI クライアントは、以下をサポートする最新の Web ブラウザーで動作します: +Reveal SDK AI クライアントは、以下をサポートするモダンなウェブブラウザーで動作します: - ES2020 JavaScript 機能 - Async/Await - Fetch API - Server-Sent Events (SSE) -**サポートされているブラウザー:** +**サポートされているブラウザー:** - Chrome/Edge 90+ - Firefox 88+ - Safari 14+ -### JavaScript フレームワーク (オプション) +### JavaScript フレームワーク(オプション) -クライアント SDK は素の JavaScript で動作しますが、以下とシームレスに統合されます: +クライアント SDK はバニラ JavaScript でも動作しますが、以下のフレームワークとシームレスに統合できます: - Angular 15+ - React 18+ - Vue 3+ -- または任意の最新の JavaScript フレームワーク +- またはその他のモダンな JavaScript フレームワーク ## サーバー SDK の要件 ### ASP.NET Core -- ASP.NET 8.0 またはそれ以降 +- ASP.NET 8.0 以上 -## Reveal SDK 基本の要件 +## Reveal SDK の基本要件 -Reveal SDK AI は基本の Reveal SDK を拡張するため、標準の Reveal SDK 要件も満たす必要があります: +Reveal SDK AI はベースの Reveal SDK を拡張するものであるため、標準的な Reveal SDK の要件も満たす必要があります: - 有効な Reveal SDK ライセンス - Reveal SDK Web (JavaScript) パッケージ -- Reveal.Sdk.AspNetCore パッケージ (互換性のあるバージョン) +- Reveal.Sdk.AspNetCore パッケージ(互換性のあるバージョン) ### TypeScript サポート -- TypeScript 5.0+ (完全な型安全性のため) +- TypeScript 5.0+(完全な型安全性を実現するため) - SDK は TypeScript で記述されており、完全な型定義を提供します -## 次の手順 - -環境がこれらの要件を満たしていることを確認したら: +## 次のステップ -1. [サーバー SDK のインストール](install-server-sdk.md) - バックエンド コンポーネントをセットアップします -2. [クライアント SDK のインストール](install-client-sdk.md) - アプリケーションに JavaScript パッケージを追加します +お使いの環境がこれらの要件を満たしていることを確認したら: +1. [サーバー SDK のインストール](install-server-sdk.md) - バックエンドコンポーネントをセットアップします +2. [クライアント SDK のインストール](install-client-sdk.md) - JavaScript パッケージをアプリケーションに追加します diff --git a/src/components/AiSpotlight/index.tsx b/src/components/AiSpotlight/index.tsx index d810a429..a94a8fad 100644 --- a/src/components/AiSpotlight/index.tsx +++ b/src/components/AiSpotlight/index.tsx @@ -1,5 +1,6 @@ import React from 'react'; import Translate from '@docusaurus/Translate'; +import Link from '@docusaurus/Link'; import CodeBlock from '@theme/CodeBlock'; import styles from './styles.module.css'; @@ -39,9 +40,9 @@ export default function AiSpotlight(): JSX.Element { Conversational Chat - + Start building with AI → - +
diff --git a/src/components/HomepageFeatures/index.tsx b/src/components/HomepageFeatures/index.tsx index 5da10513..1295fcf5 100644 --- a/src/components/HomepageFeatures/index.tsx +++ b/src/components/HomepageFeatures/index.tsx @@ -1,6 +1,7 @@ import React from 'react'; import clsx from 'clsx'; import Translate from '@docusaurus/Translate'; +import Link from '@docusaurus/Link'; import styles from './styles.module.css'; const DeveloperSvg = require('@site/static/img/developer.svg').default; @@ -44,7 +45,7 @@ function QuickLinkList({ links }: { links: QuickLink[] }) { {links.map((link, idx) => (
  • - {link.label} + {link.label}
  • ))} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 5ad857f1..385b789d 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -3,6 +3,7 @@ import clsx from 'clsx'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import Layout from '@theme/Layout'; import Translate from '@docusaurus/Translate'; +import Link from '@docusaurus/Link'; import HomepageFeatures from '@site/src/components/HomepageFeatures'; import AiSpotlight from '@site/src/components/AiSpotlight'; import FrameworkPicker from '@site/src/components/FrameworkPicker'; @@ -23,12 +24,12 @@ function HomepageHeader() {

    From 8bfdebd16c7323e9cfba80089d6ec9c03b7f805d Mon Sep 17 00:00:00 2001 From: Brian Lagunas <835562+brianlagunas@users.noreply.github.com> Date: Thu, 26 Feb 2026 16:42:04 -0700 Subject: [PATCH 4/6] updated translations --- i18n/en/code.json | 99 +++++++------------ .../current.json | 64 +++++++++--- i18n/ja/code.json | 99 ++++++++++++++++++- 3 files changed, 178 insertions(+), 84 deletions(-) diff --git a/i18n/en/code.json b/i18n/en/code.json index 56409f99..953ea4a5 100644 --- a/i18n/en/code.json +++ b/i18n/en/code.json @@ -1,135 +1,102 @@ { "homepage.hero.title": { - "message": "Build Intelligent Analytics Into Your Apps", - "description": "The title of the hero section on the homepage" + "message": "Build Intelligent Analytics Into Your Apps" }, "homepage.hero.subtitle": { - "message": "Embed interactive dashboards, AI-powered insights, and conversational data exploration into any web application.", - "description": "The subtitle of the hero section on the homepage" + "message": "Embed interactive dashboards, AI-powered insights, and conversational data exploration into any web application." }, "homepage.hero.cta.getStarted": { - "message": "Get Started", - "description": "The primary CTA button on the homepage hero" + "message": "Get Started" }, "homepage.hero.cta.exploreAi": { - "message": "Explore AI SDK", - "description": "The secondary CTA button on the homepage hero" + "message": "Explore AI SDK" }, "homepage.ai.badge": { - "message": "NEW", - "description": "The badge label for the AI spotlight section" + "message": "NEW" }, "homepage.ai.title": { - "message": "AI-Powered Analytics", - "description": "The title of the AI spotlight section" + "message": "AI-Powered Analytics" }, "homepage.ai.description": { - "message": "Generate dashboards from natural language, get AI insights from your data, and build conversational analytics — all with a few lines of code.", - "description": "The description in the AI spotlight section" + "message": "Generate dashboards from natural language, get AI insights from your data, and build conversational analytics — all with a few lines of code." }, "homepage.ai.capability1": { - "message": "Natural Language Dashboards", - "description": "AI capability chip 1" + "message": "Natural Language Dashboards" }, "homepage.ai.capability2": { - "message": "AI Insights & Forecasts", - "description": "AI capability chip 2" + "message": "AI Insights & Forecasts" }, "homepage.ai.capability3": { - "message": "Conversational Chat", - "description": "AI capability chip 3" + "message": "Conversational Chat" }, "homepage.ai.cta": { - "message": "Start building with AI", - "description": "The CTA link in the AI spotlight section" + "message": "Start building with AI" }, "homepage.sdk.web.title": { - "message": "Web SDK", - "description": "The title of the Web SDK card" + "message": "Web SDK" }, "homepage.sdk.web.subtitle": { - "message": "Embedded Analytics", - "description": "The subtitle of the Web SDK card" + "message": "Embedded Analytics" }, "homepage.sdk.web.description": { - "message": "Embed interactive dashboards and data visualizations into any web application. Supports 30+ data sources with full customization.", - "description": "The description of the Web SDK card" + "message": "Embed interactive dashboards and data visualizations into any web application. Supports 30+ data sources with full customization." }, "homepage.sdk.web.link.getStarted": { - "message": "Getting Started", - "description": "Web SDK quick link" + "message": "Getting Started" }, "homepage.sdk.web.link.dataSources": { - "message": "Data Sources", - "description": "Web SDK quick link" + "message": "Data Sources" }, "homepage.sdk.web.link.apiRef": { - "message": "API Reference", - "description": "Web SDK quick link" + "message": "API Reference" }, "homepage.sdk.web.link.playground": { - "message": "Developer Playground", - "description": "Web SDK quick link" + "message": "Developer Playground" }, "homepage.sdk.ai.title": { - "message": "AI SDK", - "description": "The title of the AI SDK card" + "message": "AI SDK" }, "homepage.sdk.ai.subtitle": { - "message": "Intelligent Analytics", - "description": "The subtitle of the AI SDK card" + "message": "Intelligent Analytics" }, "homepage.sdk.ai.description": { - "message": "Add AI-powered insights, natural language dashboards, and conversational analytics using LLMs like OpenAI, Anthropic, and Google.", - "description": "The description of the AI SDK card" + "message": "Add AI-powered insights, natural language dashboards, and conversational analytics using LLMs like OpenAI, Anthropic, and Google." }, "homepage.sdk.ai.link.overview": { - "message": "Overview", - "description": "AI SDK quick link" + "message": "Overview" }, "homepage.sdk.ai.link.getStarted": { - "message": "Getting Started", - "description": "AI SDK quick link" + "message": "Getting Started" }, "homepage.sdk.ai.link.insights": { - "message": "Insights API", - "description": "AI SDK quick link" + "message": "Insights API" }, "homepage.sdk.ai.link.chat": { - "message": "Chat API", - "description": "AI SDK quick link" + "message": "Chat API" }, "homepage.frameworks.title": { - "message": "Choose Your Stack", - "description": "The title of the framework picker section" + "message": "Choose Your Stack" }, "homepage.frameworks.subtitle": { - "message": "Step-by-step getting started guides for your preferred framework.", - "description": "The subtitle of the framework picker section" + "message": "Step-by-step getting started guides for your preferred framework." }, "homepage.frameworks.html": { - "message": "HTML / JavaScript", - "description": "Framework picker label" + "message": "HTML / JavaScript" }, "homepage.frameworks.react": { - "message": "React", - "description": "Framework picker label" + "message": "React" }, "homepage.frameworks.angular": { - "message": "Angular", - "description": "Framework picker label" + "message": "Angular" }, "homepage.frameworks.aspnet": { - "message": "ASP.NET", - "description": "Framework picker label" + "message": "ASP.NET" }, "homepage.frameworks.node": { - "message": "Node.js", - "description": "Framework picker label" + "message": "Node.js" }, "homepage.frameworks.springboot": { - "message": "Spring Boot", - "description": "Framework picker label" + "message": "Spring Boot" }, "theme.ErrorPageContent.title": { "message": "This page crashed.", diff --git a/i18n/en/docusaurus-plugin-content-docs/current.json b/i18n/en/docusaurus-plugin-content-docs/current.json index 814e35a9..126eb68d 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current.json +++ b/i18n/en/docusaurus-plugin-content-docs/current.json @@ -595,18 +595,10 @@ "message": "Installation", "description": "The label for category 'Installation' in sidebar 'aiSidebar'" }, - "sidebar.aiSidebar.category.ai-getting-started-tutorials": { - "message": "Getting Started", - "description": "The label for category 'Getting Started' in sidebar 'aiSidebar'" - }, "sidebar.aiSidebar.category.Metadata": { "message": "Metadata", "description": "The label for category 'Metadata' in sidebar 'aiSidebar'" }, - "sidebar.aiSidebar.category.Features": { - "message": "Features", - "description": "The label for category 'Features' in sidebar 'aiSidebar'" - }, "sidebar.aiSidebar.doc.Overview": { "message": "Overview", "description": "The label for the doc item 'Overview' in sidebar 'aiSidebar', linking to the doc ai/overview" @@ -623,20 +615,64 @@ "message": "Install Client SDK", "description": "The label for the doc item 'Install Client SDK' in sidebar 'aiSidebar', linking to the doc ai/install-client-sdk" }, - "sidebar.aiSidebar.doc.HTML/JavaScript": { - "message": "HTML/JavaScript", - "description": "The label for the doc item 'HTML/JavaScript' in sidebar 'aiSidebar', linking to the doc ai/getting-started-html" - }, "sidebar.aiSidebar.doc.Metadata Catalog": { "message": "Metadata Catalog", "description": "The label for the doc item 'Metadata Catalog' in sidebar 'aiSidebar', linking to the doc ai/metadata-catalog" }, "sidebar.aiSidebar.doc.Insights": { "message": "Insights", - "description": "The label for the doc item 'Insights' in sidebar 'aiSidebar', linking to the doc ai/insights" + "description": "The label for the doc item 'Insights' in sidebar 'aiSidebar', linking to the doc ai/sdk-insights" }, "sidebar.aiSidebar.doc.Chat": { "message": "Chat", - "description": "The label for the doc item 'Chat' in sidebar 'aiSidebar', linking to the doc ai/chat" + "description": "The label for the doc item 'Chat' in sidebar 'aiSidebar', linking to the doc ai/sdk-chat" + }, + "sidebar.aiSidebar.category.Using the SDK": { + "message": "Using the SDK", + "description": "The label for category 'Using the SDK' in sidebar 'aiSidebar'" + }, + "sidebar.aiSidebar.category.API Reference": { + "message": "API Reference", + "description": "The label for category 'API Reference' in sidebar 'aiSidebar'" + }, + "sidebar.aiSidebar.category.Guides": { + "message": "Guides", + "description": "The label for category 'Guides' in sidebar 'aiSidebar'" + }, + "sidebar.aiSidebar.doc.Getting Started - HTML/JS": { + "message": "Getting Started - HTML/JS", + "description": "The label for the doc item 'Getting Started - HTML/JS' in sidebar 'aiSidebar', linking to the doc ai/getting-started-html" + }, + "sidebar.aiSidebar.doc.ai-sdk-overview": { + "message": "Overview", + "description": "The label for the doc item 'Overview' in sidebar 'aiSidebar', linking to the doc ai/sdk-overview" + }, + "sidebar.aiSidebar.doc.Streaming Responses": { + "message": "Streaming Responses", + "description": "The label for the doc item 'Streaming Responses' in sidebar 'aiSidebar', linking to the doc ai/sdk-streaming" + }, + "sidebar.aiSidebar.doc.Error Handling": { + "message": "Error Handling", + "description": "The label for the doc item 'Error Handling' in sidebar 'aiSidebar', linking to the doc ai/sdk-error-handling" + }, + "sidebar.aiSidebar.doc.Insights Endpoint": { + "message": "Insights Endpoint", + "description": "The label for the doc item 'Insights Endpoint' in sidebar 'aiSidebar', linking to the doc ai/insights" + }, + "sidebar.aiSidebar.doc.Chat Endpoint": { + "message": "Chat Endpoint", + "description": "The label for the doc item 'Chat Endpoint' in sidebar 'aiSidebar', linking to the doc ai/chat" + }, + "sidebar.aiSidebar.doc.Insights with Context Menus": { + "message": "Insights with Context Menus", + "description": "The label for the doc item 'Insights with Context Menus' in sidebar 'aiSidebar', linking to the doc ai/guide-insights-context-menus" + }, + "sidebar.aiSidebar.doc.Building a Chat Interface": { + "message": "Building a Chat Interface", + "description": "The label for the doc item 'Building a Chat Interface' in sidebar 'aiSidebar', linking to the doc ai/guide-chat-interface" + }, + "sidebar.aiSidebar.doc.Streaming Markdown Display": { + "message": "Streaming Markdown Display", + "description": "The label for the doc item 'Streaming Markdown Display' in sidebar 'aiSidebar', linking to the doc ai/guide-streaming-display" } } diff --git a/i18n/ja/code.json b/i18n/ja/code.json index f7a82d20..0fc5f09d 100644 --- a/i18n/ja/code.json +++ b/i18n/ja/code.json @@ -1,11 +1,9 @@ { "homepage.hero.title": { - "message": "Reveal は初めてですか? 私たちにお任せください!", - "description": "The title of the hero section on the homepage" + "message": "Reveal は初めてですか? 私たちにお任せください!" }, "homepage.hero.subtitle": { - "message": "統合、データ可視化のデザイン、ダッシュボードの作成などに関するヘルプを入手してください。", - "description": "The subtitle of the hero section on the homepage" + "message": "統合、データ可視化のデザイン、ダッシュボードの作成などに関するヘルプを入手してください。" }, "theme.ErrorPageContent.title": { "message": "エラーが発生しました", @@ -642,5 +640,98 @@ "theme.SearchModal.footer.backToSearchText": { "message": "検索に戻る", "description": "The back to search text for footer" + }, + "homepage.hero.cta.getStarted": { + "message": "Get Started" + }, + "homepage.hero.cta.exploreAi": { + "message": "Explore AI SDK" + }, + "homepage.ai.badge": { + "message": "NEW" + }, + "homepage.ai.title": { + "message": "AI-Powered Analytics" + }, + "homepage.ai.description": { + "message": "Generate dashboards from natural language, get AI insights from your data, and build conversational analytics — all with a few lines of code." + }, + "homepage.ai.capability1": { + "message": "Natural Language Dashboards" + }, + "homepage.ai.capability2": { + "message": "AI Insights & Forecasts" + }, + "homepage.ai.capability3": { + "message": "Conversational Chat" + }, + "homepage.ai.cta": { + "message": "Start building with AI" + }, + "homepage.frameworks.html": { + "message": "HTML / JavaScript" + }, + "homepage.frameworks.react": { + "message": "React" + }, + "homepage.frameworks.angular": { + "message": "Angular" + }, + "homepage.frameworks.aspnet": { + "message": "ASP.NET" + }, + "homepage.frameworks.node": { + "message": "Node.js" + }, + "homepage.frameworks.springboot": { + "message": "Spring Boot" + }, + "homepage.frameworks.title": { + "message": "Choose Your Stack" + }, + "homepage.frameworks.subtitle": { + "message": "Step-by-step getting started guides for your preferred framework." + }, + "homepage.sdk.web.link.getStarted": { + "message": "Getting Started" + }, + "homepage.sdk.web.link.dataSources": { + "message": "Data Sources" + }, + "homepage.sdk.web.link.apiRef": { + "message": "API Reference" + }, + "homepage.sdk.web.link.playground": { + "message": "Developer Playground" + }, + "homepage.sdk.ai.link.overview": { + "message": "Overview" + }, + "homepage.sdk.ai.link.getStarted": { + "message": "Getting Started" + }, + "homepage.sdk.ai.link.insights": { + "message": "Insights API" + }, + "homepage.sdk.ai.link.chat": { + "message": "Chat API" + }, + "homepage.sdk.web.title": { + "message": "Web SDK" + }, + "homepage.sdk.web.subtitle": { + "message": "Embedded Analytics" + }, + "homepage.sdk.web.description": { + "message": "Embed interactive dashboards and data visualizations into any web application. Supports 30+ data sources with full customization." + }, + "homepage.sdk.ai.title": { + "message": "AI SDK" + }, + "homepage.sdk.ai.subtitle": { + "message": "Intelligent Analytics" + }, + "homepage.sdk.ai.description": { + "message": "Add AI-powered insights, natural language dashboards, and conversational analytics using LLMs like OpenAI, Anthropic, and Google." } } From 784207579115f2dd95a6437847a126c87959386f Mon Sep 17 00:00:00 2001 From: Brian Lagunas <835562+brianlagunas@users.noreply.github.com> Date: Thu, 26 Feb 2026 16:51:46 -0700 Subject: [PATCH 5/6] updated chat delete session endpoint --- docs/ai/chat.md | 6 +++--- i18n/ja/docusaurus-plugin-content-docs/current/ai/chat.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/ai/chat.md b/docs/ai/chat.md index 33cd99d2..26d77fde 100644 --- a/docs/ai/chat.md +++ b/docs/ai/chat.md @@ -32,7 +32,7 @@ POST /api/reveal/ai/chat **Clear Session** ``` -DELETE /api/reveal/ai/chat +DELETE /api/reveal/ai/chat/session ``` ## Request Format @@ -167,7 +167,7 @@ Chat maintains server-side conversation history per user and datasource. This en **Managing History:** -- **Clear history**: Send `DELETE /api/reveal/ai/chat` to reset the session +- **Clear history**: Send `DELETE /api/reveal/ai/chat/session` to reset the session ## Server-Side Implementation @@ -186,7 +186,7 @@ builder.Services.AddControllers().AddReveal(revealBuilder => revealBuilder.AddDataSourceProvider(); }); -// Add Reveal AI - automatically registers /api/reveal/ai/chat endpoint +// Add Reveal AI - automatically registers chat endpoints builder.Services.AddRevealAI() .AddOpenAI(options => { diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ai/chat.md b/i18n/ja/docusaurus-plugin-content-docs/current/ai/chat.md index e78a7802..b0bcf435 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ai/chat.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ai/chat.md @@ -32,7 +32,7 @@ POST /api/reveal/ai/chat **セッションクリア** ``` -DELETE /api/reveal/ai/chat +DELETE /api/reveal/ai/chat/session ``` ## リクエスト形式 @@ -167,7 +167,7 @@ data: {"error": "Datasource not found"} **履歴の管理:** -- **履歴のクリア**: `DELETE /api/reveal/ai/chat` を送信してセッションをリセットします +- **履歴のクリア**: `DELETE /api/reveal/ai/chat/session` を送信してセッションをリセットします ## サーバー側の実装 @@ -186,7 +186,7 @@ builder.Services.AddControllers().AddReveal(revealBuilder => revealBuilder.AddDataSourceProvider(); }); -// Add Reveal AI - automatically registers /api/reveal/ai/chat endpoint +// Add Reveal AI - automatically registers chat endpoints builder.Services.AddRevealAI() .AddOpenAI(options => { From cbdf9dfe136d682bfc4e3375cfd540d5ab26d31b Mon Sep 17 00:00:00 2001 From: Brian Lagunas <835562+brianlagunas@users.noreply.github.com> Date: Thu, 26 Feb 2026 16:53:56 -0700 Subject: [PATCH 6/6] removed beta badge --- src/components/HomepageFeatures/index.tsx | 1 - src/components/HomepageFeatures/styles.module.css | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/src/components/HomepageFeatures/index.tsx b/src/components/HomepageFeatures/index.tsx index 1295fcf5..b71107de 100644 --- a/src/components/HomepageFeatures/index.tsx +++ b/src/components/HomepageFeatures/index.tsx @@ -96,7 +96,6 @@ export default function HomepageFeatures(): JSX.Element {

    AI SDK - BETA

    Intelligent Analytics diff --git a/src/components/HomepageFeatures/styles.module.css b/src/components/HomepageFeatures/styles.module.css index 537e53ab..e78f5acf 100644 --- a/src/components/HomepageFeatures/styles.module.css +++ b/src/components/HomepageFeatures/styles.module.css @@ -64,18 +64,6 @@ font-weight: 500; } -.betaBadge { - display: inline-block; - background: var(--ifm-color-primary); - color: #fff; - border-radius: 4px; - padding: 1px 8px; - font-size: 11px; - font-weight: 700; - text-transform: uppercase; - letter-spacing: 0.5px; -} - .cardDescription { color: var(--ifm-font-color-secondary); line-height: 1.6;