feat(gooddata-sdk): [AUTO] expose user_context in ai_chat/ai_chat_stream and export new gen-AI types#1426
Closed
yenkins-admin wants to merge 1 commit intomasterfrom
Closed
Conversation
…eam and export new gen-AI types Added optional user_context parameter to ai_chat and ai_chat_stream methods in ComputeService, enabling callers to pass UIContext, DashboardContext, WidgetDescriptor hierarchy, and ObjectReferenceGroup to the AI chat endpoint. Re-exported all new gen-AI client types (UIContext, DashboardContext, WidgetDescriptor subtypes, ObjectReference, ObjectReferenceGroup, ToolCallEventResult, UserContext) from gooddata_sdk.__init__.py public API surface. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1426 +/- ##
==========================================
- Coverage 77.36% 77.34% -0.02%
==========================================
Files 228 228
Lines 14775 14792 +17
==========================================
+ Hits 11430 11441 +11
- Misses 3345 3351 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Expose optional
user_contextparameter inai_chat/ai_chat_streamSDK methods and re-export new gen-AI model types from the public API surface.P008 | Workflow: https://github.com/gooddata/gdc-nas/actions/runs/23137028021
Caution
Test fixtures need recording. The following fixture files are referenced by tests but do not exist yet.
They must be recorded against a live GoodData server before merging:
packages/gooddata-sdk/tests/compute/fixtures/ai_chat_with_user_context.yamlpackages/gooddata-sdk/tests/compute/fixtures/ai_chat_stream_with_user_context.yamlWhat changed in gdc-nas
Three commits incrementally extended the Chat data model in
afm-exec-apifor gen-AI skill integration:3f2b607(LX-2141): Added UI context support — newUIContext,DashboardContext, sealedWidgetDescriptorhierarchy (InsightWidgetDescriptor,RichTextWidgetDescriptor,VisualizationSwitcherWidgetDescriptor),ObjectReference,ObjectReferenceGroup, andObjectReferenceTypeenum. ExtendedUserContextwithview: UIContext?andreferencedObjects: List<ObjectReferenceGroup>?fields; deprecatedactiveObject.0e847c5(GDAI-1438): AddedToolCallEventResultdata class andtoolCallEvents: List<ToolCallEventResult>?toChatResultto surface agentic loop tool call events. Wired gen-ai proto for skill tests.075d22d(CQ-104): MadereferencedObjectsnullable to fix downstream UI SDK code generation.What was implemented in SDK
user_context: UserContext | None = Noneparameter toai_chatandai_chat_streaminComputeService, forwarded toChatRequestusing the conditional kwargs pattern (backward-compatible).gooddata_sdk.__init__.py:UIContext,DashboardContext,WidgetDescriptor,InsightWidgetDescriptor,RichTextWidgetDescriptor,VisualizationSwitcherWidgetDescriptor,ObjectReference,ObjectReferenceGroup,ToolCallEventResult,UserContext.user_contextparameter referencing cassette fixtures that need recording against a live server.Files modified
packages/gooddata-sdk/src/gooddata_sdk/compute/service.pypackages/gooddata-sdk/src/gooddata_sdk/__init__.pypackages/gooddata-sdk/tests/compute/test_compute_service.pyJIRA: PENDING (Jira ticket will be created after review)
Risk: Low