Skip to content

Commit

Permalink
Added evaluate requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
edudouglas committed May 6, 2019
1 parent d19c590 commit 618a9c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bothub/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,11 @@ def evaluate(self, request, **kwargs):
detail=_('You need to have at least ' +
'one registered test phrase')) # pragma: no cover

if len(repository.intents) <= 1:
raise APIException(
detail=_('You need to have at least ' +
'two registered intents')) # pragma: no cover

request = Repository.request_nlp_evaluate( # pragma: no cover
user_authorization, serializer.data)
if request.status_code != status.HTTP_200_OK: # pragma: no cover
Expand Down

0 comments on commit 618a9c5

Please sign in to comment.