Browse Source

fix: number variable cause type error in openai moderation (#5222)

tags/0.6.11
rerorero 1 year ago
parent
commit
c6b791d070
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      api/core/moderation/openai_moderation/openai_moderation.py

+ 1
- 1
api/core/moderation/openai_moderation/openai_moderation.py View File

return ModerationOutputsResult(flagged=flagged, action=ModerationAction.DIRECT_OUTPUT, preset_response=preset_response) return ModerationOutputsResult(flagged=flagged, action=ModerationAction.DIRECT_OUTPUT, preset_response=preset_response)


def _is_violated(self, inputs: dict): def _is_violated(self, inputs: dict):
text = '\n'.join(inputs.values())
text = '\n'.join(str(inputs.values()))
model_manager = ModelManager() model_manager = ModelManager()
model_instance = model_manager.get_model_instance( model_instance = model_manager.get_model_instance(
tenant_id=self.tenant_id, tenant_id=self.tenant_id,

Loading…
Cancel
Save