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

feat: PPT-568 Added Controller for ChatBot #364

Merged
merged 6 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
343 changes: 343 additions & 0 deletions OPENAPI_DOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10776,6 +10776,312 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ContentError'
/api/engine/v2/chatgpt:
get:
summary: list user chats
tags:
- ChatGPT
operationId: PlaceOS::Api::ChatGPT_index
parameters:
- name: q
in: query
description: returns results based on a [simple query string](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html)
required: false
schema:
type: string
- name: limit
in: query
description: the maximum number of results to return
example: "10000"
required: false
schema:
type: integer
format: UInt32
- name: offset
in: query
description: deprecated, the starting offset of the result set. Used to implement
pagination
required: false
schema:
type: integer
format: UInt32
- name: ref
in: query
description: a token for accessing the next page of results, provided in the
`Link` header
required: false
schema:
type: string
nullable: true
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PlaceOS__Model__Chat'
409:
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
401:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
403:
description: Forbidden
404:
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
408:
description: Request Timeout
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ParameterError'
422:
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ParameterError'
406:
description: Not Acceptable
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ContentError'
415:
description: Unsupported Media Type
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ContentError'
/api/engine/v2/chatgpt/{id}:
get:
summary: show user chat history
tags:
- ChatGPT
operationId: PlaceOS::Api::ChatGPT_show
parameters:
- name: id
in: path
description: return the chat messages associated with this chat id
example: chats-xxxx
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/NamedTuple_role__String__content__String___Nil__timestamp__Time_'
409:
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
401:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
403:
description: Forbidden
404:
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
408:
description: Request Timeout
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ParameterError'
422:
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ParameterError'
406:
description: Not Acceptable
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ContentError'
415:
description: Unsupported Media Type
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ContentError'
delete:
summary: remove chat and associated history
tags:
- ChatGPT
operationId: PlaceOS::Api::ChatGPT_destroy
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
202:
description: Accepted
409:
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
401:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
403:
description: Forbidden
404:
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
408:
description: Request Timeout
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ParameterError'
422:
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ParameterError'
406:
description: Not Acceptable
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ContentError'
415:
description: Unsupported Media Type
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ContentError'
/api/engine/v2/chatgpt/chat/{system_id}:
get:
summary: the websocket endpoint for ChatGPT chatbot
tags:
- ChatGPT
operationId: PlaceOS::Api::ChatGPT_chat
parameters:
- name: system_id
in: path
required: true
schema:
type: string
- name: resume
in: query
description: To resume previous chat session. Provide session chat id
example: chats-xxxx
required: false
schema:
type: string
nullable: true
responses:
101:
description: Switching Protocols
409:
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
401:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
403:
description: Forbidden
404:
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
408:
description: Request Timeout
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ParameterError'
422:
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ParameterError'
406:
description: Not Acceptable
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ContentError'
415:
description: Unsupported Media Type
content:
application/json:
schema:
$ref: '#/components/schemas/PlaceOS__Api__Application__ContentError'
/api/engine/v2/repositories:
get:
summary: lists the repositories added to the system
Expand Down Expand Up @@ -21111,6 +21417,43 @@ components:
type: integer
format: Int64
nullable: true
PlaceOS__Model__Chat:
type: object
properties:
created_at:
type: integer
format: Int64
nullable: true
updated_at:
type: integer
format: Int64
nullable: true
summary:
type: string
nullable: true
user_id:
type: string
nullable: true
system_id:
type: string
nullable: true
id:
type: string
nullable: true
NamedTuple_role__String__content__String___Nil__timestamp__Time_:
type: object
properties:
role:
type: string
content:
type: string
nullable: true
timestamp:
type: string
format: date-time
required:
- role
- timestamp
PlaceOS__Model__Repository:
type: object
properties:
Expand Down
10 changes: 7 additions & 3 deletions shard.lock
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ shards:
git: https://github.com/elbywan/open_api.cr.git
version: 1.3.0

openai:
git: https://github.com/spider-gazelle/crystal-openai.git
version: 0.9.0+git.commit.e6bfaba7758f992d7cb81cad0109180d5be2d958

openapi-generator:
git: https://github.com/place-labs/openapi-generator.git
version: 2.1.0+git.commit.a65ffc2f7dcc6a393e7d1f9229650b520d9525be
Expand Down Expand Up @@ -251,7 +255,7 @@ shards:

placeos-driver:
git: https://github.com/placeos/driver.git
version: 6.9.4
version: 6.9.9

placeos-frontend-loader:
git: https://github.com/placeos/frontend-loader.git
Expand All @@ -263,7 +267,7 @@ shards:

placeos-models:
git: https://github.com/placeos/models.git
version: 9.24.1
version: 9.25.0

placeos-resource:
git: https://github.com/place-labs/resource.git
Expand Down Expand Up @@ -311,7 +315,7 @@ shards:

search-ingest:
git: https://github.com/placeos/search-ingest.git
version: 2.10.3+git.commit.218c93b0077be2c3bfbe272f5ee11d6fb6b7fef1
version: 2.10.4+git.commit.ad86e414f43fa5debb28192b0a01c7d3f655ce28

secrets-env: # Overridden
git: https://github.com/spider-gazelle/secrets-env.git
Expand Down
Loading
Loading