feat: flagRiskTerms + detection-settings types (2.31.0) - #38
Merged
Conversation
…-settings types (2.31.0) The API added options.flag_risk_terms + default_flag_risk_terms alongside flag_profanity (PR #149), and default_flag_profanity/default_flag_risk_terms on GET/PUT /settings/detection, but neither reached the SDK's types or request-building. A customer trying to turn on profanity/risk-term detection through DetectionSettings had no typed way to set or verify either default.
3 tasks
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.
Summary
flagRiskTermstodetectBullying/detectUnsafe/analyze()andrisk_termstoBullyingResult/UnsafeResult, mirroring the already-shippedflagProfanity/profanitypair. Server support has existed since PR #149; the SDK never got it.default_flag_profanity/default_flag_risk_termstoDetectionSettings/UpdateDetectionSettingsInput. Both already round-trip through the untypedrequestWithRetrypassthrough — this is a types-only fix, no behavior change.Root cause of a real customer report: a user tried to enable profanity detection via the account-level setting and had no typed way to set it, or confirm it took, through the SDK (which is what the MCP server builds on).
Test plan
npm test— 143/143 passing (16 new:tests/flagRiskTerms.test.ts,tests/detectionSettings.test.ts)npx tsc --noEmitcleannpm run buildclean