Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

AnalyzeComment object not working? #175

@corbolt

Description

@corbolt

Hi,

I tried to call analyze() with an AnalyzeComment object instead of the variant analyze(text, { options }).

The request looked like this:

analyze({ comment: { text }, languages: ['en'], requestedAttributes: { 'TOXICITY': { scoreThreshold: 0.6 }, 'IDENTITY_ATTACK': { scoreThreshold: 0.6 }, 'INSULT': { scoreThreshold: 0.7 } } });

Here I don't get a complete response from the API:

What I get as a response is the following:

{ languages: [ 'en' ], detectedLanguages: [ 'ro', 'en' ] }

The attributeScores are missing here. What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions