次の方法で共有


API リファレンス

DevUI には OpenAI と互換性のある Responses API が用意されており、OpenAI SDK または任意の HTTP クライアントを使用してエージェントやワークフローを操作できます。

近日公開

C# の DevUI ドキュメントは近日公開予定です。 概念ガイダンスについては、後でもう一度確認するか、Python のドキュメントを参照してください。

基準URL

http://localhost:8080/v1

ポートは、 --port CLI オプションを使用して構成できます。

認証

既定では、DevUI はローカル開発に認証を必要としません。 --authで実行する場合は、ベアラー トークン認証が必要です。

OpenAI SDK の使用

基本要求

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8080/v1",
    api_key="not-needed"  # API key not required for local DevUI
)

response = client.responses.create(
    metadata={"entity_id": "weather_agent"},  # Your agent/workflow name
    input="What's the weather in Seattle?"
)

# Extract text from response
print(response.output[0].content[0].text)

ストリーミング

response = client.responses.create(
    metadata={"entity_id": "weather_agent"},
    input="What's the weather in Seattle?",
    stream=True
)

for event in response:
    # Process streaming events
    print(event)

複数ターンの会話

複数ターンの会話には、標準の OpenAI conversation パラメーターを使用します。

# Create a conversation
conversation = client.conversations.create(
    metadata={"agent_id": "weather_agent"}
)

# First turn
response1 = client.responses.create(
    metadata={"entity_id": "weather_agent"},
    input="What's the weather in Seattle?",
    conversation=conversation.id
)

# Follow-up turn (continues the conversation)
response2 = client.responses.create(
    metadata={"entity_id": "weather_agent"},
    input="How about tomorrow?",
    conversation=conversation.id
)

DevUI は、会話のメッセージ履歴を自動的に取得し、エージェントに渡します。

REST API エンドポイント

Responses API (OpenAI Standard)

エージェントまたはワークフローを実行します。

curl -X POST http://localhost:8080/v1/responses \
  -H "Content-Type: application/json" \
  -d '{
    "metadata": {"entity_id": "weather_agent"},
    "input": "What is the weather in Seattle?"
  }'

Conversations API (OpenAI Standard)

エンドポイント メソッド Description
/v1/conversations POST 会話を作成する
/v1/conversations/{id} GET 会話の詳細を取得する
/v1/conversations/{id} POST 会話メタデータを更新する
/v1/conversations/{id} DELETE 会話を削除する
/v1/conversations?agent_id={id} GET 会話の一覧表示 (DevUI 拡張機能)
/v1/conversations/{id}/items POST 会話にアイテムを追加する
/v1/conversations/{id}/items GET 会話アイテムを一覧表示する
/v1/conversations/{id}/items/{item_id} GET 会話アイテムを取得する

Entity Management (DevUI 拡張機能)

エンドポイント メソッド Description
/v1/entities GET 検出されたエージェント/ワークフローを一覧表示する
/v1/entities/{entity_id}/info GET エンティティの詳細情報を取得する
/v1/entities/{entity_id}/reload POST ホット リロード エンティティ (開発者モード)

正常性チェック

curl http://localhost:8080/health

サーバー メタデータ

サーバーの構成と機能を取得します。

curl http://localhost:8080/meta

戻り値:

  • ui_mode - 現在のモード (developer または user)
  • version - DevUI バージョン
  • framework - フレームワーク名 (agent_framework)
  • runtime - バックエンド ランタイム (python)
  • capabilities - 機能フラグ (トレース、OpenAI プロキシ、デプロイ)
  • auth_required - 認証が有効かどうか

イベント マッピング

DevUI は、エージェント フレームワーク イベントを OpenAI Responses API イベントにマップします。 次の表にマッピングを示します。

ライフサイクル イベント

OpenAI イベント Agent Framework イベント
response.created + response.in_progress AgentStartedEvent
response.completed AgentCompletedEvent
response.failed AgentFailedEvent
response.created + response.in_progress WorkflowStartedEvent
response.completed WorkflowCompletedEvent
response.failed WorkflowFailedEvent

コンテンツの種類

OpenAI イベント Agent Framework のコンテンツ
response.content_part.added + response.output_text.delta TextContent
response.reasoning_text.delta TextReasoningContent
response.output_item.added FunctionCallContent (初期)
response.function_call_arguments.delta FunctionCallContent (args)
response.function_result.complete FunctionResultContent
response.output_item.added (画像) DataContent (画像)
response.output_item.added (ファイル) DataContent (ファイル)
error ErrorContent

ワークフロー イベント

OpenAI イベント Agent Framework イベント
response.output_item.added (ExecutorActionItem) WorkflowEventtype="executor_invoked"
response.output_item.done (ExecutorActionItem) WorkflowEventtype="executor_completed"
response.output_item.added (ResponseOutputMessage) WorkflowEventtype="output"

DevUI カスタム拡張機能

DevUI では、エージェント フレームワーク固有の機能のカスタム イベントの種類が追加されます。

  • response.function_approval.requested - 関数の承認要求
  • response.function_approval.responded - 関数の承認応答
  • response.function_result.complete - サーバー側関数の実行結果
  • response.workflow_event.complete - ワークフロー イベント
  • response.trace.complete - 実行トレース

これらのカスタム拡張機能は名前空間付きであり、標準の OpenAI クライアントでは無視しても問題ありません。

OpenAI プロキシ モード

DevUI には、カスタム エージェントを作成せずにインターフェイスを介して直接 OpenAI モデルをテストするための OpenAI プロキシ 機能が用意されています。 UI の [設定] を使用して有効にします。

curl -X POST http://localhost:8080/v1/responses \
  -H "X-Proxy-Backend: openai" \
  -d '{"model": "gpt-4.1-mini", "input": "Hello"}'

プロキシ モードでは、バックエンド OPENAI_API_KEY 構成された環境変数が必要です。

次のステップ