Skip to content

Commit

Permalink
Add swagger doc (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredfrancis authored Oct 29, 2022
1 parent 3e4d537 commit 1a9e408
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 49 deletions.
49 changes: 0 additions & 49 deletions app/endpoint/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,55 +24,6 @@ def api():
"""
Endpoint to Converse with the Chatbot.
Chat context is maintained by exchanging the payload between client and bot.
---
definitions:
currentNode:
type: string
complete:
type: boolean
context:
type: object
properties:
parameters:
type: array
items:
type: object
properties:
name:
type: string
type:
type: string
required:
type: boolean
extractedParameters:
type: object
properties:
country:
type: string
speechResponse:
type: array
items:
type: string
intent:
type: object
properties:
object_id:
type: string
confidence:
type: number
id:
type: string
input:
type: string
missingParameters:
type: array
items:
owner:
type: string
date:
type: string
:param json:
:return json:
"""
Expand Down
86 changes: 86 additions & 0 deletions swagger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
openapi: 3.0.3
info:
title: AI Chatbot Framework
description: |-
This is the conversational API for AI Chatbot Framework
version: 1.0.11
externalDocs:
description: Find out more about AI Chatbot Framework
url: https://github.com/alfredfrancis/ai-chatbot-framework/
servers:
- url: http://localhost:8080/api
paths:
/v1:
post:
summary: Call the converse API to chat with the bot
operationId: converse
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Converse'
required: true
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Converse'
'400':
description: Invalid input
components:
schemas:
Converse:
type: object
properties:
currentNode:
type: string
example: ask_name
complete:
type: boolean
example: false
context:
type: object
parameters:
type: array
items:
type: object
properties:
name:
type: string
example: full_name
type:
type: string
example: name
required:
type: boolean
example: true
extractedParameters:
type: object
example: {"country":"india"}
speechResponse:
type: array
items:
example: "Please enter your name"
type: string
intent:
type: object
properties:
object_id:
example: "88ea1ef0-5782-11ed-9b6a-0242ac120002"
type: string
confidence:
type: number
example: 1
id:
type: string
example: "ask_name"
input:
type: string
example: "My name is Alfred"
missingParameters:
type: array
items:
type: string
example: phone

0 comments on commit 1a9e408

Please sign in to comment.