For the complete documentation index, see llms.txt. This page is also available as Markdown.

Use Case

Use Case を使って目的ごとに Vision Event をグループ化します。

概要

ユースケースをグループ化する Vision Events 共通の目的とカスタムメタデータ構造を共有し、すべてのイベントがちょうど1つのユースケースに属します。イベントをこのように整理すると、同じフィールドを報告するカメラ、デバイス、ロケーション間でデータを簡単にフィルタリングし、比較できます。

異なるロケーション、カメラ、デバイスから来ていても、カスタムメタデータフィールドを共有している場合は、イベントを同じユースケースに入れてください。たとえば、「Defect Detection」ユースケースには、複数の工場からのイベントが届く可能性があり、すべてに line_id, shift、そして part_numberが含まれます。メタデータ構造が異なる場合は、別々のユースケースを作成してください:

  • Assembly Line QA: line_id, shift, part_number

  • Warehouse Inventory: aisle, shelf, item_type

  • Construction Site Safety: zone, alert_type, contractor

イベントが到着すると、Roboflow は、検出したフィールドと値の型からカスタムメタデータスキーマを推論します。表示するには、次を呼び出します カスタムメタデータスキーマを取得.

この Roboflow Agent Roboflow Agent は、Vision Events を使ってワークフローを構築するときにユースケースを作成します。条件に合う既存のユースケースがあれば、それを再利用します。セットアップするよう依頼することもできます。

ユースケースをアーカイブすると、既定の表示から非表示になります。イベントは保持され、アーカイブ解除できます。アーカイブされたユースケースに送信されたイベントは保存され続けますが、各イベントに警告が返されます。

イベント値

ユースケースの価値を追跡するために、イベントに金額を設定できます(例: 検出された各不良のコスト)。ユースケースに既定の値と通貨を設定してください。独自の値を送信しない新しいイベントには既定値が適用され、すでに送信済みのイベントはその値のまま保持されます。

イベントは、次の中で独自の値を送信することもできます valueBaseUnits (参照 Vision Event の作成)。値は常にユースケースの通貨で表されます。値の合計は約5分ごとに更新されます。

Webアプリ

左側のサイドバーで「Vision Events」を開き、「+ ユースケースを作成」をクリックします。

ユースケース一覧には、各ユースケースのイベント数、最後のイベント時刻、イベントタイプ、および累計価値が表示されます。ユースケースの概要では、「Value Created」タイルにその価値が表示されます。

既定の イベント値を設定するには、ユースケースのメニューを開き、「設定を更新」をクリックし、「Default Event Value」と「Currency」に入力します。

ダッシュボードからユースケースをアーカイブできます。表の下部にある「アーカイブ済みのユースケースを表示」をクリックすると、アーカイブ済みのものを確認できます。

HTTP API

制限なしの Workspace API キーには、既定で vision-events:manage スコープが付与されています。

ユースケースを作成

ワークスペースに新しいユースケースを作成します。ユースケースは、展開コンテキスト(例: 「Manufacturing Line 1」、「Warehouse Inventory」)ごとに Vision Events を整理するのに役立ちます。

必須スコープ: vision-events:manage

Create a Use Case

post

Create a new use case in your workspace. It starts active. Requires the vision-events:manage scope.

認可
Authorizationstring必須

Roboflow API key passed as a Bearer token.

本文
namestring · 最小: 1 · 最大: 256必須

A name for the use case. Leading and trailing spaces are trimmed. Must be unique within the workspace.

defaultValueBaseUnitsinteger · 最小: -10000000000 · 最大: 10000000000オプション

Value given to new events that don't send valueBaseUnits, in the smallest unit of the currency (ex: cents for USD).

Example: 5000
defaultValueCurrencystringオプション

Three-letter currency code for event values (ex: USD, EUR, JPY), in any case. Defaults to USD. An unsupported code returns 400.

Example: USD
レスポンス
201

Use case created successfully.

application/json
idstringオプション

Use this as useCaseId when you create events.

namestringオプション
post/vision-events/use-cases
POST /vision-events/use-cases HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 31

{
  "name": "Manufacturing Line 1"
}
{
  "id": "a1b3c8e1",
  "name": "Manufacturing Line 1"
}

注意

  • 新しいユースケースは、既定で アクティブ ステータスで作成されます。

  • ユースケースを作成した後、その id を useCaseId として Vision Events を作成するときに.

ユースケースを更新

既存のユースケースの名前、ステータス、または既定のイベント値を更新します。

必須スコープ: vision-events:manage

Update a Use Case

put

Update the name, status, or default event value of an existing use case. A new default applies only to events created afterward. Requires the vision-events:manage scope.

認可
Authorizationstring必須

Roboflow API key passed as a Bearer token.

パスパラメータ
useCaseIdstring必須

The ID of the use case to update.

本文

Send at least one field.

namestring · 最小: 1 · 最大: 256オプション

A new name for the use case. Must be unique within the workspace.

statusstring · enumオプション

The new status for the use case.

可能な値:
defaultValueBaseUnitsinteger · 最小: -10000000000 · 最大: 10000000000 · ヌル許容オプション

Value given to new events that don't send valueBaseUnits, in the smallest unit of the currency (ex: cents for USD). null removes the default.

Example: 5000
defaultValueCurrencystringオプション

Three-letter currency code for event values (ex: USD, EUR, JPY), in any case. Send defaultValueBaseUnits too when changing the currency of a use case that has a default value.

Example: USD
レスポンス
200

Use case updated successfully.

application/json
idstringオプション
namestringオプション
defaultValueBaseUnitsinteger · ヌル許容オプション

The default event value after the update. null when unset.

defaultValueCurrencystringオプション

The currency after the update. USD when unset.

put/vision-events/use-cases/{useCaseId}
PUT /vision-events/use-cases/{useCaseId} HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 31

{
  "name": "Manufacturing Line 2"
}
{
  "id": "a1b3c8e1",
  "name": "Manufacturing Line 2",
  "defaultValueBaseUnits": 5000,
  "defaultValueCurrency": "USD"
}

ユースケース一覧

ワークスペース内のユースケースを一覧表示します。ユースケースの作成と管理方法については、 ユースケースのドキュメント.

必須スコープ: vision-events:read または device:read

List Use Cases

get

List the use cases in your workspace with the given status, whether or not they have events. Requires the vision-events:read or device:read scope.

認可
Authorizationstring必須

Roboflow API key passed as a Bearer token.

クエリパラメータ
statusstring · enumオプション

Filter by use case status. Use inactive to list archived use cases.

Default: active可能な値:
レスポンス
200

List of use cases.

application/json
lookbackDaysintegerオプション

The workspace's retention window in days (14 by default).

get/vision-events/use-cases
GET /vision-events/use-cases HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "useCases": [
    {
      "id": "a1b3c8e1",
      "name": "Manufacturing Line 1",
      "status": "active",
      "workspaceId": "Xk2mP9qLr4TzW8vN1bYc",
      "automationsCount": 1,
      "defaultValueBaseUnits": 5000,
      "defaultValueCurrency": "USD",
      "createdAt": "2024-01-10T08:00:00.000Z",
      "updatedAt": "2024-01-15T10:30:00.000Z"
    },
    {
      "id": "d4e5f6a7",
      "name": "Warehouse Inventory",
      "status": "active",
      "workspaceId": "Xk2mP9qLr4TzW8vN1bYc",
      "automationsCount": 0,
      "defaultValueBaseUnits": null,
      "defaultValueCurrency": "USD",
      "createdAt": "2024-01-12T14:00:00.000Z",
      "updatedAt": "2024-01-15T09:00:00.000Z"
    }
  ],
  "lookbackDays": 14
}

ユースケースをアーカイブ

ユースケースのステータスを inactiveに設定してユースケースをアーカイブします。アーカイブされたユースケースは、既定では一覧から非表示になります。アーカイブされたユースケースに送信されたイベントは保存され続けますが、 entity_not_found の警告が返されます。

必須スコープ: vision-events:manage

Archive a Use Case

post

Archive a use case by setting its status to inactive. Its events are kept. Events sent to it afterward are still stored, but each returns an entity_not_found warning. Archiving an archived use case succeeds. Requires the vision-events:manage scope.

認可
Authorizationstring必須

Roboflow API key passed as a Bearer token.

パスパラメータ
useCaseIdstring必須

The ID of the use case to archive.

レスポンス
200

Use case archived successfully.

application/json
successbooleanオプション
post/vision-events/use-cases/{useCaseId}/archive
POST /vision-events/use-cases/{useCaseId}/archive HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "success": true
}

注意

  • アーカイブはソフト削除です。ユースケースとそのイベントは保持されますが、アクティブな一覧からは非表示になります。

  • アーカイブ済みのユースケースを表示するには、 ユースケース一覧 エンドポイントを status=inactive.

  • を指定して使用します。アーカイブ済みのユースケースは、 ユースケースのアーカイブ解除 エンドポイントを使用して復元できます。

ユースケースのアーカイブ解除

ステータスを アクティブ.

必須スコープ: vision-events:manage

Unarchive a Use Case

post

Restore a previously archived use case by setting its status back to active. Requires the vision-events:manage scope.

認可
Authorizationstring必須

Roboflow API key passed as a Bearer token.

パスパラメータ
useCaseIdstring必須

The ID of the use case to unarchive.

レスポンス
200

Use case unarchived successfully.

application/json
successbooleanオプション
post/vision-events/use-cases/{useCaseId}/unarchive
POST /vision-events/use-cases/{useCaseId}/unarchive HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "success": true
}

注意

  • アーカイブ済みの inactive に戻すことで、以前アーカイブしたユースケースを復元します。

  • アーカイブ解除されると、ユースケースは再びアクティブな一覧に表示され、新しいイベントでは警告が返されなくなります。

Python SDK

各 Vision Event は、ユースケースに関連付けられています。Python SDK には、ユースケースの作成、一覧表示、名前変更、アーカイブ、アーカイブ解除を行うメソッドがあります。

ユースケース一覧

ステータスでフィルタできます:

ユースケースを作成

ユースケースの名前を変更

ユースケースをアーカイブ

ユースケースのアーカイブ解除

ユースケース管理の詳細については、 REST API リファレンス.

MCP Server

AI エージェントを次の MCP Server に接続すると、これらのツールでユースケースを管理できます:

ツール
説明

vision_events_use_cases_list

ワークスペース内の Vision Events ユースケースを一覧表示します。

vision_events_use_case_create

新しい Vision Events ユースケースを作成します。

vision_events_use_case_rename

既存のユースケースの名前を変更します。

vision_events_use_case_archive

ユースケースをアーカイブします。

vision_events_use_case_unarchive

以前アーカイブしたユースケースを復元します。

最終更新

役に立ちましたか?