Skip to content

feat(gooddata-sdk): [AUTO] Add Anthropic provider config to LLM provider config#1615

Open
yenkins-admin wants to merge 3 commits into
masterfrom
auto/openapi-sync-C001-20260518-r23245
Open

feat(gooddata-sdk): [AUTO] Add Anthropic provider config to LLM provider config#1615
yenkins-admin wants to merge 3 commits into
masterfrom
auto/openapi-sync-C001-20260518-r23245

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Summary

Added Anthropic LLM provider config support: new CatalogAnthropicApiKeyAuth and CatalogAnthropicProviderConfig classes, updated _provider_config_from_api to dispatch on type='ANTHROPIC', exported both classes from gooddata_sdk.init, and added an integration test with VCR cassette.

Impact: new_feature | Services: gooddata-afm-client, gooddata-metadata-client

Source commits (gdc-nas):

  • 397ed1c by Jan Kadlec — Merge pull request #22516 from macekond/ome/dreamy-maxwell-20ee2d

Files changed

  • packages/gooddata-sdk/src/gooddata_sdk/catalog/organization/entity_model/llm_provider.py
  • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • packages/gooddata-sdk/tests/catalog/test_catalog_organization.py

Agent decisions

Decisions (4)

client_class() stand-in for CatalogAnthropicApiKeyAuth — Return OpenAiProviderAuth as the stand-in generated client class

  • Alternatives: Return NotImplemented (base class default), Create Anthropic models in gooddata-api-client (not allowed)
  • Why: AnthropicProviderAuth does not yet exist in the auto-generated gooddata-api-client. OpenAiProviderAuth has the same field shape (api_key + type=API_KEY). client_class() on nested auth objects is not invoked during normal document serialization (asdict recursion handles it), so this stand-in is safe and allows ty check to resolve a concrete type.

client_class() stand-in for CatalogAnthropicProviderConfig — Return OpenAIProviderConfig as the stand-in generated client class

  • Alternatives: Return NotImplemented (base class default), Create AnthropicProviderConfig in gooddata-api-client (not allowed)
  • Why: AnthropicProviderConfig does not yet exist in the auto-generated gooddata-api-client. Serialization of the full provider document goes through CatalogLlmProviderDocument.to_api() -> asdict(), so client_class() on the nested config is never called in normal usage. OpenAIProviderConfig is the closest structural analog and satisfies ty check.

Integration test placement — Added test_create_anthropic_llm_provider to existing test_catalog_organization.py

  • Alternatives: Create a new test_catalog_llm_provider.py file
  • Why: LLM providers are managed via CatalogOrganizationService. All other organization-domain entity tests (JWK, CSP directives, settings) live in test_catalog_organization.py, so adding the Anthropic LLM provider test there maintains co-location with its service layer.

Pre-existing ty check failures — Treat as pre-existing; no new errors introduced by this change

  • Alternatives: Fix pre-existing errors in execution.py and filter.py
  • Why: The 8 diagnostics reported by ty check (3x unresolved pyarrow import, 2x unused type-ignore in execution.py, 3x invalid-return-type in filter.py) are all in files that were not modified by this cluster. grep of ty output for llm_provider.py and init.py returns no errors.
Assumptions to verify (3)
  • The auto-generated gooddata-api-client will eventually be regenerated to include AnthropicApiKeyAuth, AnthropicProviderAuth, and AnthropicProviderConfig models; the stand-in client_class() references will then be updated.
  • The Anthropic provider baseUrl field defaults to 'https://api.anthropic.com' on the server side; the SDK passes it through as-is when provided.
  • API credentials (api_key) are write-only and not returned by the server, consistent with the behavior for OpenAI and Azure Foundry providers.
Risks (2)
  • client_class() for CatalogAnthropicApiKeyAuth and CatalogAnthropicProviderConfig returns stand-in types (OpenAiProviderAuth / OpenAIProviderConfig). If to_api() is called directly on these objects (rather than through CatalogLlmProviderDocument.to_api()), the resulting API model will carry OpenAI schema semantics, not Anthropic. This path is not exercised by the service layer.
  • Pre-existing ty check failures in execution.py (pyarrow unresolved import) and filter.py (EmptyValueHandling return type mismatch) cause ty check to exit 1. These are unrelated to this cluster's changes.
Layers touched (3)
  • entity_model — Added CatalogAnthropicApiKeyAuth, CatalogAnthropicAuth union, CatalogAnthropicProviderConfig, _anthropic_auth_from_api(), updated CatalogLlmProviderConfig union and _provider_config_from_api()
    • packages/gooddata-sdk/src/gooddata_sdk/catalog/organization/entity_model/llm_provider.py
  • public_api — Exported CatalogAnthropicApiKeyAuth and CatalogAnthropicProviderConfig in alphabetical order before existing CatalogAws* entries
    • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • tests — Added test_create_anthropic_llm_provider integration test with VCR cassette reference
    • packages/gooddata-sdk/tests/catalog/test_catalog_organization.py
OpenAPI diff
--- a/gooddata-afm-client.json
+++ b/gooddata-afm-client.json
@@ -785,6 +785,68 @@
+      "AnthropicApiKeyAuth": {
+        "allOf": [
+          {
+            "properties": {
+              "apiKey": {
+                "description": "Anthropic API key.",
+                "maxLength": 255,
+                "nullable": true,
+                "type": "string",
+                "writeOnly": true
+              },
+              "type": {
+                "description": "Authentication type.",
+                "enum": [ "API_KEY" ],
+                "type": "string"
+              }
+            },
+            "type": "object"
+          }
+        ],
+        "required": [ "type" ],
+        "type": "object"
+      },
+      "AnthropicProviderAuth": {
+        "description": "Authentication configuration.",
+        "oneOf": [ { "$ref": "#/components/schemas/AnthropicApiKeyAuth" } ],
+        "type": "object"
+      },
+      "AnthropicProviderConfig": {
+        "description": "Configuration for Anthropic provider.",
+        "properties": {
+          "auth": { "$ref": "#/components/schemas/AnthropicProviderAuth" },
+          "baseUrl": {
+            "default": "https://api.anthropic.com",
+            "description": "Custom base URL for the Anthropic API.",
+            "maxLength": 255,
+            "type": "string"
+          },
+          "type": {
+            "description": "Provider type.",
+            "enum": [ "ANTHROPIC" ],
+            "type": "string"
+          }
+        },
+        "required": [ "auth", "type" ],
+        "type": "object"
+      },
@@ -3749,6 +3842,9 @@
           "providerConfig": {
             "oneOf": [
               {
+                "$ref": "#/components/schemas/AnthropicProviderConfig"
+              },
+              {
                 "$ref": "#/components/schemas/AwsBedrockProviderConfig"
--- a/gooddata-metadata-client.json
+++ b/gooddata-metadata-client.json
@@ -554,6 +554,68 @@
+      "AnthropicApiKeyAuth": { ... },
+      "AnthropicProviderAuth": { ... },
+      "AnthropicProviderConfig": { ... },
@@ -17705,15 +18009,19 @@
                 "oneOf": [
                   {
-                    "$ref": "#/components/schemas/AwsBedrockProviderConfig"
+                    "$ref": "#/components/schemas/OpenAIProviderConfig"
                   },
                   {
+                    "$ref": "#/components/schemas/AwsBedrockProviderConfig"
+                  },
+                  {
+                    "$ref": "#/components/schemas/AnthropicProviderConfig"
                   }
-                ]
+                ],
+                "type": "object"

Workflow run


Generated by SDK OpenAPI Sync workflow

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