4017 lines
107 KiB
YAML
4017 lines
107 KiB
YAML
components:
|
|
schemas:
|
|
AgentChat:
|
|
properties:
|
|
content:
|
|
title: Content
|
|
type: string
|
|
required:
|
|
- content
|
|
title: AgentChat
|
|
type: object
|
|
AgentQuery:
|
|
properties:
|
|
queries:
|
|
anyOf:
|
|
- type: string
|
|
- items:
|
|
type: string
|
|
type: array
|
|
title: Queries
|
|
required:
|
|
- queries
|
|
title: AgentQuery
|
|
type: object
|
|
App:
|
|
exclude:
|
|
- h_metadata
|
|
- public_id
|
|
properties:
|
|
created_at:
|
|
format: date-time
|
|
title: Created At
|
|
type: string
|
|
id:
|
|
title: Id
|
|
type: string
|
|
metadata:
|
|
additionalProperties: true
|
|
title: Metadata
|
|
type: object
|
|
name:
|
|
title: Name
|
|
type: string
|
|
required:
|
|
- id
|
|
- name
|
|
- metadata
|
|
- created_at
|
|
title: App
|
|
type: object
|
|
AppCreate:
|
|
properties:
|
|
metadata:
|
|
additionalProperties: true
|
|
default: {}
|
|
title: Metadata
|
|
type: object
|
|
name:
|
|
title: Name
|
|
type: string
|
|
required:
|
|
- name
|
|
title: AppCreate
|
|
type: object
|
|
AppUpdate:
|
|
properties:
|
|
metadata:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Metadata
|
|
name:
|
|
anyOf:
|
|
- type: string
|
|
- type: 'null'
|
|
title: Name
|
|
title: AppUpdate
|
|
type: object
|
|
Collection:
|
|
exclude:
|
|
- h_metadata
|
|
- public_id
|
|
properties:
|
|
created_at:
|
|
format: date-time
|
|
title: Created At
|
|
type: string
|
|
id:
|
|
title: Id
|
|
type: string
|
|
metadata:
|
|
additionalProperties: true
|
|
title: Metadata
|
|
type: object
|
|
name:
|
|
title: Name
|
|
type: string
|
|
user_id:
|
|
title: User Id
|
|
type: string
|
|
required:
|
|
- id
|
|
- name
|
|
- user_id
|
|
- metadata
|
|
- created_at
|
|
title: Collection
|
|
type: object
|
|
CollectionCreate:
|
|
properties:
|
|
metadata:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
default: {}
|
|
title: Metadata
|
|
name:
|
|
title: Name
|
|
type: string
|
|
required:
|
|
- name
|
|
title: CollectionCreate
|
|
type: object
|
|
CollectionGet:
|
|
properties:
|
|
filter:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Filter
|
|
title: CollectionGet
|
|
type: object
|
|
CollectionUpdate:
|
|
properties:
|
|
metadata:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Metadata
|
|
name:
|
|
anyOf:
|
|
- type: string
|
|
- type: 'null'
|
|
title: Name
|
|
title: CollectionUpdate
|
|
type: object
|
|
Document:
|
|
exclude:
|
|
- h_metadata
|
|
- public_id
|
|
properties:
|
|
collection_id:
|
|
title: Collection Id
|
|
type: string
|
|
content:
|
|
title: Content
|
|
type: string
|
|
created_at:
|
|
format: date-time
|
|
title: Created At
|
|
type: string
|
|
id:
|
|
title: Id
|
|
type: string
|
|
metadata:
|
|
additionalProperties: true
|
|
title: Metadata
|
|
type: object
|
|
required:
|
|
- id
|
|
- content
|
|
- metadata
|
|
- created_at
|
|
- collection_id
|
|
title: Document
|
|
type: object
|
|
DocumentCreate:
|
|
properties:
|
|
content:
|
|
title: Content
|
|
type: string
|
|
metadata:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
default: {}
|
|
title: Metadata
|
|
required:
|
|
- content
|
|
title: DocumentCreate
|
|
type: object
|
|
DocumentGet:
|
|
properties:
|
|
filter:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Filter
|
|
title: DocumentGet
|
|
type: object
|
|
DocumentQuery:
|
|
properties:
|
|
filter:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Filter
|
|
query:
|
|
title: Query
|
|
type: string
|
|
top_k:
|
|
default: 5
|
|
title: Top K
|
|
type: integer
|
|
required:
|
|
- query
|
|
title: DocumentQuery
|
|
type: object
|
|
DocumentUpdate:
|
|
properties:
|
|
content:
|
|
anyOf:
|
|
- type: string
|
|
- type: 'null'
|
|
title: Content
|
|
metadata:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Metadata
|
|
title: DocumentUpdate
|
|
type: object
|
|
HTTPValidationError:
|
|
properties:
|
|
detail:
|
|
items:
|
|
$ref: '#/components/schemas/ValidationError'
|
|
title: Detail
|
|
type: array
|
|
title: HTTPValidationError
|
|
type: object
|
|
Message:
|
|
exclude:
|
|
- h_metadata
|
|
- public_id
|
|
properties:
|
|
content:
|
|
title: Content
|
|
type: string
|
|
created_at:
|
|
format: date-time
|
|
title: Created At
|
|
type: string
|
|
id:
|
|
title: Id
|
|
type: string
|
|
is_user:
|
|
title: Is User
|
|
type: boolean
|
|
metadata:
|
|
additionalProperties: true
|
|
title: Metadata
|
|
type: object
|
|
session_id:
|
|
title: Session Id
|
|
type: string
|
|
required:
|
|
- id
|
|
- content
|
|
- is_user
|
|
- session_id
|
|
- metadata
|
|
- created_at
|
|
title: Message
|
|
type: object
|
|
MessageCreate:
|
|
properties:
|
|
content:
|
|
title: Content
|
|
type: string
|
|
is_user:
|
|
title: Is User
|
|
type: boolean
|
|
metadata:
|
|
additionalProperties: true
|
|
default: {}
|
|
title: Metadata
|
|
type: object
|
|
required:
|
|
- content
|
|
- is_user
|
|
title: MessageCreate
|
|
type: object
|
|
MessageGet:
|
|
properties:
|
|
filter:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Filter
|
|
title: MessageGet
|
|
type: object
|
|
MessageUpdate:
|
|
properties:
|
|
metadata:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Metadata
|
|
title: MessageUpdate
|
|
type: object
|
|
Metamessage:
|
|
exclude:
|
|
- h_metadata
|
|
- public_id
|
|
properties:
|
|
content:
|
|
title: Content
|
|
type: string
|
|
created_at:
|
|
format: date-time
|
|
title: Created At
|
|
type: string
|
|
id:
|
|
title: Id
|
|
type: string
|
|
message_id:
|
|
title: Message Id
|
|
type: string
|
|
metadata:
|
|
additionalProperties: true
|
|
title: Metadata
|
|
type: object
|
|
metamessage_type:
|
|
title: Metamessage Type
|
|
type: string
|
|
required:
|
|
- id
|
|
- metamessage_type
|
|
- content
|
|
- message_id
|
|
- metadata
|
|
- created_at
|
|
title: Metamessage
|
|
type: object
|
|
MetamessageCreate:
|
|
properties:
|
|
content:
|
|
title: Content
|
|
type: string
|
|
message_id:
|
|
title: Message Id
|
|
type: string
|
|
metadata:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
default: {}
|
|
title: Metadata
|
|
metamessage_type:
|
|
title: Metamessage Type
|
|
type: string
|
|
required:
|
|
- metamessage_type
|
|
- content
|
|
- message_id
|
|
title: MetamessageCreate
|
|
type: object
|
|
MetamessageGet:
|
|
properties:
|
|
filter:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Filter
|
|
message_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: 'null'
|
|
title: Message Id
|
|
metamessage_type:
|
|
anyOf:
|
|
- type: string
|
|
- type: 'null'
|
|
title: Metamessage Type
|
|
title: MetamessageGet
|
|
type: object
|
|
MetamessageGetUserLevel:
|
|
properties:
|
|
filter:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Filter
|
|
metamessage_type:
|
|
anyOf:
|
|
- type: string
|
|
- type: 'null'
|
|
title: Metamessage Type
|
|
title: MetamessageGetUserLevel
|
|
type: object
|
|
MetamessageUpdate:
|
|
properties:
|
|
message_id:
|
|
title: Message Id
|
|
type: string
|
|
metadata:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Metadata
|
|
metamessage_type:
|
|
anyOf:
|
|
- type: string
|
|
- type: 'null'
|
|
title: Metamessage Type
|
|
required:
|
|
- message_id
|
|
title: MetamessageUpdate
|
|
type: object
|
|
Page_Collection_:
|
|
properties:
|
|
items:
|
|
items:
|
|
$ref: '#/components/schemas/Collection'
|
|
title: Items
|
|
type: array
|
|
page:
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
pages:
|
|
minimum: 0
|
|
title: Pages
|
|
type: integer
|
|
size:
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
total:
|
|
minimum: 0
|
|
title: Total
|
|
type: integer
|
|
required:
|
|
- items
|
|
- total
|
|
- page
|
|
- size
|
|
title: Page[Collection]
|
|
type: object
|
|
Page_Document_:
|
|
properties:
|
|
items:
|
|
items:
|
|
$ref: '#/components/schemas/Document'
|
|
title: Items
|
|
type: array
|
|
page:
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
pages:
|
|
minimum: 0
|
|
title: Pages
|
|
type: integer
|
|
size:
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
total:
|
|
minimum: 0
|
|
title: Total
|
|
type: integer
|
|
required:
|
|
- items
|
|
- total
|
|
- page
|
|
- size
|
|
title: Page[Document]
|
|
type: object
|
|
Page_Message_:
|
|
properties:
|
|
items:
|
|
items:
|
|
$ref: '#/components/schemas/Message'
|
|
title: Items
|
|
type: array
|
|
page:
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
pages:
|
|
minimum: 0
|
|
title: Pages
|
|
type: integer
|
|
size:
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
total:
|
|
minimum: 0
|
|
title: Total
|
|
type: integer
|
|
required:
|
|
- items
|
|
- total
|
|
- page
|
|
- size
|
|
title: Page[Message]
|
|
type: object
|
|
Page_Metamessage_:
|
|
properties:
|
|
items:
|
|
items:
|
|
$ref: '#/components/schemas/Metamessage'
|
|
title: Items
|
|
type: array
|
|
page:
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
pages:
|
|
minimum: 0
|
|
title: Pages
|
|
type: integer
|
|
size:
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
total:
|
|
minimum: 0
|
|
title: Total
|
|
type: integer
|
|
required:
|
|
- items
|
|
- total
|
|
- page
|
|
- size
|
|
title: Page[Metamessage]
|
|
type: object
|
|
Page_Session_:
|
|
properties:
|
|
items:
|
|
items:
|
|
$ref: '#/components/schemas/Session'
|
|
title: Items
|
|
type: array
|
|
page:
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
pages:
|
|
minimum: 0
|
|
title: Pages
|
|
type: integer
|
|
size:
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
total:
|
|
minimum: 0
|
|
title: Total
|
|
type: integer
|
|
required:
|
|
- items
|
|
- total
|
|
- page
|
|
- size
|
|
title: Page[Session]
|
|
type: object
|
|
Page_User_:
|
|
properties:
|
|
items:
|
|
items:
|
|
$ref: '#/components/schemas/User'
|
|
title: Items
|
|
type: array
|
|
page:
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
pages:
|
|
minimum: 0
|
|
title: Pages
|
|
type: integer
|
|
size:
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
total:
|
|
minimum: 0
|
|
title: Total
|
|
type: integer
|
|
required:
|
|
- items
|
|
- total
|
|
- page
|
|
- size
|
|
title: Page[User]
|
|
type: object
|
|
Session:
|
|
exclude:
|
|
- h_metadata
|
|
- public_id
|
|
properties:
|
|
created_at:
|
|
format: date-time
|
|
title: Created At
|
|
type: string
|
|
id:
|
|
title: Id
|
|
type: string
|
|
is_active:
|
|
title: Is Active
|
|
type: boolean
|
|
metadata:
|
|
additionalProperties: true
|
|
title: Metadata
|
|
type: object
|
|
user_id:
|
|
title: User Id
|
|
type: string
|
|
required:
|
|
- id
|
|
- is_active
|
|
- user_id
|
|
- metadata
|
|
- created_at
|
|
title: Session
|
|
type: object
|
|
SessionCreate:
|
|
properties:
|
|
metadata:
|
|
additionalProperties: true
|
|
default: {}
|
|
title: Metadata
|
|
type: object
|
|
title: SessionCreate
|
|
type: object
|
|
SessionGet:
|
|
properties:
|
|
filter:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Filter
|
|
is_active:
|
|
default: false
|
|
title: Is Active
|
|
type: boolean
|
|
title: SessionGet
|
|
type: object
|
|
SessionUpdate:
|
|
properties:
|
|
metadata:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Metadata
|
|
title: SessionUpdate
|
|
type: object
|
|
User:
|
|
exclude:
|
|
- h_metadata
|
|
- public_id
|
|
properties:
|
|
app_id:
|
|
title: App Id
|
|
type: string
|
|
created_at:
|
|
format: date-time
|
|
title: Created At
|
|
type: string
|
|
id:
|
|
title: Id
|
|
type: string
|
|
metadata:
|
|
additionalProperties: true
|
|
title: Metadata
|
|
type: object
|
|
name:
|
|
title: Name
|
|
type: string
|
|
required:
|
|
- id
|
|
- name
|
|
- app_id
|
|
- created_at
|
|
- metadata
|
|
title: User
|
|
type: object
|
|
UserCreate:
|
|
properties:
|
|
metadata:
|
|
additionalProperties: true
|
|
default: {}
|
|
title: Metadata
|
|
type: object
|
|
name:
|
|
title: Name
|
|
type: string
|
|
required:
|
|
- name
|
|
title: UserCreate
|
|
type: object
|
|
UserGet:
|
|
properties:
|
|
filter:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Filter
|
|
title: UserGet
|
|
type: object
|
|
UserUpdate:
|
|
properties:
|
|
metadata:
|
|
anyOf:
|
|
- additionalProperties: true
|
|
type: object
|
|
- type: 'null'
|
|
title: Metadata
|
|
name:
|
|
anyOf:
|
|
- type: string
|
|
- type: 'null'
|
|
title: Name
|
|
title: UserUpdate
|
|
type: object
|
|
ValidationError:
|
|
properties:
|
|
loc:
|
|
items:
|
|
anyOf:
|
|
- type: string
|
|
- type: integer
|
|
title: Location
|
|
type: array
|
|
msg:
|
|
title: Message
|
|
type: string
|
|
type:
|
|
title: Error Type
|
|
type: string
|
|
required:
|
|
- loc
|
|
- msg
|
|
- type
|
|
title: ValidationError
|
|
type: object
|
|
securitySchemes:
|
|
HTTPBearer:
|
|
scheme: bearer
|
|
type: http
|
|
info:
|
|
contact:
|
|
email: hello@plasticlabs.ai
|
|
name: Plastic Labs
|
|
url: https://plasticlabs.ai/
|
|
description: |-
|
|
This API is used to store data and get insights about users for AI
|
|
applications
|
|
summary: An API for adding personalization to AI Apps
|
|
title: Honcho API
|
|
version: 0.0.14
|
|
openapi: 3.1.0
|
|
paths:
|
|
/v1/apps:
|
|
post:
|
|
description: Create a new App
|
|
operationId: create_app_v1_apps_post
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/AppCreate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/App'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Create App
|
|
tags:
|
|
- apps
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const app = await client.apps.create({ name: 'name' });
|
|
|
|
console.log(app.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
app = client.apps.create(
|
|
name="name",
|
|
)
|
|
print(app.id)
|
|
/v1/apps/get_or_create/{name}:
|
|
get:
|
|
description: Get or Create an App
|
|
operationId: get_or_create_app_v1_apps_get_or_create__name__get
|
|
parameters:
|
|
- in: path
|
|
name: name
|
|
required: true
|
|
schema:
|
|
title: Name
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/App'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Or Create App
|
|
tags:
|
|
- apps
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const app = await client.apps.getOrCreate('name');
|
|
|
|
console.log(app.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
app = client.apps.get_or_create(
|
|
"name",
|
|
)
|
|
print(app.id)
|
|
/v1/apps/name/{name}:
|
|
get:
|
|
description: Get an App by Name
|
|
operationId: get_app_by_name_v1_apps_name__name__get
|
|
parameters:
|
|
- in: path
|
|
name: name
|
|
required: true
|
|
schema:
|
|
title: Name
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/App'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get App By Name
|
|
tags:
|
|
- apps
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const app = await client.apps.getByName('name');
|
|
|
|
console.log(app.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
app = client.apps.get_by_name(
|
|
"name",
|
|
)
|
|
print(app.id)
|
|
/v1/apps/{app_id}:
|
|
get:
|
|
description: Get an App by ID
|
|
operationId: get_app_v1_apps__app_id__get
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/App'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get App
|
|
tags:
|
|
- apps
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const app = await client.apps.get('app_id');
|
|
|
|
console.log(app.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
app = client.apps.get(
|
|
"app_id",
|
|
)
|
|
print(app.id)
|
|
put:
|
|
description: Update an App
|
|
operationId: update_app_v1_apps__app_id__put
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/AppUpdate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/App'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Update App
|
|
tags:
|
|
- apps
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const app = await client.apps.update('app_id');
|
|
|
|
console.log(app.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
app = client.apps.update(
|
|
app_id="app_id",
|
|
)
|
|
print(app.id)
|
|
/v1/apps/{app_id}/users:
|
|
post:
|
|
description: Create a new User
|
|
operationId: create_user_v1_apps__app_id__users_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UserCreate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Create User
|
|
tags:
|
|
- users
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const user = await client.apps.users.create('app_id', { name: 'name' });
|
|
|
|
console.log(user.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
user = client.apps.users.create(
|
|
app_id="app_id",
|
|
name="name",
|
|
)
|
|
print(user.id)
|
|
/v1/apps/{app_id}/users/get_or_create/{name}:
|
|
get:
|
|
description: Get a User or create a new one by the input name
|
|
operationId: get_or_create_user_v1_apps__app_id__users_get_or_create__name__get
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: name
|
|
required: true
|
|
schema:
|
|
title: Name
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Or Create User
|
|
tags:
|
|
- users
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const user = await client.apps.users.getOrCreate('app_id', 'name');
|
|
|
|
console.log(user.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
user = client.apps.users.get_or_create(
|
|
name="name",
|
|
app_id="app_id",
|
|
)
|
|
print(user.id)
|
|
/v1/apps/{app_id}/users/list:
|
|
post:
|
|
description: Get All Users for an App
|
|
operationId: get_users_v1_apps__app_id__users_list_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: query
|
|
name: reverse
|
|
required: false
|
|
schema:
|
|
default: false
|
|
title: Reverse
|
|
type: boolean
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
required: false
|
|
schema:
|
|
default: 1
|
|
description: Page number
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: size
|
|
required: false
|
|
schema:
|
|
default: 50
|
|
description: Page size
|
|
maximum: 100
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UserGet'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Page_User_'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Users
|
|
tags:
|
|
- users
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
// Automatically fetches more pages as needed.
|
|
for await (const user of client.apps.users.list('app_id')) {
|
|
console.log(user.id);
|
|
}
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
page = client.apps.users.list(
|
|
app_id="app_id",
|
|
)
|
|
page = page.items[0]
|
|
print(page.id)
|
|
/v1/apps/{app_id}/users/name/{name}:
|
|
get:
|
|
description: Get a User by name
|
|
operationId: get_user_by_name_v1_apps__app_id__users_name__name__get
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: name
|
|
required: true
|
|
schema:
|
|
title: Name
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get User By Name
|
|
tags:
|
|
- users
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const user = await client.apps.users.getByName('app_id', 'name');
|
|
|
|
console.log(user.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
user = client.apps.users.get_by_name(
|
|
name="name",
|
|
app_id="app_id",
|
|
)
|
|
print(user.id)
|
|
/v1/apps/{app_id}/users/{user_id}:
|
|
get:
|
|
description: Get a User by ID
|
|
operationId: get_user_v1_apps__app_id__users__user_id__get
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get User
|
|
tags:
|
|
- users
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const user = await client.apps.users.get('app_id', 'user_id');
|
|
|
|
console.log(user.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
user = client.apps.users.get(
|
|
user_id="user_id",
|
|
app_id="app_id",
|
|
)
|
|
print(user.id)
|
|
put:
|
|
description: Update a User's name and/or metadata
|
|
operationId: update_user_v1_apps__app_id__users__user_id__put
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UserUpdate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Update User
|
|
tags:
|
|
- users
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const user = await client.apps.users.update('app_id', 'user_id');
|
|
|
|
console.log(user.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
user = client.apps.users.update(
|
|
user_id="user_id",
|
|
app_id="app_id",
|
|
)
|
|
print(user.id)
|
|
/v1/apps/{app_id}/users/{user_id}/collections:
|
|
post:
|
|
description: Create a new Collection
|
|
operationId: create_collection_v1_apps__app_id__users__user_id__collections_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/CollectionCreate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Collection'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Create Collection
|
|
tags:
|
|
- collections
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const collection = await client.apps.users.collections.create('app_id', 'user_id', { name: 'name' });
|
|
|
|
console.log(collection.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
collection = client.apps.users.collections.create(
|
|
user_id="user_id",
|
|
app_id="app_id",
|
|
name="name",
|
|
)
|
|
print(collection.id)
|
|
/v1/apps/{app_id}/users/{user_id}/collections/list:
|
|
post:
|
|
description: Get All Collections for a User
|
|
operationId: get_collections_v1_apps__app_id__users__user_id__collections_list_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: query
|
|
name: reverse
|
|
required: false
|
|
schema:
|
|
anyOf:
|
|
- type: boolean
|
|
- type: 'null'
|
|
default: false
|
|
title: Reverse
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
required: false
|
|
schema:
|
|
default: 1
|
|
description: Page number
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: size
|
|
required: false
|
|
schema:
|
|
default: 50
|
|
description: Page size
|
|
maximum: 100
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/CollectionGet'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Page_Collection_'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Collections
|
|
tags:
|
|
- collections
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
// Automatically fetches more pages as needed.
|
|
for await (const collection of client.apps.users.collections.list('app_id', 'user_id')) {
|
|
console.log(collection.id);
|
|
}
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
page = client.apps.users.collections.list(
|
|
user_id="user_id",
|
|
app_id="app_id",
|
|
)
|
|
page = page.items[0]
|
|
print(page.id)
|
|
/v1/apps/{app_id}/users/{user_id}/collections/name/{name}:
|
|
get:
|
|
description: Get a Collection by Name
|
|
operationId: get_collection_by_name_v1_apps__app_id__users__user_id__collections_name__name__get
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: name
|
|
required: true
|
|
schema:
|
|
title: Name
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Collection'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Collection By Name
|
|
tags:
|
|
- collections
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const collection = await client.apps.users.collections.getByName('app_id', 'user_id', 'name');
|
|
|
|
console.log(collection.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
collection = client.apps.users.collections.get_by_name(
|
|
name="name",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
)
|
|
print(collection.id)
|
|
/v1/apps/{app_id}/users/{user_id}/collections/{collection_id}:
|
|
delete:
|
|
description: Delete a Collection and its documents
|
|
operationId: delete_collection_v1_apps__app_id__users__user_id__collections__collection_id__delete
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: collection_id
|
|
required: true
|
|
schema:
|
|
title: Collection Id
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema: {}
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Delete Collection
|
|
tags:
|
|
- collections
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const collection = await client.apps.users.collections.delete('app_id', 'user_id', 'collection_id');
|
|
|
|
console.log(collection);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
collection = client.apps.users.collections.delete(
|
|
collection_id="collection_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
)
|
|
print(collection)
|
|
get:
|
|
description: Get a Collection by ID
|
|
operationId: get_collection_by_id_v1_apps__app_id__users__user_id__collections__collection_id__get
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: collection_id
|
|
required: true
|
|
schema:
|
|
title: Collection Id
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Collection'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Collection By Id
|
|
tags:
|
|
- collections
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const collection = await client.apps.users.collections.get('app_id', 'user_id', 'collection_id');
|
|
|
|
console.log(collection.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
collection = client.apps.users.collections.get(
|
|
collection_id="collection_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
)
|
|
print(collection.id)
|
|
put:
|
|
description: Update a Collection's name or metadata
|
|
operationId: update_collection_v1_apps__app_id__users__user_id__collections__collection_id__put
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: collection_id
|
|
required: true
|
|
schema:
|
|
title: Collection Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/CollectionUpdate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Collection'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Update Collection
|
|
tags:
|
|
- collections
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const collection = await client.apps.users.collections.update('app_id', 'user_id', 'collection_id');
|
|
|
|
console.log(collection.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
collection = client.apps.users.collections.update(
|
|
collection_id="collection_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
)
|
|
print(collection.id)
|
|
/v1/apps/{app_id}/users/{user_id}/collections/{collection_id}/documents:
|
|
post:
|
|
description: Embed text as a vector and create a Document
|
|
operationId: create_document_v1_apps__app_id__users__user_id__collections__collection_id__documents_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: collection_id
|
|
required: true
|
|
schema:
|
|
title: Collection Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/DocumentCreate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Document'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Create Document
|
|
tags:
|
|
- documents
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const document = await client.apps.users.collections.documents.create(
|
|
'app_id',
|
|
'user_id',
|
|
'collection_id',
|
|
{ content: 'content' },
|
|
);
|
|
|
|
console.log(document.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
document = client.apps.users.collections.documents.create(
|
|
collection_id="collection_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
content="content",
|
|
)
|
|
print(document.id)
|
|
/v1/apps/{app_id}/users/{user_id}/collections/{collection_id}/documents/list:
|
|
post:
|
|
description: Get all of the Documents in a Collection
|
|
operationId: get_documents_v1_apps__app_id__users__user_id__collections__collection_id__documents_list_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: collection_id
|
|
required: true
|
|
schema:
|
|
title: Collection Id
|
|
type: string
|
|
- in: query
|
|
name: reverse
|
|
required: false
|
|
schema:
|
|
anyOf:
|
|
- type: boolean
|
|
- type: 'null'
|
|
default: false
|
|
title: Reverse
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
required: false
|
|
schema:
|
|
default: 1
|
|
description: Page number
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: size
|
|
required: false
|
|
schema:
|
|
default: 50
|
|
description: Page size
|
|
maximum: 100
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/DocumentGet'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Page_Document_'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Documents
|
|
tags:
|
|
- documents
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
// Automatically fetches more pages as needed.
|
|
for await (const document of client.apps.users.collections.documents.list(
|
|
'app_id',
|
|
'user_id',
|
|
'collection_id',
|
|
)) {
|
|
console.log(document.id);
|
|
}
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
page = client.apps.users.collections.documents.list(
|
|
collection_id="collection_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
)
|
|
page = page.items[0]
|
|
print(page.id)
|
|
/v1/apps/{app_id}/users/{user_id}/collections/{collection_id}/documents/query:
|
|
post:
|
|
description: Cosine Similarity Search for Documents
|
|
operationId: query_documents_v1_apps__app_id__users__user_id__collections__collection_id__documents_query_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: collection_id
|
|
required: true
|
|
schema:
|
|
title: Collection Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/DocumentQuery'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
items:
|
|
$ref: '#/components/schemas/Document'
|
|
title: >-
|
|
Response Query Documents V1 Apps App Id Users User Id Collections Collection Id
|
|
Documents Query Post
|
|
type: array
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Query Documents
|
|
tags:
|
|
- documents
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const documents = await client.apps.users.collections.documents.query(
|
|
'app_id',
|
|
'user_id',
|
|
'collection_id',
|
|
{ query: 'query' },
|
|
);
|
|
|
|
console.log(documents);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
documents = client.apps.users.collections.documents.query(
|
|
collection_id="collection_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
query="query",
|
|
)
|
|
print(documents)
|
|
/v1/apps/{app_id}/users/{user_id}/collections/{collection_id}/documents/{document_id}:
|
|
delete:
|
|
description: Delete a Document by ID
|
|
operationId: >-
|
|
delete_document_v1_apps__app_id__users__user_id__collections__collection_id__documents__document_id__delete
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: collection_id
|
|
required: true
|
|
schema:
|
|
title: Collection Id
|
|
type: string
|
|
- in: path
|
|
name: document_id
|
|
required: true
|
|
schema:
|
|
title: Document Id
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema: {}
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Delete Document
|
|
tags:
|
|
- documents
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const document = await client.apps.users.collections.documents.delete(
|
|
'app_id',
|
|
'user_id',
|
|
'collection_id',
|
|
'document_id',
|
|
);
|
|
|
|
console.log(document);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
document = client.apps.users.collections.documents.delete(
|
|
document_id="document_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
collection_id="collection_id",
|
|
)
|
|
print(document)
|
|
get:
|
|
description: Get a document by ID
|
|
operationId: get_document_v1_apps__app_id__users__user_id__collections__collection_id__documents__document_id__get
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: collection_id
|
|
required: true
|
|
schema:
|
|
title: Collection Id
|
|
type: string
|
|
- in: path
|
|
name: document_id
|
|
required: true
|
|
schema:
|
|
title: Document Id
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Document'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Document
|
|
tags:
|
|
- documents
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const document = await client.apps.users.collections.documents.get(
|
|
'app_id',
|
|
'user_id',
|
|
'collection_id',
|
|
'document_id',
|
|
);
|
|
|
|
console.log(document.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
document = client.apps.users.collections.documents.get(
|
|
document_id="document_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
collection_id="collection_id",
|
|
)
|
|
print(document.id)
|
|
put:
|
|
description: Update the content and/or the metadata of a Document
|
|
operationId: >-
|
|
update_document_v1_apps__app_id__users__user_id__collections__collection_id__documents__document_id__put
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: collection_id
|
|
required: true
|
|
schema:
|
|
title: Collection Id
|
|
type: string
|
|
- in: path
|
|
name: document_id
|
|
required: true
|
|
schema:
|
|
title: Document Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/DocumentUpdate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Document'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Update Document
|
|
tags:
|
|
- documents
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const document = await client.apps.users.collections.documents.update(
|
|
'app_id',
|
|
'user_id',
|
|
'collection_id',
|
|
'document_id',
|
|
);
|
|
|
|
console.log(document.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
document = client.apps.users.collections.documents.update(
|
|
document_id="document_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
collection_id="collection_id",
|
|
)
|
|
print(document.id)
|
|
/v1/apps/{app_id}/users/{user_id}/metamessages/list:
|
|
post:
|
|
description: Paginate through the user metamessages for a user
|
|
operationId: get_metamessages_by_user_v1_apps__app_id__users__user_id__metamessages_list_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: query
|
|
name: reverse
|
|
required: false
|
|
schema:
|
|
anyOf:
|
|
- type: boolean
|
|
- type: 'null'
|
|
default: false
|
|
title: Reverse
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
required: false
|
|
schema:
|
|
default: 1
|
|
description: Page number
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: size
|
|
required: false
|
|
schema:
|
|
default: 50
|
|
description: Page size
|
|
maximum: 100
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/MetamessageGetUserLevel'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Page_Metamessage_'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Metamessages By User
|
|
tags:
|
|
- metamessages
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
// Automatically fetches more pages as needed.
|
|
for await (const metamessage of client.apps.users.metamessages.list('app_id', 'user_id')) {
|
|
console.log(metamessage.id);
|
|
}
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
page = client.apps.users.metamessages.list(
|
|
user_id="user_id",
|
|
app_id="app_id",
|
|
)
|
|
page = page.items[0]
|
|
print(page.id)
|
|
/v1/apps/{app_id}/users/{user_id}/sessions:
|
|
post:
|
|
description: Create a Session for a User
|
|
operationId: create_session_v1_apps__app_id__users__user_id__sessions_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SessionCreate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Session'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Create Session
|
|
tags:
|
|
- sessions
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const session = await client.apps.users.sessions.create('app_id', 'user_id');
|
|
|
|
console.log(session.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
session = client.apps.users.sessions.create(
|
|
user_id="user_id",
|
|
app_id="app_id",
|
|
)
|
|
print(session.id)
|
|
/v1/apps/{app_id}/users/{user_id}/sessions/list:
|
|
post:
|
|
description: Get All Sessions for a User
|
|
operationId: get_sessions_v1_apps__app_id__users__user_id__sessions_list_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: query
|
|
name: reverse
|
|
required: false
|
|
schema:
|
|
anyOf:
|
|
- type: boolean
|
|
- type: 'null'
|
|
default: false
|
|
title: Reverse
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
required: false
|
|
schema:
|
|
default: 1
|
|
description: Page number
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: size
|
|
required: false
|
|
schema:
|
|
default: 50
|
|
description: Page size
|
|
maximum: 100
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SessionGet'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Page_Session_'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Sessions
|
|
tags:
|
|
- sessions
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
// Automatically fetches more pages as needed.
|
|
for await (const session of client.apps.users.sessions.list('app_id', 'user_id')) {
|
|
console.log(session.id);
|
|
}
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
page = client.apps.users.sessions.list(
|
|
user_id="user_id",
|
|
app_id="app_id",
|
|
)
|
|
page = page.items[0]
|
|
print(page.id)
|
|
/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}:
|
|
delete:
|
|
description: Delete a session by marking it as inactive
|
|
operationId: delete_session_v1_apps__app_id__users__user_id__sessions__session_id__delete
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema: {}
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Delete Session
|
|
tags:
|
|
- sessions
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const session = await client.apps.users.sessions.delete('app_id', 'user_id', 'session_id');
|
|
|
|
console.log(session);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
session = client.apps.users.sessions.delete(
|
|
session_id="session_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
)
|
|
print(session)
|
|
get:
|
|
description: Get a specific session for a user by ID
|
|
operationId: get_session_v1_apps__app_id__users__user_id__sessions__session_id__get
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Session'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Session
|
|
tags:
|
|
- sessions
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const session = await client.apps.users.sessions.get('app_id', 'user_id', 'session_id');
|
|
|
|
console.log(session.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
session = client.apps.users.sessions.get(
|
|
session_id="session_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
)
|
|
print(session.id)
|
|
put:
|
|
description: Update the metadata of a Session
|
|
operationId: update_session_v1_apps__app_id__users__user_id__sessions__session_id__put
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SessionUpdate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Session'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Update Session
|
|
tags:
|
|
- sessions
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const session = await client.apps.users.sessions.update('app_id', 'user_id', 'session_id');
|
|
|
|
console.log(session.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
session = client.apps.users.sessions.update(
|
|
session_id="session_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
)
|
|
print(session.id)
|
|
/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/chat:
|
|
post:
|
|
description: Chat with the Dialectic API
|
|
operationId: chat_v1_apps__app_id__users__user_id__sessions__session_id__chat_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/AgentQuery'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/AgentChat'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Chat
|
|
tags:
|
|
- sessions
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const agentChat = await client.apps.users.sessions.chat('app_id', 'user_id', 'session_id', {
|
|
queries: 'string',
|
|
});
|
|
|
|
console.log(agentChat.content);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
agent_chat = client.apps.users.sessions.chat(
|
|
session_id="session_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
queries="string",
|
|
)
|
|
print(agent_chat.content)
|
|
/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/chat/stream:
|
|
post:
|
|
description: Stream Results from the Dialectic API
|
|
operationId: get_chat_stream_v1_apps__app_id__users__user_id__sessions__session_id__chat_stream_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/AgentQuery'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema: {}
|
|
text/event-stream:
|
|
schema:
|
|
format: binary
|
|
type: string
|
|
description: Chat stream
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Chat Stream
|
|
tags:
|
|
- sessions
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const response = await client.apps.users.sessions.stream('app_id', 'user_id', 'session_id', {
|
|
queries: 'string',
|
|
});
|
|
|
|
console.log(response);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
response = client.apps.users.sessions.stream(
|
|
session_id="session_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
queries="string",
|
|
)
|
|
print(response)
|
|
/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/clone:
|
|
get:
|
|
description: Clone a session for a user, optionally will deep clone metamessages as well
|
|
operationId: clone_session_v1_apps__app_id__users__user_id__sessions__session_id__clone_get
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
- in: query
|
|
name: message_id
|
|
required: false
|
|
schema:
|
|
anyOf:
|
|
- type: string
|
|
- type: 'null'
|
|
title: Message Id
|
|
- in: query
|
|
name: deep_copy
|
|
required: false
|
|
schema:
|
|
default: false
|
|
title: Deep Copy
|
|
type: boolean
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Session'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Clone Session
|
|
tags:
|
|
- sessions
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const session = await client.apps.users.sessions.clone('app_id', 'user_id', 'session_id');
|
|
|
|
console.log(session.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
session = client.apps.users.sessions.clone(
|
|
session_id="session_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
)
|
|
print(session.id)
|
|
/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/messages:
|
|
post:
|
|
description: Adds a message to a session
|
|
operationId: create_message_for_session_v1_apps__app_id__users__user_id__sessions__session_id__messages_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/MessageCreate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Message'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Create Message For Session
|
|
tags:
|
|
- messages
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const message = await client.apps.users.sessions.messages.create('app_id', 'user_id', 'session_id', {
|
|
content: 'content',
|
|
is_user: true,
|
|
});
|
|
|
|
console.log(message.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
message = client.apps.users.sessions.messages.create(
|
|
session_id="session_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
content="content",
|
|
is_user=True,
|
|
)
|
|
print(message.id)
|
|
/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/messages/list:
|
|
post:
|
|
description: Get all messages for a session
|
|
operationId: get_messages_v1_apps__app_id__users__user_id__sessions__session_id__messages_list_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
- in: query
|
|
name: reverse
|
|
required: false
|
|
schema:
|
|
anyOf:
|
|
- type: boolean
|
|
- type: 'null'
|
|
default: false
|
|
title: Reverse
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
required: false
|
|
schema:
|
|
default: 1
|
|
description: Page number
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: size
|
|
required: false
|
|
schema:
|
|
default: 50
|
|
description: Page size
|
|
maximum: 100
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/MessageGet'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Page_Message_'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Messages
|
|
tags:
|
|
- messages
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
// Automatically fetches more pages as needed.
|
|
for await (const message of client.apps.users.sessions.messages.list('app_id', 'user_id', 'session_id')) {
|
|
console.log(message.id);
|
|
}
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
page = client.apps.users.sessions.messages.list(
|
|
session_id="session_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
)
|
|
page = page.items[0]
|
|
print(page.id)
|
|
/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/messages/{message_id}:
|
|
get:
|
|
description: Get a Message by ID
|
|
operationId: get_message_v1_apps__app_id__users__user_id__sessions__session_id__messages__message_id__get
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
- in: path
|
|
name: message_id
|
|
required: true
|
|
schema:
|
|
title: Message Id
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Message'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Message
|
|
tags:
|
|
- messages
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const message = await client.apps.users.sessions.messages.get(
|
|
'app_id',
|
|
'user_id',
|
|
'session_id',
|
|
'message_id',
|
|
);
|
|
|
|
console.log(message.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
message = client.apps.users.sessions.messages.get(
|
|
message_id="message_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
session_id="session_id",
|
|
)
|
|
print(message.id)
|
|
put:
|
|
description: Update the metadata of a Message
|
|
operationId: update_message_v1_apps__app_id__users__user_id__sessions__session_id__messages__message_id__put
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
- in: path
|
|
name: message_id
|
|
required: true
|
|
schema:
|
|
title: Message Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/MessageUpdate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Message'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Update Message
|
|
tags:
|
|
- messages
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const message = await client.apps.users.sessions.messages.update(
|
|
'app_id',
|
|
'user_id',
|
|
'session_id',
|
|
'message_id',
|
|
);
|
|
|
|
console.log(message.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
message = client.apps.users.sessions.messages.update(
|
|
message_id="message_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
session_id="session_id",
|
|
)
|
|
print(message.id)
|
|
/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/metamessages:
|
|
post:
|
|
description: Adds a message to a session
|
|
operationId: create_metamessage_v1_apps__app_id__users__user_id__sessions__session_id__metamessages_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/MetamessageCreate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Metamessage'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Create Metamessage
|
|
tags:
|
|
- metamessages
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const metamessage = await client.apps.users.sessions.metamessages.create(
|
|
'app_id',
|
|
'user_id',
|
|
'session_id',
|
|
{ content: 'content', message_id: 'message_id', metamessage_type: 'metamessage_type' },
|
|
);
|
|
|
|
console.log(metamessage.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
metamessage = client.apps.users.sessions.metamessages.create(
|
|
session_id="session_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
content="content",
|
|
message_id="message_id",
|
|
metamessage_type="metamessage_type",
|
|
)
|
|
print(metamessage.id)
|
|
/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/metamessages/list:
|
|
post:
|
|
description: Get all messages for a session
|
|
operationId: get_metamessages_v1_apps__app_id__users__user_id__sessions__session_id__metamessages_list_post
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
- in: query
|
|
name: reverse
|
|
required: false
|
|
schema:
|
|
anyOf:
|
|
- type: boolean
|
|
- type: 'null'
|
|
default: false
|
|
title: Reverse
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
required: false
|
|
schema:
|
|
default: 1
|
|
description: Page number
|
|
minimum: 1
|
|
title: Page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: size
|
|
required: false
|
|
schema:
|
|
default: 50
|
|
description: Page size
|
|
maximum: 100
|
|
minimum: 1
|
|
title: Size
|
|
type: integer
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/MetamessageGet'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Page_Metamessage_'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Metamessages
|
|
tags:
|
|
- metamessages
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
// Automatically fetches more pages as needed.
|
|
for await (const metamessage of client.apps.users.sessions.metamessages.list(
|
|
'app_id',
|
|
'user_id',
|
|
'session_id',
|
|
)) {
|
|
console.log(metamessage.id);
|
|
}
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
page = client.apps.users.sessions.metamessages.list(
|
|
session_id="session_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
)
|
|
page = page.items[0]
|
|
print(page.id)
|
|
/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/metamessages/{metamessage_id}:
|
|
get:
|
|
description: Get a specific Metamessage by ID
|
|
operationId: >-
|
|
get_metamessage_v1_apps__app_id__users__user_id__sessions__session_id__metamessages__metamessage_id__get
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
- in: path
|
|
name: metamessage_id
|
|
required: true
|
|
schema:
|
|
title: Metamessage Id
|
|
type: string
|
|
- in: query
|
|
name: message_id
|
|
required: true
|
|
schema:
|
|
title: Message Id
|
|
type: string
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Metamessage'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Get Metamessage
|
|
tags:
|
|
- metamessages
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const metamessage = await client.apps.users.sessions.metamessages.get(
|
|
'app_id',
|
|
'user_id',
|
|
'session_id',
|
|
'metamessage_id',
|
|
{ message_id: 'message_id' },
|
|
);
|
|
|
|
console.log(metamessage.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
metamessage = client.apps.users.sessions.metamessages.get(
|
|
metamessage_id="metamessage_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
session_id="session_id",
|
|
message_id="message_id",
|
|
)
|
|
print(metamessage.id)
|
|
put:
|
|
description: Update's the metadata of a metamessage
|
|
operationId: >-
|
|
update_metamessage_v1_apps__app_id__users__user_id__sessions__session_id__metamessages__metamessage_id__put
|
|
parameters:
|
|
- in: path
|
|
name: app_id
|
|
required: true
|
|
schema:
|
|
title: App Id
|
|
type: string
|
|
- in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
title: User Id
|
|
type: string
|
|
- in: path
|
|
name: session_id
|
|
required: true
|
|
schema:
|
|
title: Session Id
|
|
type: string
|
|
- in: path
|
|
name: metamessage_id
|
|
required: true
|
|
schema:
|
|
title: Metamessage Id
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/MetamessageUpdate'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Metamessage'
|
|
description: Successful Response
|
|
'422':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/HTTPValidationError'
|
|
description: Validation Error
|
|
security:
|
|
- HTTPBearer: []
|
|
- {}
|
|
summary: Update Metamessage
|
|
tags:
|
|
- metamessages
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
source: |-
|
|
import Honcho from 'honcho-ai';
|
|
|
|
const client = new Honcho({
|
|
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
|
|
});
|
|
|
|
async function main() {
|
|
const metamessage = await client.apps.users.sessions.metamessages.update(
|
|
'app_id',
|
|
'user_id',
|
|
'session_id',
|
|
'metamessage_id',
|
|
{ message_id: 'message_id' },
|
|
);
|
|
|
|
console.log(metamessage.id);
|
|
}
|
|
|
|
main();
|
|
- lang: Python
|
|
source: |-
|
|
import os
|
|
from honcho import Honcho
|
|
|
|
client = Honcho(
|
|
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
|
|
)
|
|
metamessage = client.apps.users.sessions.metamessages.update(
|
|
metamessage_id="metamessage_id",
|
|
app_id="app_id",
|
|
user_id="user_id",
|
|
session_id="session_id",
|
|
message_id="message_id",
|
|
)
|
|
print(metamessage.id)
|
|
servers:
|
|
- description: Local Development Server
|
|
url: http://127.0.0.1:8000
|
|
- description: Demo Server
|
|
url: https:/demo.honcho.dev
|