Skip to content

feat(gooddata-sdk): [AUTO] Add ToolCallEventResult schema and toolCallEvents to chat response#1556

Closed
yenkins-admin wants to merge 1 commit intomasterfrom
auto/openapi-sync-C008-20260419-r49222
Closed

feat(gooddata-sdk): [AUTO] Add ToolCallEventResult schema and toolCallEvents to chat response#1556
yenkins-admin wants to merge 1 commit intomasterfrom
auto/openapi-sync-C008-20260419-r49222

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Summary

Added ToolCallEventResult SDK wrapper class for the new ToolCallEventResult OpenAPI schema and the toolCallEvents array field added to ChatResult. The generated API client already contained both changes; the SDK wrapper was added in compute/model/chat.py and exported from gooddata_sdk/__init__.py. A unit test covering construction, from_dict/to_dict round-trip, and client_class() was added in tests/compute/test_chat_models.py.

Impact: new_feature | Services: gooddata-afm-client
Tickets: GDAI-1438

Files changed

  • packages/gooddata-sdk/src/gooddata_sdk/compute/model/chat.py
  • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • packages/gooddata-sdk/tests/compute/test_chat_models.py

Agent decisions

Decisions (3)

Class placement — Placed ToolCallEventResult in compute/model/chat.py (compute module, no Catalog prefix)

  • Alternatives: catalog//entity_model/ with Catalog prefix, Inline in compute/service.py
  • Why: The AI chat feature lives in compute/service.py. Existing compute model classes (Attribute, Metric, Filter) use no Catalog prefix. Placing it here keeps the domain consistent.

Naming to avoid collision with generated client — Import generated class as ApiToolCallEventResult alias, define SDK class as ToolCallEventResult

  • Alternatives: CatalogToolCallEventResult (Catalog prefix would be inconsistent with compute module), Re-export the generated class directly (no SDK wrapper)
  • Why: Gives users a clean SDK name (ToolCallEventResult) while avoiding confusion; the alias makes the generated-vs-SDK distinction explicit inside the module.

Wrapper vs. pass-through — Created a proper attrs wrapper class extending Base

  • Alternatives: Re-export generated ToolCallEventResult directly (no from_dict/to_dict), No wrapper at all
  • Why: Gives users from_dict/to_dict/to_api serialization support and a stable SDK type for type annotations. Other response types (ChatResult, SearchResult) are returned raw from service methods, but ToolCallEventResult is a new leaf schema that benefits from SDK ownership.
Assumptions to verify (3)
  • The generated API client (gooddata-api-client) already includes ToolCallEventResult and ChatResult.tool_call_events — confirmed by reading the files directly.
  • The Base.from_dict / to_dict serialization path works for ToolCallEventResult because the generated ApiToolCallEventResult has from_dict (it inherits from ModelNormal). This was not executable-verified due to missing urllib3 in the test environment.
  • All three fields (function_arguments, function_name, result) are non-optional (required in the OpenAPI spec), so they are declared as required positional attrs fields.
Risks (1)
  • The Base.to_dict() path calls self.client_class().from_dict(snake_case_dict, camel_case=False). If the generated ApiToolCallEventResult.from_dict does not accept camel_case=False cleanly for all three fields, the round-trip test will fail.
Layers touched (3)
  • entity_model — New ToolCallEventResult wrapper class in compute model layer
    • packages/gooddata-sdk/src/gooddata_sdk/compute/model/chat.py
  • public_api — Exported ToolCallEventResult from the public SDK surface
    • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • tests — Unit tests for ToolCallEventResult construction, round-trip serialization, and client_class()
    • packages/gooddata-sdk/tests/compute/test_chat_models.py

Source commits (gdc-nas)

  • 0e847c5 Merge pull request #21287 from gooddata/zovi/GDAI-1438-e2e-skill-tests
OpenAPI diff
diff --git a/microservices/afm-exec-api/src/test/resources/openapi/open-api-spec.json
@@ -1208,6 +1208,13 @@
           "threadIdSuffix" : { "description" : "Chat History thread suffix.", "type" : "string" },
+          "toolCallEvents" : {
+            "description" : "Tool call events emitted during the agentic loop (only present when GEN_AI_YIELD_TOOL_CALL_EVENTS is enabled).",
+            "items" : { "$ref" : "#/components/schemas/ToolCallEventResult" },
+            "type" : "array"
+          }
@@ -4485,6 +4492,25 @@
+      "ToolCallEventResult" : {
+        "description" : "Tool call events emitted during the agentic loop.",
+        "properties" : {
+          "functionArguments" : { "description" : "JSON-encoded arguments passed to the tool function.", "type" : "string" },
+          "functionName" : { "description" : "Name of the tool function that was called.", "type" : "string" },
+          "result" : { "description" : "Result returned by the tool function.", "type" : "string" }
+        },
+        "required" : [ "functionArguments", "functionName", "result" ],
+        "type" : "object"
+      },

Workflow run


Generated by SDK OpenAPI Sync workflow

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.68%. Comparing base (37d0593) to head (3cdaea7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1556      +/-   ##
==========================================
+ Coverage   78.66%   78.68%   +0.02%     
==========================================
  Files         230      231       +1     
  Lines       15405    15421      +16     
==========================================
+ Hits        12118    12134      +16     
  Misses       3287     3287              

☔ 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.

@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