Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Categorize API v1 #3

Open
1 of 2 tasks
godgunman opened this issue May 22, 2020 · 0 comments
Open
1 of 2 tasks

Categorize API v1 #3

godgunman opened this issue May 22, 2020 · 0 comments
Assignees

Comments

@godgunman
Copy link
Member

godgunman commented May 22, 2020

  • implementation
  • test

Request

POST /v1/categorize/

{
    "content": "sample",
    "useModel": "mode-id-a",
    "source": "LINE",
    "callback": "https://myapp.io/callback",
}

useModel 是的 "realTime": false 的 model 的話,使用者必須提供 callback 參數,否則回傳參數錯誤。

Response

For none callback

{
  "result": {
    "prediction": {
      "confidence": {
        "c1": 0.5,
        "c2": 0.5
      }
    },
    "time": 15000
  }
}

For callback (ack)

{
  "result": {
      "pending": true
  }
}

For error

{
    "error": {
        "message": "ooo error",
        "code": 500
    }
}
@godgunman godgunman changed the title Categorize API v2 Categorize API v1 May 22, 2020
@darkbtf darkbtf self-assigned this Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants