google-sentiment-check

command module
v0.0.0-...-8835833 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README


{ "image": "direktiv/google-sentiment-check", "desc": "Reads a string and tells you the sentiment of the written text." }

Google Sentiment Check

Reads a string and tells you the sentiment of the written text.

Direktiv

An example workflow of reading the sentiment of a text message.

id: read-message
functions:
- id: read
  image: direktiv/google-sentiment-check:v1
states:
- id: readmsg
  type: action
  action:
    function: read
    input: jq(.)

Input

The input required to run the above workflow properly is the following:

input:
  message: "Hello World!"
  serviceAccountKey: jq(.secrets.SERVICE_ACCOUNT_KEY)

Output

If the action is successful the following output will be returned.

{
    "feeling": "Positive",
    "score": 0.6,
    "magnitude": 3.0,   
}

Error

In the case that an error is encountered, it will present in the following format:

{
    "errorCode": "com.google-sentiment-check.error",
    "errorMsg": "Something went wrong"
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL