ai-sdk-provider: add Genie agent integration#417
Open
r-julien-bataille wants to merge 2 commits intodatabricks:mainfrom
Open
ai-sdk-provider: add Genie agent integration#417r-julien-bataille wants to merge 2 commits intodatabricks:mainfrom
r-julien-bataille wants to merge 2 commits intodatabricks:mainfrom
Conversation
Signed-off-by: Julien Bataille <1373396+r-julien-bataille@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Databricks Genie integration to
@databricks/ai-sdk-provider, exposing both:createDatabricksGenieConversationClient(settings)— a typed client over the Databricks Genie Conversation REST API.createDatabricksGenieAgent(settings)— a Vercel AI SDK Agent wrapper that turns a Genie space into a streaming agent compatible withstreamText/generateTextand the AI SDK UI helpers.The agent surfaces Genie's intermediate states as
reasoning-deltaparts (e.g.Asking Ai,Executing Query) and emits the final answer as text, so it integrates cleanly with chat UIs that render reasoning streams. An optionaldebugsetting logs requests/responses withAuthorization,Cookie, andSet-Cookieredacted.Validation
Tested end-to-end against a real Databricks workspace + Genie space using
vercel/chatbotas the host application. The chat UI:API coverage
Genie Conversation API — implemented and covered by unit + live smoke tests:
start-conversationcreateMessage(follow-up turns)getMessage/ polling until terminal statuslistConversations— verified live (used to enumerate prior conversations)listConversationMessages— verified live (used to resume a conversation)deleteConversation— verified livegetMessageAttachmentQueryResult(tabular results for query attachments)Genie Conversation API — implemented, not yet tested:
executeMessageAttachmentQuery(re-execute query attachment)generateDownloadFullQueryResult/getDownloadFullQueryResult(full result download)Genie Space API — partially implemented, not tested:
getSpace(withinclude_serialized_space) andgetSampleQuestionsare wired through but only exercised against mocked responses.Known limitations
text,query, andsuggested_questions— the order in which they are emitted fromstreamConversationdoes not always match the order rendered in the Databricks UI. The current implementation emits attachments in the order Genie returns them in the API payload, which doesn't appear to carry an explicit display index. Suggestions on the canonical ordering signal would be welcome.Tests
pnpm --filter @databricks/ai-sdk-provider testpnpm --filter @databricks/ai-sdk-provider test:genie:live(requiresDATABRICKS_HOST,DATABRICKS_TOKEN,DATABRICKS_GENIE_SPACE_ID)listConversationMessages, delete conversation