Skip to content

feat(gooddata-sdk): [AUTO] Add conversation responses list and feedback endpoints in gen-ai#1551

Closed
yenkins-admin wants to merge 2 commits intomasterfrom
auto/openapi-sync-C014-20260419-r33866
Closed

feat(gooddata-sdk): [AUTO] Add conversation responses list and feedback endpoints in gen-ai#1551
yenkins-admin wants to merge 2 commits intomasterfrom
auto/openapi-sync-C014-20260419-r33866

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Summary

Added SDK support for the two new gen-ai conversation response endpoints: GET conversation responses and PATCH response feedback. Created model classes (ConversationFeedback, ConversationTurnResponse, ConversationResponseList) in compute/model/ai_chat.py, added _do_get_request and _do_patch_request to GoodDataApiClient, added get_conversation_responses and set_conversation_response_feedback service methods to ComputeService, exported new classes from init.py, and added 12 unit tests covering all model serialization paths.

Impact: new_feature | Services: gen-ai
Tickets: GDAI-1448

Files changed

  • packages/gooddata-sdk/src/gooddata_sdk/compute/model/ai_chat.py
  • packages/gooddata-sdk/src/gooddata_sdk/client.py
  • packages/gooddata-sdk/src/gooddata_sdk/compute/service.py
  • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • packages/gooddata-sdk/tests/compute/test_ai_chat_models.py

Agent decisions

Decisions (4)

Model class location — compute/model/ai_chat.py — standalone attrs classes without Base

  • Alternatives: catalog/workspace/entity_model/ with Base class, Inline dicts returned directly from service methods
  • Why: These DTOs come from the gen-ai microservice action endpoints, not from the JSONAPI entity layer. Existing AI chat methods in ComputeService also don't wrap responses in Catalog* classes. Using compute/model/ matches the existing pattern for compute-adjacent models.

HTTP client methods — Added _do_get_request and _do_patch_request to GoodDataApiClient; also updated do_request to handle PATCH

  • Alternatives: Use requests directly in the service layer without client methods, Extend actions_api by monkey-patching
  • Why: The new endpoints (GET + PATCH) are not in the auto-generated API client. Mirroring the existing _do_post_request pattern keeps the client layer consistent. HttpMethod.PATCH was already defined but unsupported — wiring it in do_request is a natural extension.

ResponseFeedbackRequest body structure — Wrapped FeedbackDto in { 'feedback': {...} } envelope

  • Alternatives: Send FeedbackDto fields (type, text) directly at the top level
  • Why: The diff elides the full ResponseFeedbackRequest schema. A wrapper envelope is the most common pattern for PATCH request bodies, and it mirrors how ConversationTurnResponseDto contains a nested feedback field.

ConversationTurnResponse unused import fix — Ruff removed unused ConversationTurnResponse import from service.py automatically

  • Alternatives: Keep import for user convenience
  • Why: ConversationTurnResponse is only referenced via ConversationResponseList.from_api internally; no need to re-import it in the service layer. Ruff correctly identified and removed the redundant import.
Assumptions to verify (4)
  • ResponseFeedbackRequest body wraps FeedbackDto as { 'feedback': { 'type': ..., 'text': ... } } — actual schema was elided in the diff as '{ ... }'
  • ResponseFeedbackDto (also elided) is not needed for the SDK layer; only the request direction is relevant for the PATCH method
  • The gen-ai endpoints use the same hostname as the rest of the GoodData API, differing only in path (/api/v1/ai/... vs /api/v1/actions/...)
  • Bearer token auth is sufficient for these new endpoints (same as other do*_request methods)
Risks (2)
  • Integration test for set_conversation_response_feedback may fail if ResponseFeedbackRequest actually has a flat structure (type/text at top level) rather than a nested feedback object
  • get_conversation_responses may fail if the gen-ai service is not deployed at the same host/port as the main API in the test environment
Layers touched (4)
  • entity_model — New model classes for ConversationFeedback, ConversationTurnResponse, ConversationResponseList — not JSONAPI entities, so no Base class inheritance
    • packages/gooddata-sdk/src/gooddata_sdk/compute/model/ai_chat.py
  • public_api — Exported ConversationFeedback, ConversationTurnResponse, ConversationResponseList
    • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • converter — Added _do_get_request/_do_patch_request to client; added get_conversation_responses and set_conversation_response_feedback to ComputeService
    • packages/gooddata-sdk/src/gooddata_sdk/client.py
    • packages/gooddata-sdk/src/gooddata_sdk/compute/service.py
  • tests — 12 unit tests covering from_api, to_api_dict, and roundtrip for all three model classes
    • packages/gooddata-sdk/tests/compute/test_ai_chat_models.py

Source commits (gdc-nas)

  • e58ab04 Merge pull request #21392 from gooddata/js/GDAI-1448
OpenAPI diff
diff --git a/microservices/gen-ai/src/test/resources/openapi/open-api-spec.json b/microservices/gen-ai/src/test/resources/openapi/open-api-spec.json
@@ -261,6 +261,62 @@
+      "ConversationResponseListDto": {
+        "additionalProperties": false,
+        "properties": {
+          "responses": {
+            "description": "Conversation responses.",
+            "items": { "$ref": "#/components/schemas/ConversationTurnResponseDto" },
+            "title": "Responses",
+            "type": "array"
+          }
+        },
+        "required": ["responses"],
+        "title": "ConversationResponseListDto",
+        "type": "object"
+      },
+      "ConversationTurnResponseDto": {
+        "properties": {
+          "createdAt": { "description": "Response creation timestamp (ISO-8601 UTC).", "type": "string" },
+          "feedback": { "anyOf": [ { "$ref": "#/components/schemas/FeedbackDto" }, { "type": "null" } ] },
+          "responseId": { "description": "Response identifier.", "type": "string" },
+          "updatedAt": { "description": "Response update timestamp (ISO-8601 UTC).", "type": "string" }
+        },
+        "required": ["responseId", "createdAt", "updatedAt"],
+        "type": "object"
+      },
+      "FeedbackDto": {
+        "properties": {
+          "text": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Optional free-form feedback comment." },
+          "type": { "description": "Feedback type.", "enum": ["POSITIVE", "NEGATIVE"], "type": "string" }
+        },
+        "required": ["type"],
+        "type": "object"
+      },
+      "ResponseFeedbackDto": { ... },
+      "ResponseFeedbackRequest": { ... },
@@ -1598,6 +1722,126 @@
+    "/api/v1/ai/workspaces/{workspace_id}/chat/conversations/{conversation_id}/responses": {
+      "get": {
+        "operationId": "get_conversation_responses_api_v1_ai_workspaces__workspace_id__chat_conversations__conversation_id__responses_get",
+        "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConversationResponseListDto" } } }, "description": "Successful Response" } },
+        "summary": "Get Conversation Responses",
+        "tags": ["Responses"]
+      }
+    },
+    "/api/v1/ai/workspaces/{workspace_id}/chat/conversations/{conversation_id}/responses/{response_id}": {
+      "patch": {
+        "operationId": "patch_response_api_v1_ai_workspaces__workspace_id__chat_conversations__conversation_id__responses__response_id__patch",
+        "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponseFeedbackRequest" } } }, "required": true },
+        "responses": { "204": { "description": "Successful Response" } },
+        "summary": "Patch Response",
+        "tags": ["Responses"]
+      }
+    }

Workflow run


Generated by SDK OpenAPI Sync workflow

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

Codecov Report

❌ Patch coverage is 66.10169% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.61%. Comparing base (37d0593) to head (4a33a49).

Files with missing lines Patch % Lines
packages/gooddata-sdk/src/gooddata_sdk/client.py 15.38% 11 Missing ⚠️
...s/gooddata-sdk/src/gooddata_sdk/compute/service.py 25.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1551      +/-   ##
==========================================
- Coverage   78.66%   78.61%   -0.05%     
==========================================
  Files         230      231       +1     
  Lines       15405    15463      +58     
==========================================
+ Hits        12118    12157      +39     
- Misses       3287     3306      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The implement agent writes its message log to transcript-implement-C014.jsonl.
This file was accidentally committed by 'git add -A' in the deliver step of
sdk-py-openapi-sync.yml (gdc-nas).  The workflow has been patched to write
transcripts outside the sdk/ checkout so future auto-PRs won't contain them.
@tychtjan tychtjan closed this Apr 20, 2026
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.

2 participants