Skip to content

feat(gooddata-sdk): [AUTO] Add allowedRelationshipTypes parameter to AI chat methods#1330

Open
yenkins-admin wants to merge 1 commit intomasterfrom
feature/auto-P011-add-allowed-relationship-types
Open

feat(gooddata-sdk): [AUTO] Add allowedRelationshipTypes parameter to AI chat methods#1330
yenkins-admin wants to merge 1 commit intomasterfrom
feature/auto-P011-add-allowed-relationship-types

Conversation

@yenkins-admin
Copy link
Contributor

Extended AI chat methods in ComputeService to support the new allowedRelationshipTypes field for role-based filtering of search results.

Problem ID: P011
Workflow: https://github.com/gooddata/gdc-nas/actions/runs/22094366952

What changed in gdc-nas

Extended GenAI Chat API to support role-based filtering of search results and relationships via allowedRelationshipTypes field. This field allows backend to filter results based on user permissions (e.g., view-only users), preventing frontend filtering inconsistencies.

Commit: 85777a0 - Merge pull request #20108 from gooddata/ach/gdai-1166-allowed-references-in-chat

Key changes:

  • Added allowedRelationshipTypes field (optional array) to ChatRequest model in afm-exec-api
  • Created AllowedRelationshipType model with sourceType, targetType, and allowOrphans fields
  • Implemented relationship filtering logic in gen-ai service
  • Updated gRPC proto definitions and service implementation

What was implemented in SDK

Extended the ComputeService ai_chat() and ai_chat_stream() methods to accept an optional allowed_relationship_types parameter (List[AllowedRelationshipType]), which is passed through to the ChatRequest API client. This enables SDK users to filter relationships and search results based on role permissions.

Files modified:

  • src/gooddata_sdk/compute/service.py - Added allowed_relationship_types parameter to both AI chat methods
  • tests/compute/test_compute_service.py - Added test cases for the new parameter

JIRA: TBD (Jira sandbox under maintenance)
Risk: Low

…AI chat methods

Extended ai_chat() and ai_chat_stream() methods in ComputeService to support
the new allowedRelationshipTypes field from ChatRequest API. This allows SDK
users to filter relationships and search results based on role permissions
(e.g., view-only users). Added corresponding tests for both methods.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant