AppKit does not support agentic genie, only chat API

未關閉
#729 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 3 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
55/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍

研究方向

Start by locating AppKit’s existing Genie chat API integration and its tests; the issue does not name specific files or test commands. Compare that flow with the listed agent response, conversation message retrieval, and visualization download APIs, including the enable_viz flag and raw PNG response. Done means AppKit supports agentic responses and retrieves completed messages and visualizations.

由索引模型根據 Issue 內容生成。

描述

What is available is only chat apis, and these do not provide "thinking" agentic responses.

The agentic api is a bit more complex to use, as by default it does not send visualisations, which needs to be enabled by a enable_viz flag, and then visualisations need to have PNG downloaded via another API call.

Here is the list of APIs that should be used in AppKit to provide agentic genie experience:

Option A: Agent mode

  1. Create an Agent-mode response
curl -N -X POST \
  "$DATABRICKS_HOST/api/2.0/genie/agents/$AGENT_ID/responses" \
  -H "Authorization: Bearer $DATABRICKS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "enable_viz": true,
    "input": [{
      "type": "message",
      "role": "user",
      "content": [{
        "type": "input_text",
        "text": "Show revenue by region as a bar chart for last quarter"
      }]
    }]
  }'

This returns an SSE stream. Capture the conversation_id from response.created and wait for response.completed.

  1. Retrieve the completed message
    Use the Agent ID as the space_id:
curl "$DATABRICKS_HOST/api/2.0/genie/spaces/$AGENT_ID/conversations/$CONVERSATION_ID/messages" \
  -H "Authorization: Bearer $DATABRICKS_TOKEN"

Find the completed message containing:

{
  "message_id": "MESSAGE_ID",
  "status": "COMPLETED",
  "attachments": [
    {
      "attachment_id": "VIZ_ATTACHMENT_ID",
      "viz": {
        "title": "Revenue by region",
        "query_attachment_id": "QUERY_ATTACHMENT_ID"
      }
    }
  ]
}

Use the attachment_id belonging to the viz attachment—not query_attachment_id. Agent-mode messages are available through the conversation messages API as Genie message projections.

  1. Download the visualization as PNG
    curl -L \
"$DATABRICKS_HOST/api/2.0/genie/spaces/$AGENT_ID/conversations/$CONVERSATION_ID/messages/$MESSAGE_ID/attachments/$VIZ_ATTACHMENT_ID/download-visualization" \
  -H "Authorization: Bearer $DATABRICKS_TOKEN" \
  -H "Accept: image/png" \
  -o chart.png

The response body is the raw PNG binary, not JSON. The message must be COMPLETED, and the attachment must be a visualization.

主要語言
TypeScript
星號
119
分支
36
平均合併
4 天 16 小時
30 天內合併 PR
37

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

databricks/appkit 的其他 Issue

查看 databricks/appkit 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。