AppKit does not support agentic genie, only chat API

Offen
#729 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
55/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
TypeScript
Sterne
119
Forks
36
Ø Merge
4 T. 16 Std.
Gemergte PRs (30 T.)
37

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus databricks/appkit

Alle Issues in databricks/appkit

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.