IBM Watson Personality insight 演示编辑问题

IBM Watson Personality insight Demo Edit Issue

我最近下载了 IBM Watson personality insight demo (nodejs)。当我 运行 那个演示并试图分析任何已经在列表中的人时,它会抛出错误。 这是该演示

的 UI

我不知道它为什么要来。请相应地指导我。 这是一个错误

正如错误所说,您没有被授权。您需要创建一个个性洞察服务,并设置凭据。

您不能使用默认设置。

仔细检查您的 .env 文件。

IBM Cloud is migrating to token-based Identity and Access Management (IAM) authentication.

  • With some service instances, you authenticate to the API by using IAM. You can pass either a bearer token in an Authorization header or an API key. Tokens support authenticated requests without embedding service credentials in every call. API keys use basic authentication. Learn more about IAM.

  • If you pass in an API key, use apikey for the username and the value of the API key as the password.

  • In other instances, you authenticate by providing the username and password for the service instance. For more information, see Service credentials for Watson services.

To find out which authentication to use, view the service credentials by clicking the service instance on the Dashboard.

来源:apidocs/personality-insights

所以在您的 .env 文件中,服务凭证可以是

# service credentials 
PERSONALITY_INSIGHTS_USERNAME= <YOUR USERNAME>
PERSONALITY_INSIGHTS_PASSWORD= <YOUR PASSWORD>
PERSONALITY_INSIGHTS_URL=<SERVICE URL>

# service credentials 
PERSONALITY_INSIGHTS_IAM_APIKEY= <YOUR API KEY> 
PERSONALITY_INSIGHTS_URL= <SERVICE URL>