選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

template_chat.ja.mdx 64KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428
  1. import { CodeGroup } from '../code.tsx'
  2. import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from '../md.tsx'
  3. # チャットアプリ API
  4. チャットアプリケーションはセッションの持続性をサポートしており、以前のチャット履歴を応答のコンテキストとして使用できます。これは、チャットボットやカスタマーサービス AI などに適用できます。
  5. <div>
  6. ### ベース URL
  7. <CodeGroup title="コード" targetCode={props.appDetail.api_base_url}>
  8. ```javascript
  9. ```
  10. </CodeGroup>
  11. ### 認証
  12. サービス API は `API-Key` 認証を使用します。
  13. <i>**API キーの漏洩を防ぐため、API キーはクライアント側で共有または保存せず、サーバー側で保存することを強くお勧めします。**</i>
  14. すべての API リクエストにおいて、以下のように `Authorization`HTTP ヘッダーに API キーを含めてください:
  15. <CodeGroup title="コード">
  16. ```javascript
  17. Authorization: Bearer {API_KEY}
  18. ```
  19. </CodeGroup>
  20. </div>
  21. ---
  22. <Heading
  23. url='/chat-messages'
  24. method='POST'
  25. title='チャットメッセージを送信'
  26. name='#Send-Chat-Message'
  27. />
  28. <Row>
  29. <Col>
  30. チャットアプリケーションにリクエストを送信します。
  31. ### リクエストボディ
  32. <Properties>
  33. <Property name='query' type='string' key='query'>
  34. ユーザー入力/質問内容
  35. </Property>
  36. <Property name='inputs' type='object' key='inputs'>
  37. アプリで定義されたさまざまな変数値の入力を許可します。
  38. `inputs`パラメータには複数のキー/値ペアが含まれ、各キーは特定の変数に対応し、各値はその変数の特定の値です。デフォルトは`{}`
  39. </Property>
  40. <Property name='response_mode' type='string' key='response_mode'>
  41. 応答の返却モードを指定します。サポートされているモード:
  42. - `streaming` ストリーミングモード(推奨)、SSE([Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events))を通じてタイプライターのような出力を実装します。
  43. - `blocking` ブロッキングモード、実行完了後に結果を返します。(プロセスが長い場合、リクエストが中断される可能性があります)
  44. Cloudflareの制限により、100秒後に応答がない場合、リクエストは中断されます。
  45. <i>注:エージェントアシスタントモードではブロッキングモードはサポートされていません</i>
  46. </Property>
  47. <Property name='user' type='string' key='user'>
  48. ユーザー識別子、エンドユーザーのアイデンティティを定義するために使用されます。
  49. アプリケーション内で開発者によって一意に定義される必要があります。
  50. </Property>
  51. <Property name='conversation_id' type='string' key='conversation_id'>
  52. 会話ID、以前のチャット記録に基づいて会話を続けるには、前のメッセージのconversation_idを渡す必要があります。
  53. </Property>
  54. <Property name='files' type='array[object]' key='files'>
  55. ファイルリスト、テキストの理解と質問への回答を組み合わせたファイル(画像)の入力に適しており、モデルがビジョン機能をサポートしている場合にのみ利用可能です。
  56. - `type` (string) サポートされているタイプ:`image`(現在は画像タイプのみサポート)
  57. - `transfer_method` (string) 転送方法、画像URLの場合は`remote_url` / ファイルアップロードの場合は`local_file`
  58. - `url` (string) 画像URL(転送方法が`remote_url`の場合)
  59. - `upload_file_id` (string) アップロードされたファイルID、事前にファイルアップロードAPIを通じて取得する必要があります(転送方法が`local_file`の場合)
  60. </Property>
  61. <Property name='auto_generate_name' type='bool' key='auto_generate_name'>
  62. タイトルを自動生成します。デフォルトは`true`です。
  63. `false`に設定すると、会話のリネームAPIを呼び出し、`auto_generate`を`true`に設定することで非同期タイトル生成を実現できます。
  64. </Property>
  65. </Properties>
  66. ### 応答
  67. response_modeがブロッキングの場合、CompletionResponseオブジェクトを返します。
  68. response_modeがストリーミングの場合、ChunkCompletionResponseストリームを返します。
  69. ### ChatCompletionResponse
  70. 完全なアプリ結果を返します。`Content-Type`は`application/json`です。
  71. - `event` (string) イベントタイプ、固定で `message`
  72. - `task_id` (string) タスクID、リクエスト追跡と以下のStop Generate APIに使用
  73. - `id` (string) ユニークID
  74. - `message_id` (string) 一意のメッセージID
  75. - `conversation_id` (string) 会話ID
  76. - `mode` (string) アプリモード、`chat`として固定
  77. - `answer` (string) 完全な応答内容
  78. - `metadata` (object) メタデータ
  79. - `usage` (Usage) モデル使用情報
  80. - `retriever_resources` (array[RetrieverResource]) 引用と帰属リスト
  81. - `created_at` (int) メッセージ作成タイムスタンプ、例:1705395332
  82. ### ChunkChatCompletionResponse
  83. アプリによって出力されたストリームチャンクを返します。`Content-Type`は`text/event-stream`です。
  84. 各ストリーミングチャンクは`data:`で始まり、2つの改行文字`\n\n`で区切られます。以下のように表示されます:
  85. <CodeGroup>
  86. ```streaming {{ title: '応答' }}
  87. data: {"event": "message", "task_id": "900bbd43-dc0b-4383-a372-aa6e6c414227", "id": "663c5084-a254-4040-8ad3-51f2a3c1a77c", "answer": "Hi", "created_at": 1705398420}\n\n
  88. ```
  89. </CodeGroup>
  90. ストリーミングチャンクの構造は`event`に応じて異なります:
  91. - `event: message` LLMはテキストチャンクイベントを返します。つまり、完全なテキストがチャンク形式で出力されます。
  92. - `task_id` (string) タスクID、リクエスト追跡と以下のStop Generate APIに使用
  93. - `message_id` (string) 一意のメッセージID
  94. - `conversation_id` (string) 会話ID
  95. - `answer` (string) LLMが返したテキストチャンク内容
  96. - `created_at` (int) 作成タイムスタンプ、例:1705395332
  97. - `event: agent_message` LLMはテキストチャンクイベントを返します。つまり、エージェントアシスタントが有効な場合、完全なテキストがチャンク形式で出力されます(エージェントモードでのみサポート)
  98. - `task_id` (string) タスクID、リクエスト追跡と以下のStop Generate APIに使用
  99. - `message_id` (string) 一意のメッセージID
  100. - `conversation_id` (string) 会話ID
  101. - `answer` (string) LLMが返したテキストチャンク内容
  102. - `created_at` (int) 作成タイムスタンプ、例:1705395332
  103. - `event: tts_message` TTSオーディオストリームイベント、つまり音声合成出力。内容はMp3形式のオーディオブロックで、base64文字列としてエンコードされています。再生時には、base64をデコードしてプレーヤーに入力するだけです。(このメッセージは自動再生が有効な場合にのみ利用可能)
  104. - `task_id` (string) タスクID、リクエスト追跡と以下の停止応答インターフェースに使用
  105. - `message_id` (string) 一意のメッセージID
  106. - `audio` (string) 音声合成後のオーディオ、base64テキストコンテンツとしてエンコードされており、再生時にはbase64をデコードしてプレーヤーに入力するだけです
  107. - `created_at` (int) 作成タイムスタンプ、例:1705395332
  108. - `event: tts_message_end` TTSオーディオストリーム終了イベント。このイベントを受信すると、オーディオストリームの終了を示します。
  109. - `task_id` (string) タスクID、リクエスト追跡と以下の停止応答インターフェースに使用
  110. - `message_id` (string) 一意のメッセージID
  111. - `audio` (string) 終了イベントにはオーディオがないため、これは空の文字列です
  112. - `created_at` (int) 作成タイムスタンプ、例:1705395332
  113. - `event: agent_thought` エージェントの思考、LLMの思考、ツール呼び出しの入力と出力を含みます(エージェントモードでのみサポート)
  114. - `id` (string) エージェント思考ID、各反復には一意のエージェント思考IDがあります
  115. - `task_id` (string) タスクID、リクエスト追跡と以下のStop Generate APIに使用
  116. - `message_id` (string) 一意のメッセージID
  117. - `position` (int) 現在のエージェント思考の位置、各メッセージには順番に複数の思考が含まれる場合があります。
  118. - `thought` (string) LLMが考えていること
  119. - `observation` (string) ツール呼び出しからの応答
  120. - `tool` (string) 呼び出されたツールのリスト、;で区切られます
  121. - `tool_input` (string) ツールの入力、JSON形式。例:`{"dalle3": {"prompt": "a cute cat"}}`。
  122. - `created_at` (int) 作成タイムスタンプ、例:1705395332
  123. - `message_files` (array[string]) message_fileイベントを参照
  124. - `file_id` (string) ファイルID
  125. - `conversation_id` (string) 会話ID
  126. - `event: message_file` メッセージファイルイベント、ツールによって新しいファイルが作成されました
  127. - `id` (string) ファイル一意ID
  128. - `type` (string) ファイルタイプ、現在は"image"のみ許可
  129. - `belongs_to` (string) 所属、ここでは'assistant'のみ
  130. - `url` (string) ファイルのリモートURL
  131. - `conversation_id` (string) 会話ID
  132. - `event: message_end` メッセージ終了イベント、このイベントを受信するとストリーミングが終了したことを意味します。
  133. - `task_id` (string) タスクID、リクエスト追跡と以下のStop Generate APIに使用
  134. - `message_id` (string) 一意のメッセージID
  135. - `conversation_id` (string) 会話ID
  136. - `metadata` (object) メタデータ
  137. - `usage` (Usage) モデル使用情報
  138. - `retriever_resources` (array[RetrieverResource]) 引用と帰属リスト
  139. - `event: message_replace` メッセージ内容置換イベント。
  140. 出力内容のモデレーションが有効な場合、内容がフラグされると、このイベントを通じてメッセージ内容が事前設定された返信に置き換えられます。
  141. - `task_id` (string) タスクID、リクエスト追跡と以下のStop Generate APIに使用
  142. - `message_id` (string) 一意のメッセージID
  143. - `conversation_id` (string) 会話ID
  144. - `answer` (string) 置換内容(すべてのLLM返信テキストを直接置換)
  145. - `created_at` (int) 作成タイムスタンプ、例:1705395332
  146. - `event: error`
  147. ストリーミングプロセス中に発生した例外はストリームイベントの形式で出力され、エラーイベントを受信するとストリームが終了します。
  148. - `task_id` (string) タスクID、リクエスト追跡と以下のStop Generate APIに使用
  149. - `message_id` (string) 一意のメッセージID
  150. - `status` (int) HTTPステータスコード
  151. - `code` (string) エラーコード
  152. - `message` (string) エラーメッセージ
  153. - `event: ping` 接続を維持するために10秒ごとにpingイベントが発生します。
  154. ### エラー
  155. - 404, 会話が存在しません
  156. - 400, `invalid_param`, 異常なパラメータ入力
  157. - 400, `app_unavailable`, アプリ構成が利用できません
  158. - 400, `provider_not_initialize`, 利用可能なモデル資格情報構成がありません
  159. - 400, `provider_quota_exceeded`, モデル呼び出しクォータが不足しています
  160. - 400, `model_currently_not_support`, 現在のモデルは利用できません
  161. - 400, `completion_request_error`, テキスト生成に失敗しました
  162. - 500, 内部サーバーエラー
  163. </Col>
  164. <Col sticky>
  165. <CodeGroup title="リクエスト" tag="POST" label="/chat-messages" targetCode={`curl -X POST '${props.appDetail.api_base_url}/chat-messages' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "inputs": ${JSON.stringify(props.inputs)},\n "query": "What are the specs of the iPhone 13 Pro Max?",\n "response_mode": "streaming",\n "conversation_id": "",\n "user": "abc-123",\n "files": [\n {\n "type": "image",\n "transfer_method": "remote_url",\n "url": "https://cloud.dify.ai/logo/logo-site.png"\n }\n ]\n}'`}>
  166. ```bash {{ title: 'cURL' }}
  167. curl -X POST '${props.appDetail.api_base_url}/chat-messages' \
  168. --header 'Authorization: Bearer {api_key}' \
  169. --header 'Content-Type: application/json' \
  170. --data-raw '{
  171. "inputs": {},
  172. "query": "eh",
  173. "response_mode": "streaming",
  174. "conversation_id": "1c7e55fb-1ba2-4e10-81b5-30addcea2276",
  175. "user": "abc-123"
  176. }'
  177. ```
  178. </CodeGroup>
  179. ### ブロッキングモード
  180. <CodeGroup title="応答">
  181. ```json {{ title: '応答' }}
  182. {
  183. "event": "message",
  184. "task_id": "c3800678-a077-43df-a102-53f23ed20b88",
  185. "id": "9da23599-e713-473b-982c-4328d4f5c78a",
  186. "message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
  187. "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
  188. "mode": "chat",
  189. "answer": "iPhone 13 Pro Maxの仕様は次のとおりです:...",
  190. "metadata": {
  191. "usage": {
  192. "prompt_tokens": 1033,
  193. "prompt_unit_price": "0.001",
  194. "prompt_price_unit": "0.001",
  195. "prompt_price": "0.0010330",
  196. "completion_tokens": 128,
  197. "completion_unit_price": "0.002",
  198. "completion_price_unit": "0.001",
  199. "completion_price": "0.0002560",
  200. "total_tokens": 1161,
  201. "total_price": "0.0012890",
  202. "currency": "USD",
  203. "latency": 0.7682376249867957
  204. },
  205. "retriever_resources": [
  206. {
  207. "position": 1,
  208. "dataset_id": "101b4c97-fc2e-463c-90b1-5261a4cdcafb",
  209. "dataset_name": "iPhone",
  210. "document_id": "8dd1ad74-0b5f-4175-b735-7d98bbbb4e00",
  211. "document_name": "iPhone List",
  212. "segment_id": "ed599c7f-2766-4294-9d1d-e5235a61270a",
  213. "score": 0.98457545,
  214. "content": "\"Model\",\"Release Date\",\"Display Size\",\"Resolution\",\"Processor\",\"RAM\",\"Storage\",\"Camera\",\"Battery\",\"Operating System\"\n\"iPhone 13 Pro Max\",\"September 24, 2021\",\"6.7 inch\",\"1284 x 2778\",\"Hexa-core (2x3.23 GHz Avalanche + 4x1.82 GHz Blizzard)\",\"6 GB\",\"128, 256, 512 GB, 1TB\",\"12 MP\",\"4352 mAh\",\"iOS 15\""
  215. }
  216. ]
  217. },
  218. "created_at": 1705407629
  219. }
  220. ```
  221. </CodeGroup>
  222. ### ストリーミングモード(基本アシスタント)
  223. <CodeGroup title="応答">
  224. ```streaming {{ title: '応答' }}
  225. data: {"event": "message", "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "answer": " I", "created_at": 1679586595}
  226. data: {"event": "message", "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "answer": "'m", "created_at": 1679586595}
  227. data: {"event": "message", "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "answer": " glad", "created_at": 1679586595}
  228. data: {"event": "message", "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "answer": " to", "created_at": 1679586595}
  229. data: {"event": "message", "message_id" : "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "answer": " meet", "created_at": 1679586595}
  230. data: {"event": "message", "message_id" : "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "answer": " you", "created_at": 1679586595}
  231. data: {"event": "message_end", "id": "5e52ce04-874b-4d27-9045-b3bc80def685", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "metadata": {"usage": {"prompt_tokens": 1033, "prompt_unit_price": "0.001", "prompt_price_unit": "0.001", "prompt_price": "0.0010330", "completion_tokens": 135, "completion_unit_price": "0.002", "completion_price_unit": "0.001", "completion_price": "0.0002700", "total_tokens": 1168, "total_price": "0.0013030", "currency": "USD", "latency": 1.381760165997548}, "retriever_resources": [{"position": 1, "dataset_id": "101b4c97-fc2e-463c-90b1-5261a4cdcafb", "dataset_name": "iPhone", "document_id": "8dd1ad74-0b5f-4175-b735-7d98bbbb4e00", "document_name": "iPhone List", "segment_id": "ed599c7f-2766-4294-9d1d-e5235a61270a", "score": 0.98457545, "content": "\"Model\",\"Release Date\",\"Display Size\",\"Resolution\",\"Processor\",\"RAM\",\"Storage\",\"Camera\",\"Battery\",\"Operating System\"\n\"iPhone 13 Pro Max\",\"September 24, 2021\",\"6.7 inch\",\"1284 x 2778\",\"Hexa-core (2x3.23 GHz Avalanche + 4x1.82 GHz Blizzard)\",\"6 GB\",\"128, 256, 512 GB, 1TB\",\"12 MP\",\"4352 mAh\",\"iOS 15\""}]}}
  232. data: {"event": "tts_message", "conversation_id": "23dd85f3-1a41-4ea0-b7a9-062734ccfaf9", "message_id": "a8bdc41c-13b2-4c18-bfd9-054b9803038c", "created_at": 1721205487, "task_id": "3bf8a0bb-e73b-4690-9e66-4e429bad8ee7", "audio": "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"}
  233. data: {"event": "tts_message_end", "conversation_id": "23dd85f3-1a41-4ea0-b7a9-062734ccfaf9", "message_id": "a8bdc41c-13b2-4c18-bfd9-054b9803038c", "created_at": 1721205487, "task_id": "3bf8a0bb-e73b-4690-9e66-4e429bad8ee7", "audio": ""}
  234. ```
  235. </CodeGroup>
  236. ### 応答例(エージェントアシスタント)
  237. <CodeGroup title="応答">
  238. ```streaming {{ title: '応答' }}
  239. data: {"event": "message", "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "answer": " I", "created_at": 1679586595}
  240. data: {"event": "message", "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "answer": "'m", "created_at": 1679586595}
  241. data: {"event": "message", "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "answer": " glad", "created_at": 1679586595}
  242. data: {"event": "message", "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "answer": " to", "created_at": 1679586595}
  243. data: {"event": "message", "message_id" : "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "answer": " meet", "created_at": 1679586595}
  244. data: {"event": "message", "message_id" : "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "answer": " you", "created_at": 1679586595}
  245. data: {"event": "message_end", "id": "5e52ce04-874b-4d27-9045-b3bc80def685", "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2", "metadata": {"usage": {"prompt_tokens": 1033, "prompt_unit_price": "0.001", "prompt_price_unit": "0.001", "prompt_price": "0.0010330", "completion_tokens": 135, "completion_unit_price": "0.002", "completion_price_unit": "0.001", "completion_price": "0.0002700", "total_tokens": 1168, "total_price": "0.0013030", "currency": "USD", "latency": 1.381760165997548}, "retriever_resources": [{"position": 1, "dataset_id": "101b4c97-fc2e-463c-90b1-5261a4cdcafb", "dataset_name": "iPhone", "document_id": "8dd1ad74-0b5f-4175-b735-7d98bbbb4e00", "document_name": "iPhone List", "segment_id": "ed599c7f-2766-4294-9d1d-e5235a61270a", "score": 0.98457545, "content": "\"Model\",\"Release Date\",\"Display Size\",\"Resolution\",\"Processor\",\"RAM\",\"Storage\",\"Camera\",\"Battery\",\"Operating System\"\n\"iPhone 13 Pro Max\",\"September 24, 2021\",\"6.7 inch\",\"1284 x 2778\",\"Hexa-core (2x3.23 GHz Avalanche + 4x1.82 GHz Blizzard)\",\"6 GB\",\"128, 256, 512 GB, 1TB\",\"12 MP\",\"4352 mAh\",\"iOS 15\""}]}}
  246. data: {"event": "tts_message", "conversation_id": "23dd85f3-1a41-4ea0-b7a9-062734ccfaf9", "message_id": "a8bdc41c-13b2-4c18-bfd9-054b9803038c", "created_at": 1721205487, "task_id": "3bf8a0bb-e73b-4690-9e66-4e429bad8ee7", "audio": "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"}
  247. data: {"event": "tts_message_end", "conversation_id": "23dd85f3-1a41-4ea0-b7a9-062734ccfaf9", "message_id": "a8bdc41c-13b2-4c18-bfd9-054b9803038c", "created_at": 1721205487, "task_id": "3bf8a0bb-e73b-4690-9e66-4e429bad8ee7", "audio": ""}
  248. ```
  249. </CodeGroup>
  250. </Col>
  251. </Row>
  252. ---
  253. <Heading
  254. url='/files/upload'
  255. method='POST'
  256. title='ファイルアップロード'
  257. name='#file-upload'
  258. />
  259. <Row>
  260. <Col>
  261. メッセージ送信時に使用するためのファイルをアップロードします(現在は画像のみサポート)。画像とテキストのマルチモーダル理解を可能にします。
  262. png、jpg、jpeg、webp、gif 形式をサポートしています。
  263. アップロードされたファイルは現在のエンドユーザーのみが使用できます。
  264. ### リクエストボディ
  265. このインターフェースは`multipart/form-data`リクエストを必要とします。
  266. - `file` (File) 必須
  267. アップロードするファイル。
  268. - `user` (string) 必須
  269. ユーザー識別子、開発者のルールで定義され、アプリケーション内で一意でなければなりません。サービス API は WebApp によって作成された会話を共有しません。
  270. ### 応答
  271. アップロードが成功すると、サーバーはファイルの ID と関連情報を返します。
  272. - `id` (uuid) ID
  273. - `name` (string) ファイル名
  274. - `size` (int) ファイルサイズ(バイト)
  275. - `extension` (string) ファイル拡張子
  276. - `mime_type` (string) ファイルの MIME タイプ
  277. - `created_by` (uuid) エンドユーザーID
  278. - `created_at` (timestamp) 作成タイムスタンプ、例:1705395332
  279. ### エラー
  280. - 400, `no_file_uploaded`, ファイルが提供されなければなりません
  281. - 400, `too_many_files`, 現在は 1 つのファイルのみ受け付けます
  282. - 400, `unsupported_preview`, ファイルはプレビューをサポートしていません
  283. - 400, `unsupported_estimate`, ファイルは推定をサポートしていません
  284. - 413, `file_too_large`, ファイルが大きすぎます
  285. - 415, `unsupported_file_type`, サポートされていない拡張子、現在はドキュメントファイルのみ受け付けます
  286. - 503, `s3_connection_failed`, S3 サービスに接続できません
  287. - 503, `s3_permission_denied`, S3 にファイルをアップロードする権限がありません
  288. - 503, `s3_file_too_large`, ファイルが S3 のサイズ制限を超えています
  289. - 500, 内部サーバーエラー
  290. </Col>
  291. <Col sticky>
  292. ### リクエスト例
  293. <CodeGroup title="リクエスト" tag="POST" label="/files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'file=@localfile;type=image/[png|jpeg|jpg|webp|gif]' \\\n--form 'user=abc-123'`}>
  294. ```bash {{ title: 'cURL' }}
  295. curl -X POST '${props.appDetail.api_base_url}/files/upload' \
  296. --header 'Authorization: Bearer {api_key}' \
  297. --form 'file=@"/path/to/file"'
  298. ```
  299. </CodeGroup>
  300. ### 応答例
  301. <CodeGroup title="応答">
  302. ```json {{ title: '応答' }}
  303. {
  304. "id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
  305. "name": "example.png",
  306. "size": 1024,
  307. "extension": "png",
  308. "mime_type": "image/png",
  309. "created_by": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
  310. "created_at": 1577836800,
  311. }
  312. ```
  313. </CodeGroup>
  314. </Col>
  315. </Row>
  316. ---
  317. <Heading
  318. url='/chat-messages/:task_id/stop'
  319. method='POST'
  320. title='生成停止'
  321. name='#stop-generatebacks'
  322. />
  323. <Row>
  324. <Col>
  325. ストリーミングモードでのみサポートされています。
  326. ### パス
  327. - `task_id` (string) タスク ID、ストリーミングチャンクの返り値から取得できます
  328. ### リクエストボディ
  329. - `user` (string) 必須
  330. ユーザー識別子、エンドユーザーのアイデンティティを定義するために使用され、メッセージ送信インターフェースで渡されたユーザーと一致している必要があります。サービス API は WebApp によって作成された会話を共有しません。
  331. ### 応答
  332. - `result` (string) 常に"success"を返します
  333. </Col>
  334. <Col sticky>
  335. ### リクエスト例
  336. <CodeGroup title="リクエスト" tag="POST" label="/chat-messages/:task_id/stop" targetCode={`curl -X POST '${props.appDetail.api_base_url}/chat-messages/:task_id/stop' \\\n-H 'Authorization: Bearer {api_key}' \\\n-H 'Content-Type: application/json' \\\n--data-raw '{"user": "abc-123"}'`}>
  337. ```bash {{ title: 'cURL' }}
  338. curl -X POST '${props.appDetail.api_base_url}/chat-messages/:task_id/stop' \
  339. -H 'Authorization: Bearer {api_key}' \
  340. -H 'Content-Type: application/json' \
  341. --data-raw '{
  342. "user": "abc-123"
  343. }'
  344. ```
  345. </CodeGroup>
  346. ### 応答例
  347. <CodeGroup title="応答">
  348. ```json {{ title: '応答' }}
  349. {
  350. "result": "success"
  351. }
  352. ```
  353. </CodeGroup>
  354. </Col>
  355. </Row>
  356. ---
  357. <Heading
  358. url='/messages/:message_id/feedbacks'
  359. method='POST'
  360. title='メッセージフィードバック'
  361. name='#feedbacks'
  362. />
  363. <Row>
  364. <Col>
  365. エンドユーザーはフィードバックメッセージを提供でき、アプリケーション開発者が期待される出力を最適化するのに役立ちます。
  366. ### パス
  367. <Properties>
  368. <Property name='message_id' type='string' key='message_id'>
  369. メッセージID
  370. </Property>
  371. </Properties>
  372. ### リクエストボディ
  373. <Properties>
  374. <Property name='rating' type='string' key='rating'>
  375. アップボートは`like`、ダウンボートは`dislike`、アップボートの取り消しは`null`
  376. </Property>
  377. <Property name='user' type='string' key='user'>
  378. ユーザー識別子、開発者のルールで定義され、アプリケーション内で一意でなければなりません。
  379. </Property>
  380. <Property name='content' type='string' key='content'>
  381. メッセージのフィードバックです。
  382. </Property>
  383. </Properties>
  384. ### 応答
  385. - `result` (string) 常に"success"を返します
  386. </Col>
  387. <Col sticky>
  388. <CodeGroup title="リクエスト" tag="POST" label="/messages/:message_id/feedbacks" targetCode={`curl -X POST '${props.appDetail.api_base_url}/messages/:message_id/feedbacks \\\n --header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "rating": "like",\n "user": "abc-123",\n "content": "message feedback information"\n}'`}>
  389. ```bash {{ title: 'cURL' }}
  390. curl -X POST '${props.appDetail.api_base_url}/messages/:message_id/feedbacks' \
  391. --header 'Authorization: Bearer {api_key}' \
  392. --header 'Content-Type: application/json' \
  393. --data-raw '{
  394. "rating": "like",
  395. "user": "abc-123",
  396. "content": "message feedback information"
  397. }'
  398. ```
  399. </CodeGroup>
  400. <CodeGroup title="応答">
  401. ```json {{ title: '応答' }}
  402. {
  403. "result": "success"
  404. }
  405. ```
  406. </CodeGroup>
  407. </Col>
  408. </Row>
  409. ---
  410. <Heading
  411. url='/app/feedbacks'
  412. method='GET'
  413. title='アプリのメッセージの「いいね」とフィードバックを取得'
  414. name='#app-feedbacks'
  415. />
  416. <Row>
  417. <Col>
  418. アプリのエンドユーザーからのフィードバックや「いいね」を取得します。
  419. ### クエリ
  420. <Properties>
  421. <Property name='page' type='string' key='page'>
  422. (任意)ページ番号。デフォルト値:1
  423. </Property>
  424. </Properties>
  425. <Properties>
  426. <Property name='limit' type='string' key='limit'>
  427. (任意)1ページあたりの件数。デフォルト値:20
  428. </Property>
  429. </Properties>
  430. ### レスポンス
  431. - `data` (リスト) このアプリの「いいね」とフィードバックの一覧を返します。
  432. </Col>
  433. <Col sticky>
  434. <CodeGroup title="Request" tag="GET" label="/app/feedbacks" targetCode={`curl -X GET '${props.appDetail.api_base_url}/app/feedbacks?page=1&limit=20'`}>
  435. ```bash {{ title: 'cURL' }}
  436. curl -X GET '${props.appDetail.api_base_url}/app/feedbacks?page=1&limit=20' \
  437. --header 'Authorization: Bearer {api_key}' \
  438. --header 'Content-Type: application/json'
  439. ```
  440. </CodeGroup>
  441. <CodeGroup title="Response">
  442. ```json {{ title: 'Response' }}
  443. {
  444. "data": [
  445. {
  446. "id": "8c0fbed8-e2f9-49ff-9f0e-15a35bdd0e25",
  447. "app_id": "f252d396-fe48-450e-94ec-e184218e7346",
  448. "conversation_id": "2397604b-9deb-430e-b285-4726e51fd62d",
  449. "message_id": "709c0b0f-0a96-4a4e-91a4-ec0889937b11",
  450. "rating": "like",
  451. "content": "message feedback information-3",
  452. "from_source": "user",
  453. "from_end_user_id": "74286412-9a1a-42c1-929c-01edb1d381d5",
  454. "from_account_id": null,
  455. "created_at": "2025-04-24T09:24:38",
  456. "updated_at": "2025-04-24T09:24:38"
  457. }
  458. ]
  459. }
  460. ```
  461. </CodeGroup>
  462. </Col>
  463. </Row>
  464. ---
  465. <Heading
  466. url='/messages/{message_id}/suggested'
  467. method='GET'
  468. title='次の推奨質問'
  469. name='#suggested'
  470. />
  471. <Row>
  472. <Col>
  473. 現在のメッセージに対する次の質問の提案を取得します
  474. ### パスパラメータ
  475. <Properties>
  476. <Property name='message_id' type='string' key='message_id'>
  477. メッセージID
  478. </Property>
  479. </Properties>
  480. ### クエリ
  481. <Properties>
  482. <Property name='user' type='string' key='user'>
  483. ユーザー識別子、エンドユーザーのアイデンティティを定義するために使用され、統計のために使用されます。
  484. アプリケーション内で開発者によって一意に定義される必要があります。
  485. </Property>
  486. </Properties>
  487. </Col>
  488. <Col sticky>
  489. <CodeGroup title="リクエスト" tag="GET" label="/messages/{message_id}/suggested" targetCode={`curl --location --request GET '${props.appDetail.api_base_url}/messages/{message_id}/suggested?user=abc-123& \\\n--header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \\\n--header 'Content-Type: application/json'`}>
  490. ```bash {{ title: 'cURL' }}
  491. curl --location --request GET '${props.appDetail.api_base_url}/messages/{message_id}/suggested' \
  492. --header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \
  493. --header 'Content-Type: application/json' \
  494. ```
  495. </CodeGroup>
  496. <CodeGroup title="応答">
  497. ```json {{ title: '応答' }}
  498. {
  499. "result": "success",
  500. "data": [
  501. "a",
  502. "b",
  503. "c"
  504. ]
  505. }
  506. ```
  507. </CodeGroup>
  508. </Col>
  509. </Row>
  510. ---
  511. <Heading
  512. url='/messages'
  513. method='GET'
  514. title='会話履歴メッセージを取得'
  515. name='#messages'
  516. />
  517. <Row>
  518. <Col>
  519. スクロールロード形式で過去のチャット記録を返し、最初のページは最新の`{limit}`メッセージを返します。つまり、逆順です。
  520. ### クエリ
  521. <Properties>
  522. <Property name='conversation_id' type='string' key='conversation_id'>
  523. 会話ID
  524. </Property>
  525. <Property name='user' type='string' key='user'>
  526. ユーザー識別子、エンドユーザーのアイデンティティを定義するために使用され、統計のために使用されます。
  527. アプリケーション内で開発者によって一意に定義される必要があります。
  528. </Property>
  529. <Property name='first_id' type='string' key='first_id'>
  530. 現在のページの最初のチャット記録のID、デフォルトはnullです。
  531. </Property>
  532. <Property name='limit' type='int' key='limit'>
  533. 1回のリクエストで返すチャット履歴メッセージの数、デフォルトは20です。
  534. </Property>
  535. </Properties>
  536. ### 応答
  537. - `data` (array[object]) メッセージリスト
  538. - `id` (string) メッセージID
  539. - `conversation_id` (string) 会話ID
  540. - `inputs` (object) ユーザー入力パラメータ。
  541. - `query` (string) ユーザー入力/質問内容。
  542. - `message_files` (array[object]) メッセージファイル
  543. - `id` (string) ID
  544. - `type` (string) ファイルタイプ、画像の場合はimage
  545. - `url` (string) プレビュー画像URL
  546. - `belongs_to` (string) 所属、ユーザーまたはアシスタント
  547. - `agent_thoughts` (array[object]) エージェントの思考(基本アシスタントの場合は空)
  548. - `id` (string) エージェント思考ID、各反復には一意のエージェント思考IDがあります
  549. - `message_id` (string) 一意のメッセージID
  550. - `position` (int) 現在のエージェント思考の位置、各メッセージには順番に複数の思考が含まれる場合があります。
  551. - `thought` (string) LLMが考えていること
  552. - `observation` (string) ツール呼び出しからの応答
  553. - `tool` (string) 呼び出されたツールのリスト、;で区切られます
  554. - `tool_input` (string) ツールの入力、JSON形式。例:`{"dalle3": {"prompt": "a cute cat"}}`。
  555. - `created_at` (int) 作成タイムスタンプ、例:1705395332
  556. - `message_files` (array[string]) message_fileイベントを参照
  557. - `file_id` (string) ファイルID
  558. - `answer` (string) 応答メッセージ内容
  559. - `created_at` (timestamp) 作成タイムスタンプ、例:1705395332
  560. - `feedback` (object) フィードバック情報
  561. - `rating` (string) アップボートは`like` / ダウンボートは`dislike`
  562. - `retriever_resources` (array[RetrieverResource]) 引用と帰属リスト
  563. - `has_more` (bool) 次のページがあるかどうか
  564. - `limit` (int) 返されたアイテムの数、入力がシステム制限を超える場合、システム制限の数を返します
  565. </Col>
  566. <Col sticky>
  567. <CodeGroup title="リクエスト" tag="GET" label="/messages" targetCode={`curl -X GET '${props.appDetail.api_base_url}/messages?user=abc-123&conversation_id='\\\n --header 'Authorization: Bearer {api_key}'`}>
  568. ```bash {{ title: 'cURL' }}
  569. curl -X GET '${props.appDetail.api_base_url}/messages?user=abc-123&conversation_id='
  570. --header 'Authorization: Bearer {api_key}'
  571. ```
  572. </CodeGroup>
  573. ### 応答例(基本アシスタント)
  574. <CodeGroup title="応答">
  575. ```json {{ title: '応答' }}
  576. {
  577. "limit": 20,
  578. "has_more": false,
  579. "data": [
  580. {
  581. "id": "a076a87f-31e5-48dc-b452-0061adbbc922",
  582. "conversation_id": "cd78daf6-f9e4-4463-9ff2-54257230a0ce",
  583. "inputs": {
  584. "name": "dify"
  585. },
  586. "query": "iphone 13 pro",
  587. "answer": "iPhone 13 Proは2021年9月24日に発売され、6.1インチのディスプレイと1170 x 2532の解像度を備えています。Hexa-core (2x3.23 GHz Avalanche + 4x1.82 GHz Blizzard)プロセッサ、6 GBのRAMを搭載し、128 GB、256 GB、512 GB、1 TBのストレージオプションを提供します。カメラは12 MP、バッテリー容量は3095 mAhで、iOS 15を搭載しています。",
  588. "message_files": [],
  589. "feedback": null,
  590. "retriever_resources": [
  591. {
  592. "position": 1,
  593. "dataset_id": "101b4c97-fc2e-463c-90b1-5261a4cdcafb",
  594. "dataset_name": "iPhone",
  595. "document_id": "8dd1ad74-0b5f-4175-b735-7d98bbbb4e00",
  596. "document_name": "iPhone List",
  597. "segment_id": "ed599c7f-2766-4294-9d1d-e5235a61270a",
  598. "score": 0.98457545,
  599. "content": "\"Model\",\"Release Date\",\"Display Size\",\"Resolution\",\"Processor\",\"RAM\",\"Storage\",\"Camera\",\"Battery\",\"Operating System\"\n\"iPhone 13 Pro Max\",\"September 24, 2021\",\"6.7 inch\",\"1284 x 2778\",\"Hexa-core (2x3.23 GHz Avalanche + 4x1.82 GHz Blizzard)\",\"6 GB\",\"128, 256, 512 GB, 1TB\",\"12 MP\",\"4352 mAh\",\"iOS 15\""
  600. }
  601. ],
  602. "agent_thoughts": [],
  603. "created_at": 1705569239,
  604. }
  605. ]
  606. }
  607. ```
  608. </CodeGroup>
  609. ### 応答例(エージェントアシスタント)
  610. <CodeGroup title="応答">
  611. ```json {{ title: '応答' }}
  612. {
  613. "limit": 20,
  614. "has_more": false,
  615. "data": [
  616. {
  617. "id": "d35e006c-7c4d-458f-9142-be4930abdf94",
  618. "conversation_id": "957c068b-f258-4f89-ba10-6e8a0361c457",
  619. "inputs": {},
  620. "query": "draw a cat",
  621. "answer": "猫の画像を生成しました。メッセージを確認して画像を表示してください。",
  622. "message_files": [
  623. {
  624. "id": "976990d2-5294-47e6-8f14-7356ba9d2d76",
  625. "type": "image",
  626. "url": "http://127.0.0.1:5001/files/tools/976990d2-5294-47e6-8f14-7356ba9d2d76.png?timestamp=1705988524&nonce=55df3f9f7311a9acd91bf074cd524092&sign=z43nMSO1L2HBvoqADLkRxr7Biz0fkjeDstnJiCK1zh8=",
  627. "belongs_to": "assistant"
  628. }
  629. ],
  630. "feedback": null,
  631. "retriever_resources": [],
  632. "created_at": 1705988187,
  633. "agent_thoughts": [
  634. {
  635. "id": "592c84cf-07ee-441c-9dcc-ffc66c033469",
  636. "chain_id": null,
  637. "message_id": "d35e006c-7c4d-458f-9142-be4930abdf94",
  638. "position": 1,
  639. "thought": "",
  640. "tool": "dalle2",
  641. "tool_input": "{\"dalle2\": {\"prompt\": \"cat\"}}",
  642. "created_at": 1705988186,
  643. "observation": "画像はすでに作成され、ユーザーに送信されました。今すぐユーザーに確認するように伝えてください。",
  644. "files": [
  645. "976990d2-5294-47e6-8f14-7356ba9d2d76"
  646. ]
  647. },
  648. {
  649. "id": "73ead60d-2370-4780-b5ed-532d2762b0e5",
  650. "chain_id": null,
  651. "message_id": "d35e006c-7c4d-458f-9142-be4930abdf94",
  652. "position": 2,
  653. "thought": "猫の画像を生成しました。メッセージを確認して画像を表示してください。",
  654. "tool": "",
  655. "tool_input": "",
  656. "created_at": 1705988199,
  657. "observation": "",
  658. "files": []
  659. }
  660. ]
  661. }
  662. ]
  663. }
  664. ```
  665. </CodeGroup>
  666. </Col>
  667. </Row>
  668. ---
  669. <Heading
  670. url='/conversations'
  671. method='GET'
  672. title='会話を取得'
  673. name='#conversations'
  674. />
  675. <Row>
  676. <Col>
  677. 現在のユーザーの会話リストを取得し、デフォルトで最新の 20 件を返します。
  678. ### クエリ
  679. <Properties>
  680. <Property name='user' type='string' key='user'>
  681. ユーザー識別子、エンドユーザーのアイデンティティを定義するために使用され、統計のために使用されます。
  682. アプリケーション内で開発者によって一意に定義される必要があります。
  683. </Property>
  684. <Property name='last_id' type='string' key='last_id'>
  685. (Optional)現在のページの最後のレコードのID、デフォルトはnullです。
  686. </Property>
  687. <Property name='limit' type='int' key='limit'>
  688. (Optional)1回のリクエストで返すレコードの数、デフォルトは最新の20件です。最大100、最小1。
  689. </Property>
  690. <Property name='sort_by' type='string' key='sort_by'>
  691. (Optional)ソートフィールド、デフォルト:-updated_at(更新時間で降順にソート)
  692. - 利用可能な値:created_at, -created_at, updated_at, -updated_at
  693. - フィールドの前の記号は順序または逆順を表し、"-"は逆順を表します。
  694. </Property>
  695. </Properties>
  696. ### 応答
  697. - `data` (array[object]) 会話のリスト
  698. - `id` (string) 会話ID
  699. - `name` (string) 会話名、デフォルトでは、ユーザーが会話で最初に尋ねた質問のスニペットです。
  700. - `inputs` (object) ユーザー入力パラメータ。
  701. - `introduction` (string) 紹介
  702. - `created_at` (timestamp) 作成タイムスタンプ、例:1705395332
  703. - `updated_at` (timestamp) 更新タイムスタンプ、例:1705395332
  704. - `has_more` (bool)
  705. - `limit` (int) 返されたエントリの数、入力がシステム制限を超える場合、システム制限の数を返します
  706. </Col>
  707. <Col sticky>
  708. <CodeGroup title="リクエスト" tag="GET" label="/conversations" targetCode={`curl -X GET '${props.appDetail.api_base_url}/conversations?user=abc-123&last_id=&limit=20' \\\n --header 'Authorization: Bearer {api_key}'`}>
  709. ```bash {{ title: 'cURL' }}
  710. curl -X GET '${props.appDetail.api_base_url}/conversations?user=abc-123&last_id=&limit=20' \
  711. --header 'Authorization: Bearer {api_key}'
  712. ```
  713. </CodeGroup>
  714. <CodeGroup title="応答">
  715. ```json {{ title: '応答' }}
  716. {
  717. "limit": 20,
  718. "has_more": false,
  719. "data": [
  720. {
  721. "id": "10799fb8-64f7-4296-bbf7-b42bfbe0ae54",
  722. "name": "新しいチャット",
  723. "inputs": {
  724. "book": "book",
  725. "myName": "Lucy"
  726. },
  727. "status": "normal",
  728. "created_at": 1679667915,
  729. "updated_at": 1679667915
  730. },
  731. {
  732. "id": "hSIhXBhNe8X1d8Et"
  733. // ...
  734. }
  735. ]
  736. }
  737. ```
  738. </CodeGroup>
  739. </Col>
  740. </Row>
  741. ---
  742. <Heading
  743. url='/conversations/:conversation_id'
  744. method='DELETE'
  745. title='会話を削除'
  746. name='#delete'
  747. />
  748. <Row>
  749. <Col>
  750. 会話を削除します。
  751. ### パス
  752. - `conversation_id` (string) 会話ID
  753. ### リクエストボディ
  754. <Properties>
  755. <Property name='user' type='string' key='user'>
  756. ユーザー識別子、開発者によって定義され、アプリケーション内で一意である必要があります。
  757. </Property>
  758. </Properties>
  759. ### 応答
  760. - `result` (string) 常に"success"を返します
  761. </Col>
  762. <Col sticky>
  763. <CodeGroup title="リクエスト" tag="DELETE" label="/conversations/:conversation_id" targetCode={`curl -X DELETE '${props.appDetail.api_base_url}/conversations/:conversation_id' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "user": "abc-123"\n}'`}>
  764. ```bash {{ title: 'cURL' }}
  765. curl -X DELETE '${props.appDetail.api_base_url}/conversations/{conversation_id}' \
  766. --header 'Content-Type: application/json' \
  767. --header 'Accept: application/json' \
  768. --header 'Authorization: Bearer {api_key}' \
  769. --data '{
  770. "user": "abc-123"
  771. }'
  772. ```
  773. </CodeGroup>
  774. <CodeGroup title="応答">
  775. ```text {{ title: '応答' }}
  776. 204 No Content
  777. ```
  778. </CodeGroup>
  779. </Col>
  780. </Row>
  781. ---
  782. <Heading
  783. url='/conversations/:conversation_id/name'
  784. method='POST'
  785. title='会話の名前を変更'
  786. name='#rename'
  787. />
  788. <Row>
  789. <Col>
  790. ### リクエストボディ
  791. セッションの名前を変更します。セッション名は、複数のセッションをサポートするクライアントでの表示に使用されます。
  792. ### パス
  793. - `conversation_id` (string) 会話ID
  794. <Properties>
  795. <Property name='name' type='string' key='name'>
  796. (Optional)会話の名前。このパラメータは、`auto_generate`が`true`に設定されている場合、省略できます。
  797. </Property>
  798. <Property name='auto_generate' type='bool' key='auto_generate'>
  799. (Optional)タイトルを自動生成します。デフォルトは`false`です。
  800. </Property>
  801. <Property name='user' type='string' key='user'>
  802. ユーザー識別子、開発者によって定義され、アプリケーション内で一意である必要があります。
  803. </Property>
  804. </Properties>
  805. ### 応答
  806. - `id` (string) 会話ID
  807. - `name` (string) 会話名
  808. - `inputs` (object) ユーザー入力パラメータ
  809. - `status` (string) 会話状態
  810. - `introduction` (string) 紹介
  811. - `created_at` (timestamp) 作成タイムスタンプ、例:1705395332
  812. - `updated_at` (timestamp) 更新タイムスタンプ、例:1705395332
  813. </Col>
  814. <Col sticky>
  815. <CodeGroup title="リクエスト" tag="POST" label="/conversations/:conversation_id/name" targetCode={`curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "name": "", \n "auto_generate": true, \n "user": "abc-123"\n}'`}>
  816. ```bash {{ title: 'cURL' }}
  817. curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \
  818. --header 'Content-Type: application/json' \
  819. --header 'Authorization: Bearer {api_key}' \
  820. --data-raw '{
  821. "name": "",
  822. "auto_generate": true,
  823. "user": "abc-123"
  824. }'
  825. ```
  826. </CodeGroup>
  827. <CodeGroup title="応答">
  828. ```json {{ title: '応答' }}
  829. {
  830. "id": "cd78daf6-f9e4-4463-9ff2-54257230a0ce",
  831. "name": "Chat vs AI",
  832. "inputs": {},
  833. "introduction": "",
  834. "created_at": 1705569238,
  835. "updated_at": 1705569238
  836. }
  837. ```
  838. </CodeGroup>
  839. </Col>
  840. </Row>
  841. ---
  842. <Heading
  843. url='/conversations/:conversation_id/variables'
  844. method='GET'
  845. title='会話変数の取得'
  846. name='#conversation-variables'
  847. />
  848. <Row>
  849. <Col>
  850. 特定の会話から変数を取得します。このエンドポイントは、会話中に取得された構造化データを抽出するのに役立ちます。
  851. ### パスパラメータ
  852. <Properties>
  853. <Property name='conversation_id' type='string' key='conversation_id'>
  854. 変数を取得する会話のID。
  855. </Property>
  856. </Properties>
  857. ### クエリパラメータ
  858. <Properties>
  859. <Property name='user' type='string' key='user'>
  860. ユーザー識別子。開発者によって定義されたルールに従い、アプリケーション内で一意である必要があります。
  861. </Property>
  862. <Property name='last_id' type='string' key='last_id'>
  863. (Optional)現在のページの最後のレコードのID、デフォルトはnullです。
  864. </Property>
  865. <Property name='limit' type='int' key='limit'>
  866. (Optional)1回のリクエストで返すレコードの数、デフォルトは最新の20件です。最大100、最小1。
  867. </Property>
  868. </Properties>
  869. ### レスポンス
  870. - `limit` (int) ページごとのアイテム数
  871. - `has_more` (bool) さらにアイテムがあるかどうか
  872. - `data` (array[object]) 変数のリスト
  873. - `id` (string) 変数 ID
  874. - `name` (string) 変数名
  875. - `value_type` (string) 変数タイプ(文字列、数値、真偽値など)
  876. - `value` (string) 変数値
  877. - `description` (string) 変数の説明
  878. - `created_at` (int) 作成タイムスタンプ
  879. - `updated_at` (int) 最終更新タイムスタンプ
  880. ### エラー
  881. - 404, `conversation_not_exists`, 会話が見つかりません
  882. </Col>
  883. <Col sticky>
  884. <CodeGroup title="Request" tag="GET" label="/conversations/:conversation_id/variables" targetCode={`curl -X GET '${props.appDetail.api_base_url}/conversations/{conversation_id}/variables?user=abc-123' \\\n--header 'Authorization: Bearer {api_key}'`}>
  885. ```bash {{ title: 'cURL' }}
  886. curl -X GET '${props.appDetail.api_base_url}/conversations/{conversation_id}/variables?user=abc-123' \
  887. --header 'Authorization: Bearer {api_key}'
  888. ```
  889. </CodeGroup>
  890. <CodeGroup title="Request with variable name filter">
  891. ```bash {{ title: 'cURL' }}
  892. curl -X GET '${props.appDetail.api_base_url}/conversations/{conversation_id}/variables?user=abc-123&variable_name=customer_name' \
  893. --header 'Authorization: Bearer {api_key}'
  894. ```
  895. </CodeGroup>
  896. <CodeGroup title="Response">
  897. ```json {{ title: 'Response' }}
  898. {
  899. "limit": 100,
  900. "has_more": false,
  901. "data": [
  902. {
  903. "id": "variable-uuid-1",
  904. "name": "customer_name",
  905. "value_type": "string",
  906. "value": "John Doe",
  907. "description": "会話から抽出された顧客名",
  908. "created_at": 1650000000000,
  909. "updated_at": 1650000000000
  910. },
  911. {
  912. "id": "variable-uuid-2",
  913. "name": "order_details",
  914. "value_type": "json",
  915. "value": "{\"product\":\"Widget\",\"quantity\":5,\"price\":19.99}",
  916. "description": "顧客の注文詳細",
  917. "created_at": 1650000000000,
  918. "updated_at": 1650000000000
  919. }
  920. ]
  921. }
  922. ```
  923. </CodeGroup>
  924. </Col>
  925. </Row>
  926. ---
  927. <Heading
  928. url='/audio-to-text'
  929. method='POST'
  930. title='音声からテキストへ'
  931. name='#audio'
  932. />
  933. <Row>
  934. <Col>
  935. このエンドポイントは multipart/form-data リクエストを必要とします。
  936. ### リクエストボディ
  937. <Properties>
  938. <Property name='file' type='file' key='file'>
  939. オーディオファイル。
  940. サポートされている形式:`['mp3', 'mp4', 'mpeg', 'mpga', 'm4a', 'wav', 'webm']`
  941. ファイルサイズ制限:15MB
  942. </Property>
  943. <Property name='user' type='string' key='user'>
  944. ユーザー識別子、開発者のルールで定義され、アプリケーション内で一意でなければなりません。
  945. </Property>
  946. </Properties>
  947. ### 応答
  948. - `text` (string) 出力テキスト
  949. </Col>
  950. <Col sticky>
  951. <CodeGroup title="リクエスト" tag="POST" label="/audio-to-text" targetCode={`curl -X POST '${props.appDetail.api_base_url}/audio-to-text' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'file=@localfile;type=audio/[mp3|mp4|mpeg|mpga|m4a|wav|webm]'`}>
  952. ```bash {{ title: 'cURL' }}
  953. curl -X POST '${props.appDetail.api_base_url}/conversations/name' \
  954. --header 'Authorization: Bearer {api_key}' \
  955. --form 'file=@localfile;type=audio/mp3'
  956. ```
  957. </CodeGroup>
  958. <CodeGroup title="応答">
  959. ```json {{ title: '応答' }}
  960. {
  961. "text": ""
  962. }
  963. ```
  964. </CodeGroup>
  965. </Col>
  966. </Row>
  967. ---
  968. <Heading
  969. url='/text-to-audio'
  970. method='POST'
  971. title='テキストから音声へ'
  972. name='#audio'
  973. />
  974. <Row>
  975. <Col>
  976. テキストを音声に変換します。
  977. ### リクエストボディ
  978. <Properties>
  979. <Property name='message_id' type='str' key='message_id'>
  980. Difyによって生成されたテキストメッセージの場合、生成されたメッセージIDを直接渡します。バックエンドはメッセージIDを使用して対応するコンテンツを検索し、音声情報を直接合成します。message_idとtextが同時に提供される場合、message_idが優先されます。
  981. </Property>
  982. <Property name='text' type='str' key='text'>
  983. 音声生成コンテンツ。
  984. </Property>
  985. <Property name='user' type='string' key='user'>
  986. ユーザー識別子、開発者によって定義され、アプリ内で一意である必要があります。
  987. </Property>
  988. </Properties>
  989. </Col>
  990. <Col sticky>
  991. <CodeGroup title="リクエスト" tag="POST" label="/text-to-audio" targetCode={`curl --location --request POST '${props.appDetail.api_base_url}/text-to-audio' \\\n--header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \\\n--form 'text=Hello Dify;user=abc-123;message_id=5ad4cb98-f0c7-4085-b384-88c403be6290`}>
  992. ```bash {{ title: 'cURL' }}
  993. curl --location --request POST '${props.appDetail.api_base_url}/text-to-audio' \
  994. --header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \
  995. --form 'file=Hello Dify;user=abc-123;message_id=5ad4cb98-f0c7-4085-b384-88c403be6290'
  996. ```
  997. </CodeGroup>
  998. <CodeGroup title="ヘッダー">
  999. ```json {{ title: 'ヘッダー' }}
  1000. {
  1001. "Content-Type": "audio/wav"
  1002. }
  1003. ```
  1004. </CodeGroup>
  1005. </Col>
  1006. </Row>
  1007. ---
  1008. <Heading
  1009. url='/info'
  1010. method='GET'
  1011. title='アプリケーションの基本情報を取得'
  1012. name='#info'
  1013. />
  1014. <Row>
  1015. <Col>
  1016. このアプリケーションの基本情報を取得するために使用されます
  1017. ### Response
  1018. - `name` (string) アプリケーションの名前
  1019. - `description` (string) アプリケーションの説明
  1020. - `tags` (array[string]) アプリケーションのタグ
  1021. - `mode` (string) アプリケーションのモード
  1022. - `author_name` (string) 作者の名前
  1023. </Col>
  1024. <Col>
  1025. <CodeGroup title="Request" tag="GET" label="/info" targetCode={`curl -X GET '${props.appDetail.api_base_url}/info' \\\n-H 'Authorization: Bearer {api_key}'`}>
  1026. ```bash {{ title: 'cURL' }}
  1027. curl -X GET '${props.appDetail.api_base_url}/info' \
  1028. -H 'Authorization: Bearer {api_key}'
  1029. ```
  1030. </CodeGroup>
  1031. <CodeGroup title="Response">
  1032. ```json {{ title: 'Response' }}
  1033. {
  1034. "name": "My App",
  1035. "description": "This is my app.",
  1036. "tags": [
  1037. "tag1",
  1038. "tag2"
  1039. ],
  1040. "mode": "chat",
  1041. "author_name": "Dify"
  1042. }
  1043. ```
  1044. </CodeGroup>
  1045. </Col>
  1046. </Row>
  1047. ---
  1048. <Heading
  1049. url='/parameters'
  1050. method='GET'
  1051. title='アプリケーションのパラメータ情報を取得'
  1052. name='#parameters'
  1053. />
  1054. <Row>
  1055. <Col>
  1056. ページに入る際に、機能、入力パラメータ名、タイプ、デフォルト値などの情報を取得するために使用されます。
  1057. ### 応答
  1058. - `opening_statement` (string) 開始文
  1059. - `suggested_questions` (array[string]) 開始時の推奨質問のリスト
  1060. - `suggested_questions_after_answer` (object) 答えを有効にした後の質問を提案します。
  1061. - `enabled` (bool) 有効かどうか
  1062. - `speech_to_text` (object) 音声からテキストへ
  1063. - `enabled` (bool) 有効かどうか
  1064. - `text_to_speech` (object) テキストから音声へ
  1065. - `enabled` (bool) 有効かどうか
  1066. - `voice` (string) 音声タイプ
  1067. - `language` (string) 言語
  1068. - `autoPlay` (string) 自動再生
  1069. - `enabled` 有効
  1070. - `disabled` 無効
  1071. - `retriever_resource` (object) 引用と帰属
  1072. - `enabled` (bool) 有効かどうか
  1073. - `annotation_reply` (object) 注釈返信
  1074. - `enabled` (bool) 有効かどうか
  1075. - `user_input_form` (array[object]) ユーザー入力フォームの構成
  1076. - `text-input` (object) テキスト入力コントロール
  1077. - `label` (string) 変数表示ラベル名
  1078. - `variable` (string) 変数ID
  1079. - `required` (bool) 必須かどうか
  1080. - `default` (string) デフォルト値
  1081. - `paragraph` (object) 段落テキスト入力コントロール
  1082. - `label` (string) 変数表示ラベル名
  1083. - `variable` (string) 変数ID
  1084. - `required` (bool) 必須かどうか
  1085. - `default` (string) デフォルト値
  1086. - `select` (object) ドロップダウンコントロール
  1087. - `label` (string) 変数表示ラベル名
  1088. - `variable` (string) 変数ID
  1089. - `required` (bool) 必須かどうか
  1090. - `default` (string) デフォルト値
  1091. - `options` (array[string]) オプション値
  1092. - `file_upload` (object) ファイルアップロード設定
  1093. - `document` (object) ドキュメント設定
  1094. 現在サポートされているドキュメントタイプ:`txt`, `md`, `markdown`, `pdf`, `html`, `xlsx`, `xls`, `docx`, `csv`, `eml`, `msg`, `pptx`, `ppt`, `xml`, `epub`。
  1095. - `enabled` (bool) 有効かどうか
  1096. - `number_limits` (int) ドキュメント数の上限。デフォルトは 3
  1097. - `transfer_methods` (array[string]) 転送方法リスト:`remote_url`, `local_file`。いずれかを選択する必要があります。
  1098. - `image` (object) 画像設定
  1099. 現在サポートされている画像タイプ:`png`, `jpg`, `jpeg`, `webp`, `gif`。
  1100. - `enabled` (bool) 有効かどうか
  1101. - `number_limits` (int) 画像数の上限。デフォルトは 3
  1102. - `transfer_methods` (array[string]) 転送方法リスト:`remote_url`, `local_file`。いずれかを選択する必要があります。
  1103. - `audio` (object) オーディオ設定
  1104. 現在サポートされているオーディオタイプ:`mp3`, `m4a`, `wav`, `webm`, `amr`。
  1105. - `enabled` (bool) 有効かどうか
  1106. - `number_limits` (int) オーディオ数の上限。デフォルトは 3
  1107. - `transfer_methods` (array[string]) 転送方法リスト:`remote_url`, `local_file`。いずれかを選択する必要があります。
  1108. - `video` (object) ビデオ設定
  1109. 現在サポートされているビデオタイプ:`mp4`, `mov`, `mpeg`, `mpga`。
  1110. - `enabled` (bool) 有効かどうか
  1111. - `number_limits` (int) ビデオ数の上限。デフォルトは 3
  1112. - `transfer_methods` (array[string]) 転送方法リスト:`remote_url`, `local_file`。いずれかを選択する必要があります。
  1113. - `custom` (object) カスタム設定
  1114. - `enabled` (bool) 有効かどうか
  1115. - `number_limits` (int) カスタム数の上限。デフォルトは 3
  1116. - `transfer_methods` (array[string]) 転送方法リスト:`remote_url`, `local_file`。いずれかを選択する必要があります。
  1117. - `system_parameters` (object) システムパラメータ
  1118. - `file_size_limit` (int) ドキュメントアップロードサイズ制限(MB)
  1119. - `image_file_size_limit` (int) 画像ファイルアップロードサイズ制限(MB)
  1120. - `audio_file_size_limit` (int) オーディオファイルアップロードサイズ制限(MB)
  1121. - `video_file_size_limit` (int) ビデオファイルアップロードサイズ制限(MB)
  1122. </Col>
  1123. <Col sticky>
  1124. <CodeGroup title="リクエスト" tag="GET" label="/parameters" targetCode={` curl -X GET '${props.appDetail.api_base_url}/parameters'`}>
  1125. ```bash {{ title: 'cURL' }}
  1126. curl -X GET '${props.appDetail.api_base_url}/parameters' \
  1127. --header 'Authorization: Bearer {api_key}'
  1128. ```
  1129. </CodeGroup>
  1130. <CodeGroup title="応答">
  1131. ```json {{ title: '応答' }}
  1132. {
  1133. "opening_statement": "こんにちは!",
  1134. "suggested_questions_after_answer": {
  1135. "enabled": true
  1136. },
  1137. "speech_to_text": {
  1138. "enabled": true
  1139. },
  1140. "text_to_speech": {
  1141. "enabled": true,
  1142. "voice": "sambert-zhinan-v1",
  1143. "language": "zh-Hans",
  1144. "autoPlay": "disabled"
  1145. },
  1146. "retriever_resource": {
  1147. "enabled": true
  1148. },
  1149. "annotation_reply": {
  1150. "enabled": true
  1151. },
  1152. "user_input_form": [
  1153. {
  1154. "paragraph": {
  1155. "label": "クエリ",
  1156. "variable": "query",
  1157. "required": true,
  1158. "default": ""
  1159. }
  1160. }
  1161. ],
  1162. "file_upload": {
  1163. "image": {
  1164. "enabled": false,
  1165. "number_limits": 3,
  1166. "detail": "high",
  1167. "transfer_methods": [
  1168. "remote_url",
  1169. "local_file"
  1170. ]
  1171. }
  1172. },
  1173. "system_parameters": {
  1174. "file_size_limit": 15,
  1175. "image_file_size_limit": 10,
  1176. "audio_file_size_limit": 50,
  1177. "video_file_size_limit": 100
  1178. }
  1179. }
  1180. ```
  1181. </CodeGroup>
  1182. </Col>
  1183. </Row>
  1184. ---
  1185. <Heading
  1186. url='/meta'
  1187. method='GET'
  1188. title='アプリケーションのメタ情報を取得'
  1189. name='#meta'
  1190. />
  1191. <Row>
  1192. <Col>
  1193. このアプリケーションのツールのアイコンを取得するために使用されます
  1194. ### 応答
  1195. - `tool_icons`(object[string]) ツールアイコン
  1196. - `tool_name` (string)
  1197. - `icon` (object|string)
  1198. - (object) アイコンオブジェクト
  1199. - `background` (string) 背景色(16 進数形式)
  1200. - `content`(string) 絵文字
  1201. - (string) アイコンの URL
  1202. </Col>
  1203. <Col>
  1204. <CodeGroup title="リクエスト" tag="GET" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/meta' \\\n-H 'Authorization: Bearer {api_key}'`}>
  1205. ```bash {{ title: 'cURL' }}
  1206. curl -X GET '${props.appDetail.api_base_url}/meta' \
  1207. -H 'Authorization: Bearer {api_key}'
  1208. ```
  1209. </CodeGroup>
  1210. <CodeGroup title="応答">
  1211. ```json {{ title: '応答' }}
  1212. {
  1213. "tool_icons": {
  1214. "dalle2": "https://cloud.dify.ai/console/api/workspaces/current/tool-provider/builtin/dalle/icon",
  1215. "api_tool": {
  1216. "background": "#252525",
  1217. "content": "\ud83d\ude01"
  1218. }
  1219. }
  1220. }
  1221. ```
  1222. </CodeGroup>
  1223. </Col>
  1224. </Row>
  1225. ---
  1226. <Heading
  1227. url='/site'
  1228. method='GET'
  1229. title='アプリのWebApp設定を取得'
  1230. name='#site'
  1231. />
  1232. <Row>
  1233. <Col>
  1234. アプリの WebApp 設定を取得するために使用します。
  1235. ### 応答
  1236. - `title` (string) WebApp 名
  1237. - `chat_color_theme` (string) チャットの色テーマ、16 進数形式
  1238. - `chat_color_theme_inverted` (bool) チャットの色テーマを反転するかどうか
  1239. - `icon_type` (string) アイコンタイプ、`emoji`-絵文字、`image`-画像
  1240. - `icon` (string) アイコン。`emoji`タイプの場合は絵文字、`image`タイプの場合は画像 URL
  1241. - `icon_background` (string) 16 進数形式の背景色
  1242. - `icon_url` (string) アイコンの URL
  1243. - `description` (string) 説明
  1244. - `copyright` (string) 著作権情報
  1245. - `privacy_policy` (string) プライバシーポリシーのリンク
  1246. - `custom_disclaimer` (string) カスタム免責事項
  1247. - `default_language` (string) デフォルト言語
  1248. - `show_workflow_steps` (bool) ワークフローの詳細を表示するかどうか
  1249. - `use_icon_as_answer_icon` (bool) WebApp のアイコンをチャット内の🤖に置き換えるかどうか
  1250. </Col>
  1251. <Col>
  1252. <CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
  1253. ```bash {{ title: 'cURL' }}
  1254. curl -X GET '${props.appDetail.api_base_url}/site' \
  1255. -H 'Authorization: Bearer {api_key}'
  1256. ```
  1257. </CodeGroup>
  1258. <CodeGroup title="Response">
  1259. ```json {{ title: 'Response' }}
  1260. {
  1261. "title": "My App",
  1262. "chat_color_theme": "#ff4a4a",
  1263. "chat_color_theme_inverted": false,
  1264. "icon_type": "emoji",
  1265. "icon": "😄",
  1266. "icon_background": "#FFEAD5",
  1267. "icon_url": null,
  1268. "description": "This is my app.",
  1269. "copyright": "all rights reserved",
  1270. "privacy_policy": "",
  1271. "custom_disclaimer": "All generated by AI",
  1272. "default_language": "en-US",
  1273. "show_workflow_steps": false,
  1274. "use_icon_as_answer_icon": false,
  1275. }
  1276. ```
  1277. </CodeGroup>
  1278. </Col>
  1279. </Row>
  1280. ___