gws-modelarmor-sanitize-response

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

modelarmor +sanitize-response

modelarmor +sanitize-response

PREREQUISITE: Read
../gws-shared/SKILL.md
for auth, global flags, and security rules. If missing, run
gws generate-skills
to create it.
Sanitize a model response through a Model Armor template
前置要求: 请阅读
../gws-shared/SKILL.md
了解认证、全局标志和安全规则。如果该文件缺失,请运行
gws generate-skills
命令生成。
通过Model Armor模板清理模型响应内容

Usage

使用方法

bash
gws modelarmor +sanitize-response --template <NAME>
bash
gws modelarmor +sanitize-response --template <NAME>

Flags

标志参数

FlagRequiredDefaultDescription
--template
Full template resource name (projects/PROJECT/locations/LOCATION/templates/TEMPLATE)
--text
Text content to sanitize
--json
Full JSON request body (overrides --text)
标志是否必填默认值描述
--template
完整的模板资源名称(projects/PROJECT/locations/LOCATION/templates/TEMPLATE)
--text
需要清理的文本内容
--json
完整的JSON请求体(会覆盖--text参数)

Examples

示例

bash
gws modelarmor +sanitize-response --template projects/P/locations/L/templates/T --text 'model output'
model_cmd | gws modelarmor +sanitize-response --template ...
bash
gws modelarmor +sanitize-response --template projects/P/locations/L/templates/T --text 'model output'
model_cmd | gws modelarmor +sanitize-response --template ...

Tips

提示

  • Use for outbound safety (model -> user).
  • For inbound safety (user -> model), use +sanitize-prompt.
  • 用于输出内容安全防护(模型 -> 用户)。
  • 若要处理输入内容安全(用户 -> 模型),请使用+sanitize-prompt命令。

See Also

另请参阅

  • gws-shared — Global flags and auth
  • gws-modelarmor — All filter user-generated content for safety commands
  • gws-shared — 全局标志和认证相关内容
  • gws-modelarmor — 所有用于用户生成内容安全过滤的命令