4427 lines
141 KiB
JSON
4427 lines
141 KiB
JSON
{
|
|
"openapi": "3.1.0",
|
|
"info": {
|
|
"title": "Honcho API",
|
|
"summary": "An API for adding personalization to AI Apps",
|
|
"description": "This API is used to store data and get insights about users for AI\n applications",
|
|
"version": "0.1.0"
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "http://127.0.0.1:8000",
|
|
"description": "Local Development Server"
|
|
},
|
|
{
|
|
"url": "https:/demo.honcho.dev",
|
|
"description": "Demo Server"
|
|
}
|
|
],
|
|
"paths": {
|
|
"/apps/{app_id}": {
|
|
"get": {
|
|
"tags": [
|
|
"apps"
|
|
],
|
|
"summary": "Get App",
|
|
"description": "Get an App by ID\n\nArgs:\n app_id (uuid.UUID): The ID of the app\n\nReturns:\n schemas.App: App object",
|
|
"operationId": "get_app_apps__app_id__get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/App"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const app = await honcho.apps.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\n console.log(app.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\napp = client.apps.get(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(app.id)"
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": [
|
|
"apps"
|
|
],
|
|
"summary": "Update App",
|
|
"description": "Update an App\n\nArgs:\n app_id (uuid.UUID): The ID of the app to update\n app (schemas.AppUpdate): The App object containing any new metadata\n\nReturns:\n schemas.App: The App object of the updated App",
|
|
"operationId": "update_app_apps__app_id__put",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AppUpdate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/App"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const app = await honcho.apps.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\n console.log(app.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\napp = client.apps.update(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(app.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/name/{name}": {
|
|
"get": {
|
|
"tags": [
|
|
"apps"
|
|
],
|
|
"summary": "Get App By Name",
|
|
"description": "Get an App by Name\n\nArgs:\n app_name (str): The name of the app\n\nReturns:\n schemas.App: App object",
|
|
"operationId": "get_app_by_name_apps_name__name__get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"title": "Name"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/App"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const app = await honcho.apps.getByName('string');\n\n console.log(app.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\napp = client.apps.get_by_name(\n \"string\",\n)\nprint(app.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps": {
|
|
"post": {
|
|
"tags": [
|
|
"apps"
|
|
],
|
|
"summary": "Create App",
|
|
"description": "Create an App\n\nArgs:\n app (schemas.AppCreate): The App object containing any metadata\n\nReturns:\n schemas.App: Created App object",
|
|
"operationId": "create_app_apps_post",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AppCreate"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/App"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const app = await honcho.apps.create({ name: 'string' });\n\n console.log(app.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\napp = client.apps.create(\n name=\"string\",\n)\nprint(app.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/get_or_create/{name}": {
|
|
"get": {
|
|
"tags": [
|
|
"apps"
|
|
],
|
|
"summary": "Get Or Create App",
|
|
"description": "Get or Create an App\n\nArgs:\n app_name (str): The name of the app\n\nReturns:\n schemas.App: App object",
|
|
"operationId": "get_or_create_app_apps_get_or_create__name__get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"title": "Name"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/App"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const app = await honcho.apps.getOrCreate('string');\n\n console.log(app.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\napp = client.apps.get_or_create(\n \"string\",\n)\nprint(app.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users": {
|
|
"post": {
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "Create User",
|
|
"description": "Create a User\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user (schemas.UserCreate): The User object containing any metadata\n\nReturns:\n schemas.User: Created User object",
|
|
"operationId": "create_user_apps__app_id__users_post",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/UserCreate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const user = await honcho.apps.users.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { name: 'string' });\n\n console.log(user.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nuser = client.apps.users.create(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n name=\"string\",\n)\nprint(user.id)"
|
|
}
|
|
]
|
|
},
|
|
"get": {
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "Get Users",
|
|
"description": "Get All Users for an App\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client\n application using honcho\n\nReturns:\n list[schemas.User]: List of User objects",
|
|
"operationId": "get_users_apps__app_id__users_get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "reverse",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"title": "Reverse"
|
|
}
|
|
},
|
|
{
|
|
"name": "filter",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Filter"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"description": "Page number",
|
|
"default": 1,
|
|
"title": "Page"
|
|
},
|
|
"description": "Page number"
|
|
},
|
|
{
|
|
"name": "size",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"description": "Page size",
|
|
"default": 50,
|
|
"title": "Size"
|
|
},
|
|
"description": "Page size"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Page_User_"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const user of honcho.apps.users.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(user.id);\n }\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\npage = client.apps.users.list(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nuser = page.items[0]\nprint(user.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/name/{name}": {
|
|
"get": {
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "Get User By Name",
|
|
"description": "Get a User\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n\nReturns:\n schemas.User: User object",
|
|
"operationId": "get_user_by_name_apps__app_id__users_name__name__get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"title": "Name"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const user = await honcho.apps.users.getByName('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', 'string');\n\n console.log(user.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nuser = client.apps.users.get_by_name(\n \"string\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(user.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}": {
|
|
"get": {
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "Get User",
|
|
"description": "Get a User\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n\nReturns:\n schemas.User: User object",
|
|
"operationId": "get_user_apps__app_id__users__user_id__get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const user = await honcho.apps.users.get(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n );\n\n console.log(user.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nuser = client.apps.users.get(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(user.id)"
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "Update User",
|
|
"description": "Update a User\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n user (schemas.UserCreate): The User object containing any metadata\n\nReturns:\n schemas.User: Updated User object",
|
|
"operationId": "update_user_apps__app_id__users__user_id__put",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/UserUpdate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const user = await honcho.apps.users.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n );\n\n console.log(user.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nuser = client.apps.users.update(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(user.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/get_or_create/{name}": {
|
|
"get": {
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "Get Or Create User",
|
|
"description": "Get or Create a User\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n\nReturns:\n schemas.User: User object",
|
|
"operationId": "get_or_create_user_apps__app_id__users_get_or_create__name__get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"title": "Name"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const user = await honcho.apps.users.getOrCreate('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', 'string');\n\n console.log(user.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nuser = client.apps.users.get_or_create(\n \"string\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(user.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/sessions": {
|
|
"get": {
|
|
"tags": [
|
|
"sessions"
|
|
],
|
|
"summary": "Get Sessions",
|
|
"description": "Get All Sessions for a User\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (uuid.UUID): The User ID representing the user, managed by the user\n location_id (str, optional): Optional Location ID representing the location of a\n session\n\nReturns:\n list[schemas.Session]: List of Session objects",
|
|
"operationId": "get_sessions_apps__app_id__users__user_id__sessions_get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "location_id",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Location Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "is_active",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": false,
|
|
"title": "Is Active"
|
|
}
|
|
},
|
|
{
|
|
"name": "reverse",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": false,
|
|
"title": "Reverse"
|
|
}
|
|
},
|
|
{
|
|
"name": "filter",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Filter"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"description": "Page number",
|
|
"default": 1,
|
|
"title": "Page"
|
|
},
|
|
"description": "Page number"
|
|
},
|
|
{
|
|
"name": "size",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"description": "Page size",
|
|
"default": 50,
|
|
"title": "Size"
|
|
},
|
|
"description": "Page size"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Page_Session_"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const session of honcho.apps.users.sessions.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n )) {\n console.log(session.id);\n }\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\npage = client.apps.users.sessions.list(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nsession = page.items[0]\nprint(session.id)"
|
|
}
|
|
]
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"sessions"
|
|
],
|
|
"summary": "Create Session",
|
|
"description": "Create a Session for a User\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client\n application using honcho\n user_id (uuid.UUID): The User ID representing the user, managed by the user\n session (schemas.SessionCreate): The Session object containing any\n metadata and a location ID\n\nReturns:\n schemas.Session: The Session object of the new Session",
|
|
"operationId": "create_session_apps__app_id__users__user_id__sessions_post",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SessionCreate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Session"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const session = await honcho.apps.users.sessions.create(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { location_id: 'string' },\n );\n\n console.log(session.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nsession = client.apps.users.sessions.create(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n location_id=\"string\",\n)\nprint(session.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/sessions/{session_id}": {
|
|
"put": {
|
|
"tags": [
|
|
"sessions"
|
|
],
|
|
"summary": "Update Session",
|
|
"description": "Update the metadata of a Session\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (uuid.UUID): The User ID representing the user, managed by the user\n session_id (uuid.UUID): The ID of the Session to update\n session (schemas.SessionUpdate): The Session object containing any new metadata\n\nReturns:\n schemas.Session: The Session object of the updated Session",
|
|
"operationId": "update_session_apps__app_id__users__user_id__sessions__session_id__put",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SessionUpdate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Session"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const session = await honcho.apps.users.sessions.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n );\n\n console.log(session.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nsession = client.apps.users.sessions.update(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(session.id)"
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"tags": [
|
|
"sessions"
|
|
],
|
|
"summary": "Delete Session",
|
|
"description": "Delete a session by marking it as inactive\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (uuid.UUID): The User ID representing the user, managed by the user\n session_id (uuid.UUID): The ID of the Session to delete\n\nReturns:\n dict: A message indicating that the session was deleted\n\nRaises:\n HTTPException: If the session is not found",
|
|
"operationId": "delete_session_apps__app_id__users__user_id__sessions__session_id__delete",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const sessionDeleteResponse = await honcho.apps.users.sessions.delete(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n );\n\n console.log(sessionDeleteResponse);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nsession = client.apps.users.sessions.delete(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(session)"
|
|
}
|
|
]
|
|
},
|
|
"get": {
|
|
"tags": [
|
|
"sessions"
|
|
],
|
|
"summary": "Get Session",
|
|
"description": "Get a specific session for a user by ID\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (uuid.UUID): The User ID representing the user, managed by the user\n session_id (uuid.UUID): The ID of the Session to retrieve\n\nReturns:\n schemas.Session: The Session object of the requested Session\n\nRaises:\n HTTPException: If the session is not found",
|
|
"operationId": "get_session_apps__app_id__users__user_id__sessions__session_id__get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Session"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const session = await honcho.apps.users.sessions.get(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n );\n\n console.log(session.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nsession = client.apps.users.sessions.get(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(session.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/sessions/{session_id}/chat": {
|
|
"get": {
|
|
"tags": [
|
|
"sessions"
|
|
],
|
|
"summary": "Get Chat",
|
|
"operationId": "get_chat_apps__app_id__users__user_id__sessions__session_id__chat_get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "query",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"title": "Query"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AgentChat"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const agentChat = await honcho.apps.users.sessions.chat(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { query: 'string' },\n );\n\n console.log(agentChat.content);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nsession = client.apps.users.sessions.chat(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n query=\"string\",\n)\nprint(session.content)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/sessions/{session_id}/chat/stream": {
|
|
"get": {
|
|
"tags": [
|
|
"sessions"
|
|
],
|
|
"summary": "Get Chat Stream",
|
|
"operationId": "get_chat_stream_apps__app_id__users__user_id__sessions__session_id__chat_stream_get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "query",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"title": "Query"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Chat stream",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {}
|
|
},
|
|
"text/event-stream": {
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "binary"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const sessionStreamResponse = await honcho.apps.users.sessions.stream(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { query: 'string' },\n );\n\n console.log(sessionStreamResponse);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nsession = client.apps.users.sessions.stream(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n query=\"string\",\n)\nprint(session)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/sessions/{session_id}/messages": {
|
|
"post": {
|
|
"tags": [
|
|
"messages"
|
|
],
|
|
"summary": "Create Message For Session",
|
|
"description": "Adds a message to a session\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to add the message to\n message (schemas.MessageCreate): The Message object to add containing the\n message content and type\n\nReturns:\n schemas.Message: The Message object of the added message\n\nRaises:\n HTTPException: If the session is not found",
|
|
"operationId": "create_message_for_session_apps__app_id__users__user_id__sessions__session_id__messages_post",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/MessageCreate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Message"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const message = await honcho.apps.users.sessions.messages.create(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { content: 'string', is_user: true },\n );\n\n console.log(message.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nmessage = client.apps.users.sessions.messages.create(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n content=\"string\",\n is_user=True,\n)\nprint(message.id)"
|
|
}
|
|
]
|
|
},
|
|
"get": {
|
|
"tags": [
|
|
"messages"
|
|
],
|
|
"summary": "Get Messages",
|
|
"description": "Get all messages for a session\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to retrieve\n reverse (bool): Whether to reverse the order of the messages\n\nReturns:\n list[schemas.Message]: List of Message objects\n\nRaises:\n HTTPException: If the session is not found",
|
|
"operationId": "get_messages_apps__app_id__users__user_id__sessions__session_id__messages_get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "reverse",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": false,
|
|
"title": "Reverse"
|
|
}
|
|
},
|
|
{
|
|
"name": "filter",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Filter"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"description": "Page number",
|
|
"default": 1,
|
|
"title": "Page"
|
|
},
|
|
"description": "Page number"
|
|
},
|
|
{
|
|
"name": "size",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"description": "Page size",
|
|
"default": 50,
|
|
"title": "Size"
|
|
},
|
|
"description": "Page size"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Page_Message_"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const message of honcho.apps.users.sessions.messages.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n )) {\n console.log(message.id);\n }\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\npage = client.apps.users.sessions.messages.list(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nmessage = page.items[0]\nprint(message.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/sessions/{session_id}/messages/{message_id}": {
|
|
"get": {
|
|
"tags": [
|
|
"messages"
|
|
],
|
|
"summary": "Get Message",
|
|
"operationId": "get_message_apps__app_id__users__user_id__sessions__session_id__messages__message_id__get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "message_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Message Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Message"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const message = await honcho.apps.users.sessions.messages.get(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n );\n\n console.log(message.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nmessage = client.apps.users.sessions.messages.get(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n session_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(message.id)"
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": [
|
|
"messages"
|
|
],
|
|
"summary": "Update Message",
|
|
"description": "Update's the metadata of a message",
|
|
"operationId": "update_message_apps__app_id__users__user_id__sessions__session_id__messages__message_id__put",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "message_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Message Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/MessageUpdate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Message"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const message = await honcho.apps.users.sessions.messages.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n );\n\n console.log(message.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nmessage = client.apps.users.sessions.messages.update(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n session_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(message.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/sessions/{session_id}/metamessages": {
|
|
"post": {
|
|
"tags": [
|
|
"messages"
|
|
],
|
|
"summary": "Create Metamessage",
|
|
"description": "Adds a message to a session\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to add the message to\n message (schemas.MessageCreate): The Message object to add containing the\n message content and type\n\nReturns:\n schemas.Message: The Message object of the added message\n\nRaises:\n HTTPException: If the session is not found",
|
|
"operationId": "create_metamessage_apps__app_id__users__user_id__sessions__session_id__metamessages_post",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/MetamessageCreate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Metamessage"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const metamessage = await honcho.apps.users.sessions.metamessages.create(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { content: 'string', message_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', metamessage_type: 'string' },\n );\n\n console.log(metamessage.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nmetamessage = client.apps.users.sessions.metamessages.create(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n content=\"string\",\n message_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n metamessage_type=\"string\",\n)\nprint(metamessage.id)"
|
|
}
|
|
]
|
|
},
|
|
"get": {
|
|
"tags": [
|
|
"messages"
|
|
],
|
|
"summary": "Get Metamessages",
|
|
"description": "Get all messages for a session\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to retrieve\n reverse (bool): Whether to reverse the order of the metamessages\n\nReturns:\n list[schemas.Message]: List of Message objects\n\nRaises:\n HTTPException: If the session is not found",
|
|
"operationId": "get_metamessages_apps__app_id__users__user_id__sessions__session_id__metamessages_get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "message_id",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"format": "uuid"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Message Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "metamessage_type",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metamessage Type"
|
|
}
|
|
},
|
|
{
|
|
"name": "reverse",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": false,
|
|
"title": "Reverse"
|
|
}
|
|
},
|
|
{
|
|
"name": "filter",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Filter"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"description": "Page number",
|
|
"default": 1,
|
|
"title": "Page"
|
|
},
|
|
"description": "Page number"
|
|
},
|
|
{
|
|
"name": "size",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"description": "Page size",
|
|
"default": 50,
|
|
"title": "Size"
|
|
},
|
|
"description": "Page size"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Page_Metamessage_"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const metamessage of honcho.apps.users.sessions.metamessages.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n )) {\n console.log(metamessage.id);\n }\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\npage = client.apps.users.sessions.metamessages.list(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nmetamessage = page.items[0]\nprint(metamessage.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/sessions/{session_id}/metamessages/{metamessage_id}": {
|
|
"get": {
|
|
"tags": [
|
|
"messages"
|
|
],
|
|
"summary": "Get Metamessage",
|
|
"description": "Get a specific Metamessage by ID\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to retrieve\n\nReturns:\n schemas.Session: The Session object of the requested Session\n\nRaises:\n HTTPException: If the session is not found",
|
|
"operationId": "get_metamessage_apps__app_id__users__user_id__sessions__session_id__metamessages__metamessage_id__get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "metamessage_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Metamessage Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "message_id",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Message Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Metamessage"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const metamessage = await honcho.apps.users.sessions.metamessages.get(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { message_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n );\n\n console.log(metamessage.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nmetamessage = client.apps.users.sessions.metamessages.get(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n session_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n message_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(metamessage.id)"
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": [
|
|
"messages"
|
|
],
|
|
"summary": "Update Metamessage",
|
|
"description": "Update's the metadata of a metamessage",
|
|
"operationId": "update_metamessage_apps__app_id__users__user_id__sessions__session_id__metamessages__metamessage_id__put",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "session_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "metamessage_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Metamessage Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/MetamessageUpdate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Metamessage"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const metamessage = await honcho.apps.users.sessions.metamessages.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { message_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n );\n\n console.log(metamessage.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\nmetamessage = client.apps.users.sessions.metamessages.update(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n session_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n message_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(metamessage.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/collections": {
|
|
"get": {
|
|
"tags": [
|
|
"collections"
|
|
],
|
|
"summary": "Get Collections",
|
|
"description": "Get All Collections for a User\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client\n application using honcho\n user_id (uuid.UUID): The User ID representing the user, managed by the user\n\nReturns:\n list[schemas.Collection]: List of Collection objects",
|
|
"operationId": "get_collections_apps__app_id__users__user_id__collections_get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "reverse",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": false,
|
|
"title": "Reverse"
|
|
}
|
|
},
|
|
{
|
|
"name": "filter",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Filter"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"description": "Page number",
|
|
"default": 1,
|
|
"title": "Page"
|
|
},
|
|
"description": "Page number"
|
|
},
|
|
{
|
|
"name": "size",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"description": "Page size",
|
|
"default": 50,
|
|
"title": "Size"
|
|
},
|
|
"description": "Page size"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Page_Collection_"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const collection of honcho.apps.users.collections.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n )) {\n console.log(collection.id);\n }\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\npage = client.apps.users.collections.list(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\ncollection = page.items[0]\nprint(collection.id)"
|
|
}
|
|
]
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"collections"
|
|
],
|
|
"summary": "Create Collection",
|
|
"operationId": "create_collection_apps__app_id__users__user_id__collections_post",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CollectionCreate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const collection = await honcho.apps.users.collections.create(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { name: 'string' },\n );\n\n console.log(collection.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\ncollection = client.apps.users.collections.create(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n name=\"string\",\n)\nprint(collection.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/collections/name/{name}": {
|
|
"get": {
|
|
"tags": [
|
|
"collections"
|
|
],
|
|
"summary": "Get Collection By Name",
|
|
"operationId": "get_collection_by_name_apps__app_id__users__user_id__collections_name__name__get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"title": "Name"
|
|
}
|
|
}
|
|
],
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const collection = await honcho.apps.users.collections.getByName(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n 'string',\n );\n\n console.log(collection.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\ncollection = client.apps.users.collections.get_by_name(\n \"string\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(collection.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/collections/{collection_id}": {
|
|
"get": {
|
|
"tags": [
|
|
"collections"
|
|
],
|
|
"summary": "Get Collection By Id",
|
|
"operationId": "get_collection_by_id_apps__app_id__users__user_id__collections__collection_id__get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "collection_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Collection Id"
|
|
}
|
|
}
|
|
],
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const collection = await honcho.apps.users.collections.get(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n );\n\n console.log(collection.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\ncollection = client.apps.users.collections.get(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(collection.id)"
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": [
|
|
"collections"
|
|
],
|
|
"summary": "Update Collection",
|
|
"operationId": "update_collection_apps__app_id__users__user_id__collections__collection_id__put",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "collection_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Collection Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CollectionUpdate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const collection = await honcho.apps.users.collections.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { name: 'string' },\n );\n\n console.log(collection.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\ncollection = client.apps.users.collections.update(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n name=\"string\",\n)\nprint(collection.id)"
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"tags": [
|
|
"collections"
|
|
],
|
|
"summary": "Delete Collection",
|
|
"operationId": "delete_collection_apps__app_id__users__user_id__collections__collection_id__delete",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "collection_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Collection Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const collectionDeleteResponse = await honcho.apps.users.collections.delete(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n );\n\n console.log(collectionDeleteResponse);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\ncollection = client.apps.users.collections.delete(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(collection)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/collections/{collection_id}/documents": {
|
|
"get": {
|
|
"tags": [
|
|
"documents"
|
|
],
|
|
"summary": "Get Documents",
|
|
"operationId": "get_documents_apps__app_id__users__user_id__collections__collection_id__documents_get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "collection_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Collection Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "reverse",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": false,
|
|
"title": "Reverse"
|
|
}
|
|
},
|
|
{
|
|
"name": "filter",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Filter"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"description": "Page number",
|
|
"default": 1,
|
|
"title": "Page"
|
|
},
|
|
"description": "Page number"
|
|
},
|
|
{
|
|
"name": "size",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"description": "Page size",
|
|
"default": 50,
|
|
"title": "Size"
|
|
},
|
|
"description": "Page size"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Page_Document_"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const document of honcho.apps.users.collections.documents.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n )) {\n console.log(document.id);\n }\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\npage = client.apps.users.collections.documents.list(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\ndocument = page.items[0]\nprint(document.id)"
|
|
}
|
|
]
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"documents"
|
|
],
|
|
"summary": "Create Document",
|
|
"operationId": "create_document_apps__app_id__users__user_id__collections__collection_id__documents_post",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "collection_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Collection Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DocumentCreate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Document"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const document = await honcho.apps.users.collections.documents.create(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { content: 'string' },\n );\n\n console.log(document.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\ndocument = client.apps.users.collections.documents.create(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n content=\"string\",\n)\nprint(document.id)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/collections/{collection_id}/documents/{document_id}": {
|
|
"get": {
|
|
"tags": [
|
|
"documents"
|
|
],
|
|
"summary": "Get Document",
|
|
"operationId": "get_document_apps__app_id__users__user_id__collections__collection_id__documents__document_id__get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "collection_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Collection Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "document_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Document Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Document"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const document = await honcho.apps.users.collections.documents.get(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n );\n\n console.log(document.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\ndocument = client.apps.users.collections.documents.get(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n collection_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(document.id)"
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": [
|
|
"documents"
|
|
],
|
|
"summary": "Update Document",
|
|
"operationId": "update_document_apps__app_id__users__user_id__collections__collection_id__documents__document_id__put",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "collection_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Collection Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "document_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Document Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DocumentUpdate"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Document"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const document = await honcho.apps.users.collections.documents.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n );\n\n console.log(document.id);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\ndocument = client.apps.users.collections.documents.update(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n collection_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(document.id)"
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"tags": [
|
|
"documents"
|
|
],
|
|
"summary": "Delete Document",
|
|
"operationId": "delete_document_apps__app_id__users__user_id__collections__collection_id__documents__document_id__delete",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "collection_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Collection Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "document_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Document Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const documentDeleteResponse = await honcho.apps.users.collections.documents.delete(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n );\n\n console.log(documentDeleteResponse);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\ndocument = client.apps.users.collections.documents.delete(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n collection_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n)\nprint(document)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/apps/{app_id}/users/{user_id}/collections/{collection_id}/query": {
|
|
"get": {
|
|
"tags": [
|
|
"documents"
|
|
],
|
|
"summary": "Query Documents",
|
|
"operationId": "query_documents_apps__app_id__users__user_id__collections__collection_id__query_get",
|
|
"security": [
|
|
{
|
|
"HTTPBearer": []
|
|
},
|
|
{}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "app_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "collection_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Collection Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "query",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"title": "Query"
|
|
}
|
|
},
|
|
{
|
|
"name": "top_k",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"default": 5,
|
|
"title": "Top K"
|
|
}
|
|
},
|
|
{
|
|
"name": "filter",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Filter"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Document"
|
|
},
|
|
"title": "Response Query Documents Apps App Id Users User Id Collections Collection Id Query Get"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-codeSamples": [
|
|
{
|
|
"lang": "JavaScript",
|
|
"source": "import Honcho from 'honcho-ai';\n\nconst honcho = new Honcho({\n apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted\n});\n\nasync function main() {\n const collectionQueryResponse = await honcho.apps.users.collections.query(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { query: 'string' },\n );\n\n console.log(collectionQueryResponse);\n}\n\nmain();"
|
|
},
|
|
{
|
|
"lang": "Python",
|
|
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_AUTH_TOKEN\"),\n)\ncollection = client.apps.users.collections.query(\n \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n app_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n user_id=\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n query=\"string\",\n)\nprint(collection)"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"schemas": {
|
|
"AgentChat": {
|
|
"properties": {
|
|
"content": {
|
|
"type": "string",
|
|
"title": "Content"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"content"
|
|
],
|
|
"title": "AgentChat"
|
|
},
|
|
"App": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Id"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"title": "Name"
|
|
},
|
|
"metadata": {
|
|
"type": "object",
|
|
"title": "Metadata"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"title": "Created At"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"metadata",
|
|
"created_at"
|
|
],
|
|
"title": "App",
|
|
"exclude": [
|
|
"h_metadata"
|
|
]
|
|
},
|
|
"AppCreate": {
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"title": "Name"
|
|
},
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata",
|
|
"default": {}
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"name"
|
|
],
|
|
"title": "AppCreate"
|
|
},
|
|
"AppUpdate": {
|
|
"properties": {
|
|
"name": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Name"
|
|
},
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"title": "AppUpdate"
|
|
},
|
|
"Collection": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Id"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"title": "Name"
|
|
},
|
|
"user_id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
},
|
|
"metadata": {
|
|
"type": "object",
|
|
"title": "Metadata"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"title": "Created At"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"user_id",
|
|
"metadata",
|
|
"created_at"
|
|
],
|
|
"title": "Collection",
|
|
"exclude": [
|
|
"h_metadata"
|
|
]
|
|
},
|
|
"CollectionCreate": {
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"title": "Name"
|
|
},
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata",
|
|
"default": {}
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"name"
|
|
],
|
|
"title": "CollectionCreate"
|
|
},
|
|
"CollectionUpdate": {
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"title": "Name"
|
|
},
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"name"
|
|
],
|
|
"title": "CollectionUpdate"
|
|
},
|
|
"Document": {
|
|
"properties": {
|
|
"content": {
|
|
"type": "string",
|
|
"title": "Content"
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Id"
|
|
},
|
|
"metadata": {
|
|
"type": "object",
|
|
"title": "Metadata"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"title": "Created At"
|
|
},
|
|
"collection_id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Collection Id"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"content",
|
|
"id",
|
|
"metadata",
|
|
"created_at",
|
|
"collection_id"
|
|
],
|
|
"title": "Document",
|
|
"exclude": [
|
|
"h_metadata"
|
|
]
|
|
},
|
|
"DocumentCreate": {
|
|
"properties": {
|
|
"content": {
|
|
"type": "string",
|
|
"title": "Content"
|
|
},
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata",
|
|
"default": {}
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"content"
|
|
],
|
|
"title": "DocumentCreate"
|
|
},
|
|
"DocumentUpdate": {
|
|
"properties": {
|
|
"content": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Content"
|
|
},
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"title": "DocumentUpdate"
|
|
},
|
|
"HTTPValidationError": {
|
|
"properties": {
|
|
"detail": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/ValidationError"
|
|
},
|
|
"type": "array",
|
|
"title": "Detail"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"title": "HTTPValidationError"
|
|
},
|
|
"Message": {
|
|
"properties": {
|
|
"content": {
|
|
"type": "string",
|
|
"title": "Content"
|
|
},
|
|
"is_user": {
|
|
"type": "boolean",
|
|
"title": "Is User"
|
|
},
|
|
"session_id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Session Id"
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Id"
|
|
},
|
|
"metadata": {
|
|
"type": "object",
|
|
"title": "Metadata"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"title": "Created At"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"content",
|
|
"is_user",
|
|
"session_id",
|
|
"id",
|
|
"metadata",
|
|
"created_at"
|
|
],
|
|
"title": "Message",
|
|
"exclude": [
|
|
"h_metadata"
|
|
]
|
|
},
|
|
"MessageCreate": {
|
|
"properties": {
|
|
"content": {
|
|
"type": "string",
|
|
"title": "Content"
|
|
},
|
|
"is_user": {
|
|
"type": "boolean",
|
|
"title": "Is User"
|
|
},
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata",
|
|
"default": {}
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"content",
|
|
"is_user"
|
|
],
|
|
"title": "MessageCreate"
|
|
},
|
|
"MessageUpdate": {
|
|
"properties": {
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"title": "MessageUpdate"
|
|
},
|
|
"Metamessage": {
|
|
"properties": {
|
|
"metamessage_type": {
|
|
"type": "string",
|
|
"title": "Metamessage Type"
|
|
},
|
|
"content": {
|
|
"type": "string",
|
|
"title": "Content"
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Id"
|
|
},
|
|
"message_id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Message Id"
|
|
},
|
|
"metadata": {
|
|
"type": "object",
|
|
"title": "Metadata"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"title": "Created At"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"metamessage_type",
|
|
"content",
|
|
"id",
|
|
"message_id",
|
|
"metadata",
|
|
"created_at"
|
|
],
|
|
"title": "Metamessage",
|
|
"exclude": [
|
|
"h_metadata"
|
|
]
|
|
},
|
|
"MetamessageCreate": {
|
|
"properties": {
|
|
"metamessage_type": {
|
|
"type": "string",
|
|
"title": "Metamessage Type"
|
|
},
|
|
"content": {
|
|
"type": "string",
|
|
"title": "Content"
|
|
},
|
|
"message_id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Message Id"
|
|
},
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata",
|
|
"default": {}
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"metamessage_type",
|
|
"content",
|
|
"message_id"
|
|
],
|
|
"title": "MetamessageCreate"
|
|
},
|
|
"MetamessageUpdate": {
|
|
"properties": {
|
|
"message_id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Message Id"
|
|
},
|
|
"metamessage_type": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metamessage Type"
|
|
},
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"message_id"
|
|
],
|
|
"title": "MetamessageUpdate"
|
|
},
|
|
"Page_Collection_": {
|
|
"properties": {
|
|
"items": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/Collection"
|
|
},
|
|
"type": "array",
|
|
"title": "Items"
|
|
},
|
|
"total": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"title": "Total"
|
|
},
|
|
"page": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"title": "Page"
|
|
},
|
|
"size": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"title": "Size"
|
|
},
|
|
"pages": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"title": "Pages"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"items",
|
|
"total",
|
|
"page",
|
|
"size"
|
|
],
|
|
"title": "Page[Collection]"
|
|
},
|
|
"Page_Document_": {
|
|
"properties": {
|
|
"items": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/Document"
|
|
},
|
|
"type": "array",
|
|
"title": "Items"
|
|
},
|
|
"total": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"title": "Total"
|
|
},
|
|
"page": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"title": "Page"
|
|
},
|
|
"size": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"title": "Size"
|
|
},
|
|
"pages": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"title": "Pages"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"items",
|
|
"total",
|
|
"page",
|
|
"size"
|
|
],
|
|
"title": "Page[Document]"
|
|
},
|
|
"Page_Message_": {
|
|
"properties": {
|
|
"items": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/Message"
|
|
},
|
|
"type": "array",
|
|
"title": "Items"
|
|
},
|
|
"total": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"title": "Total"
|
|
},
|
|
"page": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"title": "Page"
|
|
},
|
|
"size": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"title": "Size"
|
|
},
|
|
"pages": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"title": "Pages"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"items",
|
|
"total",
|
|
"page",
|
|
"size"
|
|
],
|
|
"title": "Page[Message]"
|
|
},
|
|
"Page_Metamessage_": {
|
|
"properties": {
|
|
"items": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/Metamessage"
|
|
},
|
|
"type": "array",
|
|
"title": "Items"
|
|
},
|
|
"total": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"title": "Total"
|
|
},
|
|
"page": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"title": "Page"
|
|
},
|
|
"size": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"title": "Size"
|
|
},
|
|
"pages": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"title": "Pages"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"items",
|
|
"total",
|
|
"page",
|
|
"size"
|
|
],
|
|
"title": "Page[Metamessage]"
|
|
},
|
|
"Page_Session_": {
|
|
"properties": {
|
|
"items": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/Session"
|
|
},
|
|
"type": "array",
|
|
"title": "Items"
|
|
},
|
|
"total": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"title": "Total"
|
|
},
|
|
"page": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"title": "Page"
|
|
},
|
|
"size": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"title": "Size"
|
|
},
|
|
"pages": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"title": "Pages"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"items",
|
|
"total",
|
|
"page",
|
|
"size"
|
|
],
|
|
"title": "Page[Session]"
|
|
},
|
|
"Page_User_": {
|
|
"properties": {
|
|
"items": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/User"
|
|
},
|
|
"type": "array",
|
|
"title": "Items"
|
|
},
|
|
"total": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"title": "Total"
|
|
},
|
|
"page": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"title": "Page"
|
|
},
|
|
"size": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"title": "Size"
|
|
},
|
|
"pages": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"title": "Pages"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"items",
|
|
"total",
|
|
"page",
|
|
"size"
|
|
],
|
|
"title": "Page[User]"
|
|
},
|
|
"Session": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Id"
|
|
},
|
|
"is_active": {
|
|
"type": "boolean",
|
|
"title": "Is Active"
|
|
},
|
|
"user_id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "User Id"
|
|
},
|
|
"location_id": {
|
|
"type": "string",
|
|
"title": "Location Id"
|
|
},
|
|
"metadata": {
|
|
"type": "object",
|
|
"title": "Metadata"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"title": "Created At"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"is_active",
|
|
"user_id",
|
|
"location_id",
|
|
"metadata",
|
|
"created_at"
|
|
],
|
|
"title": "Session",
|
|
"exclude": [
|
|
"h_metadata"
|
|
]
|
|
},
|
|
"SessionCreate": {
|
|
"properties": {
|
|
"location_id": {
|
|
"type": "string",
|
|
"title": "Location Id"
|
|
},
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata",
|
|
"default": {}
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"location_id"
|
|
],
|
|
"title": "SessionCreate"
|
|
},
|
|
"SessionUpdate": {
|
|
"properties": {
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"title": "SessionUpdate"
|
|
},
|
|
"User": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "Id"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"title": "Name"
|
|
},
|
|
"app_id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"title": "App Id"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"title": "Created At"
|
|
},
|
|
"metadata": {
|
|
"type": "object",
|
|
"title": "Metadata"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"app_id",
|
|
"created_at",
|
|
"metadata"
|
|
],
|
|
"title": "User",
|
|
"exclude": [
|
|
"h_metadata"
|
|
]
|
|
},
|
|
"UserCreate": {
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"title": "Name"
|
|
},
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata",
|
|
"default": {}
|
|
}
|
|
},
|
|
"type": "object",
|
|
"required": [
|
|
"name"
|
|
],
|
|
"title": "UserCreate"
|
|
},
|
|
"UserUpdate": {
|
|
"properties": {
|
|
"name": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Name"
|
|
},
|
|
"metadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Metadata"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"title": "UserUpdate"
|
|
},
|
|
"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"
|
|
}
|
|
},
|
|
"securitySchemes": {
|
|
"HTTPBearer": {
|
|
"type": "http",
|
|
"scheme": "bearer"
|
|
}
|
|
}
|
|
}
|
|
}
|