Skip to content

Instantly share code, notes, and snippets.

@tazarov
Last active August 6, 2023 08:29
Show Gist options
  • Save tazarov/c2e0f4952a881cc7a0fb01de982e8556 to your computer and use it in GitHub Desktop.
Save tazarov/c2e0f4952a881cc7a0fb01de982e8556 to your computer and use it in GitHub Desktop.
OpenAPI 3.0 spec for Chroma vector databaseThis could be useful in generating clients for chroma
openapi: 3.0.2
info:
title: FastAPI
version: 0.1.0
paths:
/api/v1:
get:
summary: Root
operationId: root
responses:
'200':
description: Successful Response
content:
application/json:
schema:
additionalProperties:
type: integer
type: object
title: Response Root Api V1 Get
/api/v1/reset:
post:
summary: Reset
operationId: reset
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: boolean
title: Response Reset Api V1 Reset Post
/api/v1/version:
get:
summary: Version
operationId: version
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: string
title: Response Version Api V1 Version Get
/api/v1/heartbeat:
get:
summary: Heartbeat
operationId: heartbeat
responses:
'200':
description: Successful Response
content:
application/json:
schema:
additionalProperties:
type: integer
type: object
title: Response Heartbeat Api V1 Heartbeat Get
/api/v1/collections:
get:
summary: List Collections
operationId: list_collections
responses:
'200':
description: Successful Response
content:
application/json:
schema:
items:
$ref: '#/components/schemas/Collection'
type: array
title: Response List Collections Api V1 Collections Get
post:
summary: Create Collection
operationId: create_collection
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCollection'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Collection'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/collections/{collection_id}/add:
post:
summary: Add
operationId: add
parameters:
- required: true
schema:
type: string
title: Collection Id
name: collection_id
in: path
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AddEmbedding'
required: true
responses:
'201':
description: Successful Response
content:
application/json:
schema:
type: boolean
title: Response Add Api V1 Collections Collection Id Add Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/collections/{collection_id}/update:
post:
summary: Update
operationId: update
parameters:
- required: true
schema:
type: string
title: Collection Id
name: collection_id
in: path
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateEmbedding'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: boolean
title: Response Update Api V1 Collections Collection Id Update Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/collections/{collection_id}/upsert:
post:
summary: Upsert
operationId: upsert
parameters:
- required: true
schema:
type: string
title: Collection Id
name: collection_id
in: path
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AddEmbedding'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: boolean
title: Response Upsert Api V1 Collections Collection Id Upsert Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/collections/{collection_id}/get:
post:
summary: Get
operationId: get
parameters:
- required: true
schema:
type: string
title: Collection Id
name: collection_id
in: path
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GetEmbedding'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/GetResult'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/collections/{collection_id}/delete:
post:
summary: Delete
operationId: delete
parameters:
- required: true
schema:
type: string
title: Collection Id
name: collection_id
in: path
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteEmbedding'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
items:
type: string
format: uuid
type: array
title: Response Delete Api V1 Collections Collection Id Delete Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/collections/{collection_id}/count:
get:
summary: Count
operationId: count
parameters:
- required: true
schema:
type: string
title: Collection Id
name: collection_id
in: path
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: integer
title: Response Count Api V1 Collections Collection Id Count Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/collections/{collection_id}/query:
post:
summary: Get Nearest Neighbors
operationId: get_nearest_neighbors
parameters:
- required: true
schema:
type: string
title: Collection Id
name: collection_id
in: path
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/QueryEmbedding'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/QueryResult'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/collections/{collection_name}:
get:
summary: Get Collection
operationId: get_collection
parameters:
- required: true
schema:
type: string
title: Collection Name
name: collection_name
in: path
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Collection'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
summary: Delete Collection
operationId: delete_collection
parameters:
- required: true
schema:
type: string
title: Collection Name
name: collection_name
in: path
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Collection'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/collections/{collection_id}:
put:
summary: Update Collection
operationId: update_collection
parameters:
- required: true
schema:
type: string
title: Collection Id
name: collection_id
in: path
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateCollection'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Collection'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
AddEmbedding:
properties:
metadatas:
items:
additionalProperties:
type: string
type: object
embeddings:
items:
items:
type: number
format: float
type: array
type: object
required:
- ids
title: AddEmbedding
Collection:
properties:
name:
type: string
id:
type: string
format: uuid
metadatas:
additionalProperties:
type: string
type: object
type: object
required:
- name
- id
title: Collection
CreateCollection:
properties:
metadata:
additionalProperties:
type: string
type: object
type: object
required:
- name
title: CreateCollection
DeleteEmbedding:
properties:
ids:
items:
type: string
type: array
where:
additionalProperties:
type: string
type: object
where_document:
additionalProperties:
type: string
type: object
type: object
title: DeleteEmbedding
GetEmbedding:
properties:
ids:
items:
type: string
type: array
limit:
type: integer
offset:
type: integer
sort:
type: string
where:
additionalProperties:
type: string
type: object
where_document:
additionalProperties:
type: string
type: object
type: object
title: GetEmbedding
GetResult:
properties:
ids:
items:
type: string
type: array
title: Ids
embeddings:
items:
anyOf:
- items:
type: number
type: array
- items:
type: integer
type: array
type: array
title: Embeddings
documents:
items:
type: string
type: array
title: Documents
metadatas:
items:
additionalProperties:
anyOf:
- type: string
- type: integer
- type: number
- type: boolean
type: object
type: array
title: Metadatas
type: object
required:
- ids
- embeddings
- documents
- metadatas
title: GetResult
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
QueryEmbedding:
properties:
where:
additionalProperties:
type: string
type: object
where_document:
additionalProperties:
type: string
type: object
query_embeddings:
items:
items:
type: number
format: float
type: array
type: array
n_results:
type: integer
include:
items:
type: string
type: array
type: object
required:
- query_embeddings
title: QueryEmbedding
QueryResult:
properties:
ids:
items:
items:
type: string
type: array
type: array
title: Ids
embeddings:
items:
items:
anyOf:
- items:
type: number
type: array
- items:
type: integer
type: array
type: array
type: array
title: Embeddings
documents:
items:
items:
type: string
type: array
type: array
title: Documents
metadatas:
items:
items:
additionalProperties:
anyOf:
- type: string
- type: integer
- type: number
- type: boolean
type: object
type: array
type: array
title: Metadatas
distances:
items:
items:
type: number
type: array
type: array
title: Distances
type: object
required:
- ids
- embeddings
- documents
- metadatas
- distances
title: QueryResult
UpdateCollection:
properties:
new_name:
type: string
new_metadata:
additionalProperties:
type: string
type: object
type: object
title: UpdateCollection
UpdateEmbedding:
properties:
metadatas:
items:
additionalProperties:
type: string
type: object
embeddings:
items:
items:
type: number
format: float
type: array
type: object
required:
- ids
title: UpdateEmbedding
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
type: object
required:
- loc
- msg
- type
title: ValidationError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment