From d094ef8e10ebf08d5611329591e99f5967563ff1 Mon Sep 17 00:00:00 2001
From: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
Date: Thu, 9 Oct 2025 16:57:50 -0400
Subject: [PATCH] feat: Release PR for v2.4.0 (#229)
---
.github/workflows/fly-deploy-prod.yml | 61 +
.github/workflows/fly-deploy.yml | 61 +
CHANGELOG.md | 22 +
README.md | 2 +-
docs/changelog/compatibility-guide.mdx | 13 +-
docs/changelog/introduction.mdx | 34 +-
docs/docs.json | 16 +-
docs/v2/api-reference/endpoint/metrics.mdx | 3 +
docs/v2/openapi.documented.json | 4514 +++++++++++++++++
docs/v2/openapi.documented.yml | 3660 -------------
pyproject.toml | 2 +-
sdks/python/CHANGELOG.md | 6 +
sdks/python/src/honcho/__init__.py | 2 +-
sdks/typescript/CHANGELOG.md | 6 +
.../__tests__/session_context.test.ts | 369 +-
src/main.py | 2 +-
uv.lock | 2 +-
17 files changed, 4940 insertions(+), 3835 deletions(-)
create mode 100644 .github/workflows/fly-deploy-prod.yml
create mode 100644 .github/workflows/fly-deploy.yml
create mode 100644 docs/v2/api-reference/endpoint/metrics.mdx
create mode 100644 docs/v2/openapi.documented.json
delete mode 100644 docs/v2/openapi.documented.yml
diff --git a/.github/workflows/fly-deploy-prod.yml b/.github/workflows/fly-deploy-prod.yml
new file mode 100644
index 00000000..b13da23e
--- /dev/null
+++ b/.github/workflows/fly-deploy-prod.yml
@@ -0,0 +1,61 @@
+# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
+
+name: Fly Deploy (Production Environment)
+permissions:
+ contents: read
+on:
+ push:
+ tags:
+ - v*
+ workflow_dispatch:
+ inputs:
+ version:
+ description: "Version to deploy (without v prefix)"
+ required: true
+ type: string
+ default: 'manual'
+
+jobs:
+ deploy-honcho-prod-image:
+ name: Deploy Honcho Image (Production Environment)
+ runs-on: ubuntu-latest
+ concurrency:
+ group: deploy-prod-group
+ cancel-in-progress: true
+ steps:
+ - uses: actions/checkout@v4
+ - uses: superfly/flyctl-actions/setup-flyctl@1.5
+ - run: |
+ # Determine the image label based on trigger type
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ IMAGE_LABEL="deployment-${{ github.event.inputs.version }}"
+ else
+ IMAGE_LABEL="deployment-${{ github.ref_name }}"
+ fi
+ flyctl deploy -a honcho-prod-image --remote-only --build-only --push --no-cache --image-label "$IMAGE_LABEL"
+ env:
+ FLY_API_TOKEN: ${{ secrets.FLY_PROD_API_TOKEN }}
+
+ prompt-service:
+ name: Push to Service (Production Environment)
+ needs: deploy-honcho-prod-image
+ runs-on: ubuntu-latest
+ steps:
+ - name: Send POST request
+ env:
+ GITHUB_REF_NAME: ${{ github.ref_name }}
+ run: |
+ # Determine version and image label based on trigger type
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ TAG="${{ github.event.inputs.version }}"
+ IMAGE_LABEL="honcho-prod-image:deployment-${{ github.event.inputs.version }}"
+ else
+ TAG=${GITHUB_REF_NAME#v}
+ IMAGE_LABEL="honcho-prod-image:deployment-${GITHUB_REF_NAME}"
+ fi
+
+ curl --fail -X POST \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer ${{ secrets.PROD_ENV_WEBHOOK_SECRET }}" \
+ -d "{\"version\":\"$TAG\",\"image_label\":\"$IMAGE_LABEL\"}" \
+ "${{ secrets.PROD_ENV_URL }}/webhooks/v1/add_honcho_version"
diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml
new file mode 100644
index 00000000..2a3cbc8c
--- /dev/null
+++ b/.github/workflows/fly-deploy.yml
@@ -0,0 +1,61 @@
+# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
+
+name: Fly Deploy (Test Environment)
+permissions:
+ contents: read
+on:
+ push:
+ tags:
+ - v*
+ workflow_dispatch:
+ inputs:
+ version:
+ description: "Version to deploy (without v prefix)"
+ required: true
+ type: string
+ default: 'manual'
+
+jobs:
+ deploy-honcho-image:
+ name: Deploy Honcho Image (Test Environment)
+ runs-on: ubuntu-latest
+ concurrency:
+ group: deploy-test-group
+ cancel-in-progress: true
+ steps:
+ - uses: actions/checkout@v4
+ - uses: superfly/flyctl-actions/setup-flyctl@1.5
+ - run: |
+ # Determine the image label based on trigger type
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ IMAGE_LABEL="deployment-${{ github.event.inputs.version }}"
+ else
+ IMAGE_LABEL="deployment-${{ github.ref_name }}"
+ fi
+ flyctl deploy -a honcho-image --remote-only --build-only --push --no-cache --image-label "$IMAGE_LABEL"
+ env:
+ FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
+
+ prompt-service:
+ name: Push to Service (Test Environment)
+ runs-on: ubuntu-latest
+ needs: deploy-honcho-image
+ steps:
+ - name: Send POST request
+ env:
+ GITHUB_REF_NAME: ${{ github.ref_name }}
+ run: |
+ # Determine version and image label based on trigger type
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ TAG="${{ github.event.inputs.version }}"
+ IMAGE_LABEL="honcho-image:deployment-${{ github.event.inputs.version }}"
+ else
+ TAG=${GITHUB_REF_NAME#v}
+ IMAGE_LABEL="honcho-image:deployment-${GITHUB_REF_NAME}"
+ fi
+
+ curl --fail -X POST \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer ${{ secrets.TEST_ENV_WEBHOOK_SECRET }}" \
+ -d "{\"version\":\"$TAG\",\"image_label\":\"$IMAGE_LABEL\"}" \
+ "${{ secrets.TEST_ENV_URL }}/webhooks/v1/add_honcho_version"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 53642f5a..e1707ad9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
+## [2.4.0] - 2025-10-08
+
+### Added
+
+- Unified `Representation` class
+- vllm client support
+- Periodic queue cleanup logic
+- WIP Dreaming Feature
+- LongMemEval to Test Bench
+- Prometheus Client for better Metrics
+- Performance metrics instrumentation
+- Error reporting to deriver
+
+### Changed
+
+- Working Representations are Queried on the fly rather than cached in metadata
+- EmbeddingStore to RepresentationFactory
+- Summary Response Model to use public_id of message for cutoff
+- Semantic across codebase to reference resources based on `observer` and `observed`
+- Prompts for Deriver & Dialectic to reference peer_id and add examples
+- `Get Context` route returns peer card and representation in addition to messages and summaries
+
## [2.3.3] — 2025-10-01
### Changed
diff --git a/README.md b/README.md
index 28a156bd..86a8b790 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
---
-
+
[](https://pypi.org/project/honcho-ai/)
[](https://npmjs.org/package/@honcho-ai/sdk)
[](https://discord.gg/plasticlabs)
diff --git a/docs/changelog/compatibility-guide.mdx b/docs/changelog/compatibility-guide.mdx
index b98608c3..f6b3c46e 100644
--- a/docs/changelog/compatibility-guide.mdx
+++ b/docs/changelog/compatibility-guide.mdx
@@ -8,23 +8,23 @@ This guide helps you understand which versions of Honcho's API are compatible wi
## Version Compatibility
-### Honcho API v2.3.3 (Current)
+### Honcho API v2.4.0 (Current)
- **Compatible Version:** v1.4.1
+ **Compatible Version:** v1.5.0
Install with:
```bash
- npm install @honcho-ai/sdk@1.4.1
+ npm install @honcho-ai/sdk@1.5.0
```
- **Compatible Version:** v1.4.1
+ **Compatible Version:** v1.5.0
Install with:
```bash
- pip install honcho-ai==1.4.1
+ pip install honcho-ai==1.5.0
```
@@ -35,7 +35,8 @@ This guide helps you understand which versions of Honcho's API are compatible wi
| Honcho API Version | TypeScript SDK | Python SDK |
|-------------------|---------------|------------|
-| v2.3.3 (Current) | v1.4.1 | v1.4.1 |
+| v2.4.0 (Current) | v1.5.0 | v1.5.0 |
+| v2.3.3 | v1.4.1 | v1.4.1 |
| v2.3.2 | v1.4.0 | v1.4.0 |
| v2.3.1 | v1.4.0 | v1.4.0 |
| v2.3.0 | v1.4.0 | v1.4.0 |
diff --git a/docs/changelog/introduction.mdx b/docs/changelog/introduction.mdx
index 638eb6aa..7ec64c88 100644
--- a/docs/changelog/introduction.mdx
+++ b/docs/changelog/introduction.mdx
@@ -27,7 +27,29 @@ Welcome to the Honcho changelog! This section documents all notable changes to t
### Honcho API and SDK Changelogs
-
+
+ ### Added
+
+ - Unified `Representation` class
+ - vllm client support
+ - Periodic queue cleanup logic
+ - WIP Dreaming Feature
+ - LongMemEval to Test Bench
+ - Prometheus Client for better Metrics
+ - Performance metrics instrumentation
+ - Error reporting to deriver
+
+ ### Changed
+
+ - Working Representations are Queried on the fly rather than cached in metadata
+ - EmbeddingStore to RepresentationFactory
+ - Summary Response Model to use public_id of message for cutoff
+ - Semantic across codebase to reference resources based on `observer` and `observed`
+ - Prompts for Deriver & Dialectic to reference peer_id and add examples
+ - `Get Context` route returns peer card and representation in addition to messages and summaries
+
+
+
### Changed
- Deriver Rollup Queue processes interleaved messages for more context
@@ -305,6 +327,11 @@ Welcome to the Honcho changelog! This section documents all notable changes to t
[Python SDK](https://pypi.org/project/honcho-ai/)
+
+ ### Changed
+
+ - message_id of `Summary` model is a string nanoid
+
### Added
@@ -369,6 +396,11 @@ Welcome to the Honcho changelog! This section documents all notable changes to t
[TypeScript SDK](https://www.npmjs.com/package/@honcho-ai/sdk)
+
+ ### Changed
+
+ - message_id of `Summary` model is a string nanoid
+
### Added
diff --git a/docs/docs.json b/docs/docs.json
index c838da84..2f4f1850 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -14,9 +14,9 @@
"navigation": {
"versions": [
{
- "version": "v2.3.3",
+ "version": "v2.4.0",
"api": {
- "openapi": ["openapi.documented.yml"]
+ "openapi": ["openapi.documented.json"]
},
"tabs": [
{
@@ -147,10 +147,7 @@
"v2/api-reference/endpoint/messages/create-messages-with-file"
]
},
- {
- "group": "keys",
- "pages": ["v2/api-reference/endpoint/keys/create-key"]
- },
+
{
"group": "webhooks",
"pages": [
@@ -159,6 +156,13 @@
"v2/api-reference/endpoint/webhooks/delete-webhook-endpoint",
"v2/api-reference/endpoint/webhooks/test-emit"
]
+ },
+ {
+ "group": "miscellaneous",
+ "pages": [
+ "v2/api-reference/endpoint/keys/create-key",
+ "v2/api-reference/endpoint/metrics"
+ ]
}
]
},
diff --git a/docs/v2/api-reference/endpoint/metrics.mdx b/docs/v2/api-reference/endpoint/metrics.mdx
new file mode 100644
index 00000000..00ca0fca
--- /dev/null
+++ b/docs/v2/api-reference/endpoint/metrics.mdx
@@ -0,0 +1,3 @@
+---
+openapi: get /metrics
+---
diff --git a/docs/v2/openapi.documented.json b/docs/v2/openapi.documented.json
new file mode 100644
index 00000000..09daa5f7
--- /dev/null
+++ b/docs/v2/openapi.documented.json
@@ -0,0 +1,4514 @@
+{
+ "openapi": "3.1.0",
+ "info": {
+ "title": "Honcho API",
+ "summary": "The Identity Layer for the Agentic World",
+ "description": "Honcho is a platform for giving agents user-centric memory and social cognition",
+ "contact": {
+ "name": "Plastic Labs",
+ "url": "https://honcho.dev/",
+ "email": "hello@plasticlabs.ai"
+ },
+ "version": "2.4.0"
+ },
+ "servers": [
+ {
+ "url": "http://localhost:8000",
+ "description": "Local Development Server"
+ },
+ {
+ "url": "https://demo.honcho.dev",
+ "description": "Demo Server"
+ },
+ {
+ "url": "https://api.honcho.dev",
+ "description": "Production SaaS Platform"
+ }
+ ],
+ "paths": {
+ "/v2/workspaces": {
+ "post": {
+ "tags": ["workspaces"],
+ "summary": "Get Or Create Workspace",
+ "description": "Get a Workspace by ID.\n\nIf workspace_id is provided as a query parameter, it uses that (must match JWT workspace_id).\nOtherwise, it uses the workspace_id from the JWT.",
+ "operationId": "get_or_create_workspace_v2_workspaces_post",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/WorkspaceCreate",
+ "description": "Workspace creation parameters"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Workspace"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst workspace = await client.workspaces.getOrCreate({ id: 'id' });\n\nconsole.log(workspace.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nworkspace = client.workspaces.get_or_create(\n id=\"id\",\n)\nprint(workspace.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/list": {
+ "post": {
+ "tags": ["workspaces"],
+ "summary": "Get All Workspaces",
+ "description": "Get all Workspaces",
+ "operationId": "get_all_workspaces_v2_workspaces_list_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "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"
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/WorkspaceGet"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Filtering and pagination options for the workspaces list",
+ "title": "Options"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Page_Workspace_"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const workspace of client.workspaces.list()) {\n console.log(workspace.id);\n}"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\npage = client.workspaces.list()\npage = page.items[0]\nprint(page.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}": {
+ "put": {
+ "tags": ["workspaces"],
+ "summary": "Update Workspace",
+ "description": "Update a Workspace",
+ "operationId": "update_workspace_v2_workspaces__workspace_id__put",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace to update",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace to update"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/WorkspaceUpdate",
+ "description": "Updated workspace parameters"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Workspace"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst workspace = await client.workspaces.update('workspace_id');\n\nconsole.log(workspace.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nworkspace = client.workspaces.update(\n workspace_id=\"workspace_id\",\n)\nprint(workspace.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/search": {
+ "post": {
+ "tags": ["workspaces"],
+ "summary": "Search Workspace",
+ "description": "Search a Workspace",
+ "operationId": "search_workspace_v2_workspaces__workspace_id__search_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace to search",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace to search"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MessageSearchOptions",
+ "description": "Message search parameters "
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
+ "title": "Response Search Workspace V2 Workspaces Workspace Id Search Post"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst messages = await client.workspaces.search('workspace_id', { query: 'query' });\n\nconsole.log(messages);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nmessages = client.workspaces.search(\n workspace_id=\"workspace_id\",\n query=\"query\",\n)\nprint(messages)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/deriver/status": {
+ "get": {
+ "tags": ["workspaces"],
+ "summary": "Get Deriver Status",
+ "description": "Get the deriver processing status, optionally scoped to an observer, sender, and/or session",
+ "operationId": "get_deriver_status_v2_workspaces__workspace_id__deriver_status_get",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "observer_id",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Optional observer ID to filter by",
+ "title": "Observer Id"
+ },
+ "description": "Optional observer ID to filter by"
+ },
+ {
+ "name": "sender_id",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Optional sender ID to filter by",
+ "title": "Sender Id"
+ },
+ "description": "Optional sender ID to filter by"
+ },
+ {
+ "name": "session_id",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Optional session ID to filter by",
+ "title": "Session Id"
+ },
+ "description": "Optional session ID to filter by"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DeriverStatus"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst deriverStatus = await client.workspaces.deriverStatus('workspace_id');\n\nconsole.log(deriverStatus.completed_work_units);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nderiver_status = client.workspaces.deriver_status(\n workspace_id=\"workspace_id\",\n)\nprint(deriver_status.completed_work_units)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/peers/list": {
+ "post": {
+ "tags": ["peers"],
+ "summary": "Get Peers",
+ "description": "Get All Peers for a Workspace",
+ "operationId": "get_peers_v2_workspaces__workspace_id__peers_list_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "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"
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/PeerGet"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Filtering options for the peers list",
+ "title": "Options"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Page_Peer_"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const peer of client.workspaces.peers.list('workspace_id')) {\n console.log(peer.id);\n}"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\npage = client.workspaces.peers.list(\n workspace_id=\"workspace_id\",\n)\npage = page.items[0]\nprint(page.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/peers": {
+ "post": {
+ "tags": ["peers"],
+ "summary": "Get Or Create Peer",
+ "description": "Get a Peer by ID\n\nIf peer_id is provided as a query parameter, it uses that (must match JWT workspace_id).\nOtherwise, it uses the peer_id from the JWT.",
+ "operationId": "get_or_create_peer_v2_workspaces__workspace_id__peers_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PeerCreate",
+ "description": "Peer creation parameters"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Peer"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst peer = await client.workspaces.peers.getOrCreate('workspace_id', { id: 'id' });\n\nconsole.log(peer.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\npeer = client.workspaces.peers.get_or_create(\n workspace_id=\"workspace_id\",\n id=\"id\",\n)\nprint(peer.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/peers/{peer_id}": {
+ "put": {
+ "tags": ["peers"],
+ "summary": "Update Peer",
+ "description": "Update a Peer's name and/or metadata",
+ "operationId": "update_peer_v2_workspaces__workspace_id__peers__peer_id__put",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "peer_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the peer to update",
+ "title": "Peer Id"
+ },
+ "description": "ID of the peer to update"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PeerUpdate",
+ "description": "Updated peer parameters"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Peer"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst peer = await client.workspaces.peers.update('workspace_id', 'peer_id');\n\nconsole.log(peer.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\npeer = client.workspaces.peers.update(\n peer_id=\"peer_id\",\n workspace_id=\"workspace_id\",\n)\nprint(peer.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/peers/{peer_id}/sessions": {
+ "post": {
+ "tags": ["peers"],
+ "summary": "Get Sessions For Peer",
+ "description": "Get All Sessions for a Peer",
+ "operationId": "get_sessions_for_peer_v2_workspaces__workspace_id__peers__peer_id__sessions_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "peer_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the peer",
+ "title": "Peer Id"
+ },
+ "description": "ID of the peer"
+ },
+ {
+ "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"
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/SessionGet"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Filtering options for the sessions list",
+ "title": "Options"
+ }
+ }
+ }
+ },
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const session of client.workspaces.peers.sessions.list('workspace_id', 'peer_id')) {\n console.log(session.id);\n}"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\npage = client.workspaces.peers.sessions.list(\n peer_id=\"peer_id\",\n workspace_id=\"workspace_id\",\n)\npage = page.items[0]\nprint(page.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/peers/{peer_id}/chat": {
+ "post": {
+ "tags": ["peers"],
+ "summary": "Chat",
+ "operationId": "chat_v2_workspaces__workspace_id__peers__peer_id__chat_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "peer_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the peer",
+ "title": "Peer Id"
+ },
+ "description": "ID of the peer"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DialecticOptions",
+ "description": "Dialectic Endpoint Parameters"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Response to a question informed by Honcho's User Representation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "content": {
+ "title": "Content",
+ "type": "string"
+ }
+ },
+ "required": ["content"],
+ "title": "DialecticResponse",
+ "type": "object"
+ }
+ },
+ "text/event-stream": {}
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst response = await client.workspaces.peers.chat('workspace_id', 'peer_id', { query: 'x' });\n\nconsole.log(response.content);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nresponse = client.workspaces.peers.chat(\n peer_id=\"peer_id\",\n workspace_id=\"workspace_id\",\n query=\"x\",\n)\nprint(response.content)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/peers/{peer_id}/representation": {
+ "post": {
+ "tags": ["peers"],
+ "summary": "Get Working Representation",
+ "description": "Get a peer's working representation for a session.\n\nIf a session_id is provided in the body, we get the working representation of the peer in that session.\nIf a target is provided, we get the representation of the target from the perspective of the peer.\nIf no target is provided, we get the omniscient Honcho representation of the peer.",
+ "operationId": "get_working_representation_v2_workspaces__workspace_id__peers__peer_id__representation_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "peer_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the peer",
+ "title": "Peer Id"
+ },
+ "description": "ID of the peer"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PeerRepresentationGet",
+ "description": "Options for getting the peer representation"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "additionalProperties": true,
+ "title": "Response Get Working Representation V2 Workspaces Workspace Id Peers Peer Id Representation Post"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst response = await client.workspaces.peers.workingRepresentation('workspace_id', 'peer_id');\n\nconsole.log(response);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nresponse = client.workspaces.peers.working_representation(\n peer_id=\"peer_id\",\n workspace_id=\"workspace_id\",\n)\nprint(response)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/peers/{peer_id}/card": {
+ "get": {
+ "tags": ["peers"],
+ "summary": "Get Peer Card",
+ "description": "Get a peer card for a specific peer relationship.\n\nReturns the peer card that the observer peer has for the target peer if it exists.\nIf no target is specified, returns the observer's own peer card.",
+ "operationId": "get_peer_card_v2_workspaces__workspace_id__peers__peer_id__card_get",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "peer_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the observer peer",
+ "title": "Peer Id"
+ },
+ "description": "ID of the observer peer"
+ },
+ {
+ "name": "target",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The peer whose card to retrieve. If not provided, returns the observer's own card",
+ "title": "Target"
+ },
+ "description": "The peer whose card to retrieve. If not provided, returns the observer's own card"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PeerCardResponse"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst response = await client.workspaces.peers.card('workspace_id', 'peer_id');\n\nconsole.log(response.peer_card);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nresponse = client.workspaces.peers.card(\n peer_id=\"peer_id\",\n workspace_id=\"workspace_id\",\n)\nprint(response.peer_card)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/peers/{peer_id}/search": {
+ "post": {
+ "tags": ["peers"],
+ "summary": "Search Peer",
+ "description": "Search a Peer",
+ "operationId": "search_peer_v2_workspaces__workspace_id__peers__peer_id__search_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "peer_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the peer",
+ "title": "Peer Id"
+ },
+ "description": "ID of the peer"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MessageSearchOptions",
+ "description": "Message search parameters "
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
+ "title": "Response Search Peer V2 Workspaces Workspace Id Peers Peer Id Search Post"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst messages = await client.workspaces.peers.search('workspace_id', 'peer_id', { query: 'query' });\n\nconsole.log(messages);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nmessages = client.workspaces.peers.search(\n peer_id=\"peer_id\",\n workspace_id=\"workspace_id\",\n query=\"query\",\n)\nprint(messages)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions": {
+ "post": {
+ "tags": ["sessions"],
+ "summary": "Get Or Create Session",
+ "description": "Get a specific session in a workspace.\n\nIf session_id is provided as a query parameter, it verifies the session is in the workspace.\nOtherwise, it uses the session_id from the JWT for verification.",
+ "operationId": "get_or_create_session_v2_workspaces__workspace_id__sessions_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SessionCreate",
+ "description": "Session creation parameters"
+ }
+ }
+ }
+ },
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst session = await client.workspaces.sessions.getOrCreate('workspace_id', { id: 'id' });\n\nconsole.log(session.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nsession = client.workspaces.sessions.get_or_create(\n workspace_id=\"workspace_id\",\n id=\"id\",\n)\nprint(session.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions/list": {
+ "post": {
+ "tags": ["sessions"],
+ "summary": "Get Sessions",
+ "description": "Get All Sessions in a Workspace",
+ "operationId": "get_sessions_v2_workspaces__workspace_id__sessions_list_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "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"
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/SessionGet"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Filtering and pagination options for the sessions list",
+ "title": "Options"
+ }
+ }
+ }
+ },
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const session of client.workspaces.sessions.list('workspace_id')) {\n console.log(session.id);\n}"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\npage = client.workspaces.sessions.list(\n workspace_id=\"workspace_id\",\n)\npage = page.items[0]\nprint(page.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions/{session_id}": {
+ "put": {
+ "tags": ["sessions"],
+ "summary": "Update Session",
+ "description": "Update the metadata of a Session",
+ "operationId": "update_session_v2_workspaces__workspace_id__sessions__session_id__put",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session to update",
+ "title": "Session Id"
+ },
+ "description": "ID of the session to update"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SessionUpdate",
+ "description": "Updated session parameters"
+ }
+ }
+ }
+ },
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst session = await client.workspaces.sessions.update('workspace_id', 'session_id');\n\nconsole.log(session.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nsession = client.workspaces.sessions.update(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n)\nprint(session.id)"
+ }
+ ]
+ },
+ "delete": {
+ "tags": ["sessions"],
+ "summary": "Delete Session",
+ "description": "Delete a session by marking it as inactive",
+ "operationId": "delete_session_v2_workspaces__workspace_id__sessions__session_id__delete",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session to delete",
+ "title": "Session Id"
+ },
+ "description": "ID of the session to delete"
+ }
+ ],
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst session = await client.workspaces.sessions.delete('workspace_id', 'session_id');\n\nconsole.log(session);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nsession = client.workspaces.sessions.delete(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n)\nprint(session)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions/{session_id}/clone": {
+ "get": {
+ "tags": ["sessions"],
+ "summary": "Clone Session",
+ "description": "Clone a session, optionally up to a specific message",
+ "operationId": "clone_session_v2_workspaces__workspace_id__sessions__session_id__clone_get",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session to clone",
+ "title": "Session Id"
+ },
+ "description": "ID of the session to clone"
+ },
+ {
+ "name": "message_id",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Message ID to cut off the clone at",
+ "title": "Message Id"
+ },
+ "description": "Message ID to cut off the clone at"
+ }
+ ],
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst session = await client.workspaces.sessions.clone('workspace_id', 'session_id');\n\nconsole.log(session.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nsession = client.workspaces.sessions.clone(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n)\nprint(session.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions/{session_id}/peers": {
+ "post": {
+ "tags": ["sessions"],
+ "summary": "Add Peers To Session",
+ "description": "Add peers to a session",
+ "operationId": "add_peers_to_session_v2_workspaces__workspace_id__sessions__session_id__peers_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session",
+ "title": "Session Id"
+ },
+ "description": "ID of the session"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/SessionPeerConfig"
+ },
+ "description": "List of peer IDs to add to the session",
+ "title": "Peers"
+ }
+ }
+ }
+ },
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst session = await client.workspaces.sessions.peers.add('workspace_id', 'session_id', { foo: {} });\n\nconsole.log(session.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nsession = client.workspaces.sessions.peers.add(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n body={\n \"foo\": {}\n },\n)\nprint(session.id)"
+ }
+ ]
+ },
+ "put": {
+ "tags": ["sessions"],
+ "summary": "Set Session Peers",
+ "description": "Set the peers in a session",
+ "operationId": "set_session_peers_v2_workspaces__workspace_id__sessions__session_id__peers_put",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session",
+ "title": "Session Id"
+ },
+ "description": "ID of the session"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/SessionPeerConfig"
+ },
+ "description": "List of peer IDs to set for the session",
+ "title": "Peers"
+ }
+ }
+ }
+ },
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst session = await client.workspaces.sessions.peers.set('workspace_id', 'session_id', { foo: {} });\n\nconsole.log(session.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nsession = client.workspaces.sessions.peers.set(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n body={\n \"foo\": {}\n },\n)\nprint(session.id)"
+ }
+ ]
+ },
+ "delete": {
+ "tags": ["sessions"],
+ "summary": "Remove Peers From Session",
+ "description": "Remove peers from a session",
+ "operationId": "remove_peers_from_session_v2_workspaces__workspace_id__sessions__session_id__peers_delete",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session",
+ "title": "Session Id"
+ },
+ "description": "ID of the session"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "List of peer IDs to remove from the session",
+ "title": "Peers"
+ }
+ }
+ }
+ },
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst session = await client.workspaces.sessions.peers.remove('workspace_id', 'session_id', ['string']);\n\nconsole.log(session.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nsession = client.workspaces.sessions.peers.remove(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n body=[\"string\"],\n)\nprint(session.id)"
+ }
+ ]
+ },
+ "get": {
+ "tags": ["sessions"],
+ "summary": "Get Session Peers",
+ "description": "Get peers from a session",
+ "operationId": "get_session_peers_v2_workspaces__workspace_id__sessions__session_id__peers_get",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session",
+ "title": "Session Id"
+ },
+ "description": "ID of the session"
+ },
+ {
+ "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_Peer_"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const peer of client.workspaces.sessions.peers.list('workspace_id', 'session_id')) {\n console.log(peer.id);\n}"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\npage = client.workspaces.sessions.peers.list(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n)\npage = page.items[0]\nprint(page.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions/{session_id}/peers/{peer_id}/config": {
+ "get": {
+ "tags": ["sessions"],
+ "summary": "Get Peer Config",
+ "description": "Get the configuration for a peer in a session",
+ "operationId": "get_peer_config_v2_workspaces__workspace_id__sessions__session_id__peers__peer_id__config_get",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session",
+ "title": "Session Id"
+ },
+ "description": "ID of the session"
+ },
+ {
+ "name": "peer_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the peer",
+ "title": "Peer Id"
+ },
+ "description": "ID of the peer"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SessionPeerConfig"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst sessionPeerConfig = await client.workspaces.sessions.peers.getConfig(\n 'workspace_id',\n 'session_id',\n 'peer_id',\n);\n\nconsole.log(sessionPeerConfig.observe_me);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nsession_peer_config = client.workspaces.sessions.peers.get_config(\n peer_id=\"peer_id\",\n workspace_id=\"workspace_id\",\n session_id=\"session_id\",\n)\nprint(session_peer_config.observe_me)"
+ }
+ ]
+ },
+ "post": {
+ "tags": ["sessions"],
+ "summary": "Set Peer Config",
+ "description": "Set the configuration for a peer in a session",
+ "operationId": "set_peer_config_v2_workspaces__workspace_id__sessions__session_id__peers__peer_id__config_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session",
+ "title": "Session Id"
+ },
+ "description": "ID of the session"
+ },
+ {
+ "name": "peer_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the peer",
+ "title": "Peer Id"
+ },
+ "description": "ID of the peer"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SessionPeerConfig",
+ "description": "Peer configuration"
+ }
+ }
+ }
+ },
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst response = await client.workspaces.sessions.peers.setConfig('workspace_id', 'session_id', 'peer_id');\n\nconsole.log(response);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nresponse = client.workspaces.sessions.peers.set_config(\n peer_id=\"peer_id\",\n workspace_id=\"workspace_id\",\n session_id=\"session_id\",\n)\nprint(response)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions/{session_id}/context": {
+ "get": {
+ "tags": ["sessions"],
+ "summary": "Get Session Context",
+ "description": "Produce a context object from the session. The caller provides an optional token limit which the entire context must fit into.\nIf not provided, the context will be exhaustive (within configured max tokens). To do this, we allocate 40% of the token limit\nto the summary, and 60% to recent messages -- as many as can fit. Note that the summary will usually take up less space than\nthis. If the caller does not want a summary, we allocate all the tokens to recent messages.",
+ "operationId": "get_session_context_v2_workspaces__workspace_id__sessions__session_id__context_get",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session",
+ "title": "Session Id"
+ },
+ "description": "ID of the session"
+ },
+ {
+ "name": "tokens",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "integer",
+ "maximum": 100000
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Number of tokens to use for the context. Includes summary if set to true. Includes representation and peer card if they are included in the response. If not provided, the context will be exhaustive (within 100000 tokens)",
+ "title": "Tokens"
+ },
+ "description": "Number of tokens to use for the context. Includes summary if set to true. Includes representation and peer card if they are included in the response. If not provided, the context will be exhaustive (within 100000 tokens)"
+ },
+ {
+ "name": "last_message",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The most recent message, used to fetch semantically relevant observations",
+ "title": "Last Message"
+ },
+ "description": "The most recent message, used to fetch semantically relevant observations"
+ },
+ {
+ "name": "summary",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "boolean",
+ "description": "Whether or not to include a summary *if* one is available for the session",
+ "default": true,
+ "title": "Summary"
+ },
+ "description": "Whether or not to include a summary *if* one is available for the session"
+ },
+ {
+ "name": "peer_target",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The target of the perspective. If given without `peer_perspective`, will get the Honcho-level representation and peer card for this peer. If given with `peer_perspective`, will get the representation and card for this peer *from the perspective of that peer*.",
+ "title": "Peer Target"
+ },
+ "description": "The target of the perspective. If given without `peer_perspective`, will get the Honcho-level representation and peer card for this peer. If given with `peer_perspective`, will get the representation and card for this peer *from the perspective of that peer*."
+ },
+ {
+ "name": "peer_perspective",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "A peer to get context for. If given, response will attempt to include representation and card from the perspective of that peer. Must be provided with `peer_target`.",
+ "title": "Peer Perspective"
+ },
+ "description": "A peer to get context for. If given, response will attempt to include representation and card from the perspective of that peer. Must be provided with `peer_target`."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SessionContext"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst response = await client.workspaces.sessions.getContext('workspace_id', 'session_id');\n\nconsole.log(response.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nresponse = client.workspaces.sessions.get_context(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n)\nprint(response.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions/{session_id}/summaries": {
+ "get": {
+ "tags": ["sessions"],
+ "summary": "Get Session Summaries",
+ "description": "Get available summaries for a session.\n\nReturns both short and long summaries if available, including metadata like\nthe message ID they cover up to, creation timestamp, and token count.",
+ "operationId": "get_session_summaries_v2_workspaces__workspace_id__sessions__session_id__summaries_get",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session",
+ "title": "Session Id"
+ },
+ "description": "ID of the session"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SessionSummaries"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst response = await client.workspaces.sessions.summaries('workspace_id', 'session_id');\n\nconsole.log(response.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nresponse = client.workspaces.sessions.summaries(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n)\nprint(response.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions/{session_id}/search": {
+ "post": {
+ "tags": ["sessions"],
+ "summary": "Search Session",
+ "description": "Search a Session",
+ "operationId": "search_session_v2_workspaces__workspace_id__sessions__session_id__search_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session",
+ "title": "Session Id"
+ },
+ "description": "ID of the session"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MessageSearchOptions",
+ "description": "Message search parameters"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
+ "title": "Response Search Session V2 Workspaces Workspace Id Sessions Session Id Search Post"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst messages = await client.workspaces.sessions.search('workspace_id', 'session_id', { query: 'query' });\n\nconsole.log(messages);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nmessages = client.workspaces.sessions.search(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n query=\"query\",\n)\nprint(messages)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions/{session_id}/messages/": {
+ "post": {
+ "tags": ["messages"],
+ "summary": "Create Messages For Session",
+ "description": "Create messages for a session with JSON data (original functionality).",
+ "operationId": "create_messages_for_session_v2_workspaces__workspace_id__sessions__session_id__messages__post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "title": "Workspace Id"
+ }
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "title": "Session Id"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MessageBatchCreate"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
+ "title": "Response Create Messages For Session V2 Workspaces Workspace Id Sessions Session Id Messages Post"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst messages = await client.workspaces.sessions.messages.create('workspace_id', 'session_id', {\n messages: [{ content: 'content', peer_id: 'peer_id' }],\n});\n\nconsole.log(messages);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nmessages = client.workspaces.sessions.messages.create(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n messages=[{\n \"content\": \"content\",\n \"peer_id\": \"peer_id\",\n }],\n)\nprint(messages)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions/{session_id}/messages/upload": {
+ "post": {
+ "tags": ["messages"],
+ "summary": "Create Messages With File",
+ "description": "Create messages from uploaded files. Files are converted to text and split into multiple messages.",
+ "operationId": "create_messages_with_file_v2_workspaces__workspace_id__sessions__session_id__messages_upload_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "title": "Workspace Id"
+ }
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "title": "Session Id"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/Body_create_messages_with_file_v2_workspaces__workspace_id__sessions__session_id__messages_upload_post"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
+ "title": "Response Create Messages With File V2 Workspaces Workspace Id Sessions Session Id Messages Upload Post"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst messages = await client.workspaces.sessions.messages.upload('workspace_id', 'session_id', {\n file: fs.createReadStream('path/to/file'),\n peer_id: 'peer_id',\n});\n\nconsole.log(messages);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nmessages = client.workspaces.sessions.messages.upload(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n file=b\"raw file contents\",\n peer_id=\"peer_id\",\n)\nprint(messages)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions/{session_id}/messages/list": {
+ "post": {
+ "tags": ["messages"],
+ "summary": "Get Messages",
+ "description": "Get all messages for a session",
+ "operationId": "get_messages_v2_workspaces__workspace_id__sessions__session_id__messages_list_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session",
+ "title": "Session Id"
+ },
+ "description": "ID of the session"
+ },
+ {
+ "name": "reverse",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Whether to reverse the order of results",
+ "default": false,
+ "title": "Reverse"
+ },
+ "description": "Whether to reverse the order of results"
+ },
+ {
+ "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"
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/MessageGet"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Filtering options for the messages list",
+ "title": "Options"
+ }
+ }
+ }
+ },
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.workspaces.sessions.messages.list('workspace_id', 'session_id')) {\n console.log(message.id);\n}"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\npage = client.workspaces.sessions.messages.list(\n session_id=\"session_id\",\n workspace_id=\"workspace_id\",\n)\npage = page.items[0]\nprint(page.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/sessions/{session_id}/messages/{message_id}": {
+ "get": {
+ "tags": ["messages"],
+ "summary": "Get Message",
+ "description": "Get a Message by ID",
+ "operationId": "get_message_v2_workspaces__workspace_id__sessions__session_id__messages__message_id__get",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session",
+ "title": "Session Id"
+ },
+ "description": "ID of the session"
+ },
+ {
+ "name": "message_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the message to retrieve",
+ "title": "Message Id"
+ },
+ "description": "ID of the message to retrieve"
+ }
+ ],
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst message = await client.workspaces.sessions.messages.retrieve(\n 'workspace_id',\n 'session_id',\n 'message_id',\n);\n\nconsole.log(message.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nmessage = client.workspaces.sessions.messages.retrieve(\n message_id=\"message_id\",\n workspace_id=\"workspace_id\",\n session_id=\"session_id\",\n)\nprint(message.id)"
+ }
+ ]
+ },
+ "put": {
+ "tags": ["messages"],
+ "summary": "Update Message",
+ "description": "Update the metadata of a Message",
+ "operationId": "update_message_v2_workspaces__workspace_id__sessions__session_id__messages__message_id__put",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the workspace",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace"
+ },
+ {
+ "name": "session_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the session",
+ "title": "Session Id"
+ },
+ "description": "ID of the session"
+ },
+ {
+ "name": "message_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "ID of the message to update",
+ "title": "Message Id"
+ },
+ "description": "ID of the message to update"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MessageUpdate",
+ "description": "Updated message parameters"
+ }
+ }
+ }
+ },
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst message = await client.workspaces.sessions.messages.update('workspace_id', 'session_id', 'message_id');\n\nconsole.log(message.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nmessage = client.workspaces.sessions.messages.update(\n message_id=\"message_id\",\n workspace_id=\"workspace_id\",\n session_id=\"session_id\",\n)\nprint(message.id)"
+ }
+ ]
+ }
+ },
+ "/v2/keys": {
+ "post": {
+ "tags": ["keys"],
+ "summary": "Create Key",
+ "description": "Create a new Key",
+ "operationId": "create_key_v2_keys_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "ID of the workspace to scope the key to",
+ "title": "Workspace Id"
+ },
+ "description": "ID of the workspace to scope the key to"
+ },
+ {
+ "name": "peer_id",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "ID of the peer to scope the key to",
+ "title": "Peer Id"
+ },
+ "description": "ID of the peer to scope the key to"
+ },
+ {
+ "name": "session_id",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "ID of the session to scope the key to",
+ "title": "Session Id"
+ },
+ "description": "ID of the session to scope the key to"
+ },
+ {
+ "name": "expires_at",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Expires At"
+ }
+ }
+ ],
+ "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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst key = await client.keys.create();\n\nconsole.log(key);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nkey = client.keys.create()\nprint(key)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/webhooks": {
+ "post": {
+ "tags": ["webhooks"],
+ "summary": "Get Or Create Webhook Endpoint",
+ "description": "Get or create a webhook endpoint URL.",
+ "operationId": "get_or_create_webhook_endpoint_v2_workspaces__workspace_id__webhooks_post",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "Workspace ID",
+ "title": "Workspace Id"
+ },
+ "description": "Workspace ID"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/WebhookEndpointCreate",
+ "description": "Webhook endpoint parameters"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/WebhookEndpoint"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst webhookEndpoint = await client.workspaces.webhooks.getOrCreate('workspace_id', { url: 'url' });\n\nconsole.log(webhookEndpoint.id);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nwebhook_endpoint = client.workspaces.webhooks.get_or_create(\n workspace_id=\"workspace_id\",\n url=\"url\",\n)\nprint(webhook_endpoint.id)"
+ }
+ ]
+ },
+ "get": {
+ "tags": ["webhooks"],
+ "summary": "List Webhook Endpoints",
+ "description": "List all webhook endpoints, optionally filtered by workspace.",
+ "operationId": "list_webhook_endpoints_v2_workspaces__workspace_id__webhooks_get",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "Workspace ID",
+ "title": "Workspace Id"
+ },
+ "description": "Workspace ID"
+ },
+ {
+ "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_WebhookEndpoint_"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "JavaScript",
+ "source": "import Honcho from '@honcho-ai/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const webhookEndpoint of client.workspaces.webhooks.list('workspace_id')) {\n console.log(webhookEndpoint.id);\n}"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\npage = client.workspaces.webhooks.list(\n workspace_id=\"workspace_id\",\n)\npage = page.items[0]\nprint(page.id)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/webhooks/{endpoint_id}": {
+ "delete": {
+ "tags": ["webhooks"],
+ "summary": "Delete Webhook Endpoint",
+ "description": "Delete a specific webhook endpoint.",
+ "operationId": "delete_webhook_endpoint_v2_workspaces__workspace_id__webhooks__endpoint_id__delete",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "Workspace ID",
+ "title": "Workspace Id"
+ },
+ "description": "Workspace ID"
+ },
+ {
+ "name": "endpoint_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "Webhook endpoint ID",
+ "title": "Endpoint Id"
+ },
+ "description": "Webhook endpoint 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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst webhook = await client.workspaces.webhooks.delete('workspace_id', 'endpoint_id');\n\nconsole.log(webhook);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nwebhook = client.workspaces.webhooks.delete(\n endpoint_id=\"endpoint_id\",\n workspace_id=\"workspace_id\",\n)\nprint(webhook)"
+ }
+ ]
+ }
+ },
+ "/v2/workspaces/{workspace_id}/webhooks/test": {
+ "get": {
+ "tags": ["webhooks"],
+ "summary": "Test Emit",
+ "description": "Test publishing a webhook event.",
+ "operationId": "test_emit_v2_workspaces__workspace_id__webhooks_test_get",
+ "security": [
+ {
+ "HTTPBearer": []
+ },
+ {}
+ ],
+ "parameters": [
+ {
+ "name": "workspace_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "Workspace ID",
+ "title": "Workspace Id"
+ },
+ "description": "Workspace 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/core';\n\nconst client = new Honcho({\n apiKey: 'My API Key',\n});\n\nconst response = await client.workspaces.webhooks.testEmit('workspace_id');\n\nconsole.log(response);"
+ },
+ {
+ "lang": "Python",
+ "source": "from honcho_core import Honcho\n\nclient = Honcho(\n api_key=\"My API Key\",\n)\nresponse = client.workspaces.webhooks.test_emit(\n \"workspace_id\",\n)\nprint(response)"
+ }
+ ]
+ }
+ },
+ "/metrics": {
+ "get": {
+ "summary": "Metrics",
+ "description": "Prometheus metrics endpoint",
+ "operationId": "metrics_metrics_get",
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "Body_create_messages_with_file_v2_workspaces__workspace_id__sessions__session_id__messages_upload_post": {
+ "properties": {
+ "file": {
+ "type": "string",
+ "format": "binary",
+ "title": "File"
+ },
+ "peer_id": {
+ "type": "string",
+ "title": "Peer Id"
+ }
+ },
+ "type": "object",
+ "required": ["file", "peer_id"],
+ "title": "Body_create_messages_with_file_v2_workspaces__workspace_id__sessions__session_id__messages_upload_post"
+ },
+ "DeductiveObservation": {
+ "properties": {
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Created At"
+ },
+ "message_ids": {
+ "items": {
+ "prefixItems": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "integer"
+ }
+ ],
+ "type": "array",
+ "maxItems": 2,
+ "minItems": 2
+ },
+ "type": "array",
+ "title": "Message Ids"
+ },
+ "session_name": {
+ "type": "string",
+ "title": "Session Name"
+ },
+ "premises": {
+ "items": {
+ "type": "string"
+ },
+ "type": "array",
+ "title": "Premises",
+ "description": "Supporting premises or evidence for this conclusion"
+ },
+ "conclusion": {
+ "type": "string",
+ "title": "Conclusion",
+ "description": "The deductive conclusion"
+ }
+ },
+ "type": "object",
+ "required": ["created_at", "message_ids", "session_name", "conclusion"],
+ "title": "DeductiveObservation",
+ "description": "Deductive observation with multiple premises and one conclusion, plus metadata."
+ },
+ "DeriverStatus": {
+ "properties": {
+ "total_work_units": {
+ "type": "integer",
+ "title": "Total Work Units",
+ "description": "Total work units"
+ },
+ "completed_work_units": {
+ "type": "integer",
+ "title": "Completed Work Units",
+ "description": "Completed work units"
+ },
+ "in_progress_work_units": {
+ "type": "integer",
+ "title": "In Progress Work Units",
+ "description": "Work units currently being processed"
+ },
+ "pending_work_units": {
+ "type": "integer",
+ "title": "Pending Work Units",
+ "description": "Work units waiting to be processed"
+ },
+ "sessions": {
+ "anyOf": [
+ {
+ "additionalProperties": {
+ "$ref": "#/components/schemas/SessionDeriverStatus"
+ },
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Sessions",
+ "description": "Per-session status when not filtered by session"
+ }
+ },
+ "type": "object",
+ "required": [
+ "total_work_units",
+ "completed_work_units",
+ "in_progress_work_units",
+ "pending_work_units"
+ ],
+ "title": "DeriverStatus"
+ },
+ "DialecticOptions": {
+ "properties": {
+ "session_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Session Id",
+ "description": "ID of the session to scope the representation to"
+ },
+ "target": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Target",
+ "description": "Optional peer to get the representation for, from the perspective of this peer"
+ },
+ "query": {
+ "type": "string",
+ "maxLength": 10000,
+ "minLength": 1,
+ "title": "Query",
+ "description": "Dialectic API Prompt"
+ },
+ "stream": {
+ "type": "boolean",
+ "title": "Stream",
+ "default": false
+ }
+ },
+ "type": "object",
+ "required": ["query"],
+ "title": "DialecticOptions"
+ },
+ "ExplicitObservation": {
+ "properties": {
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Created At"
+ },
+ "message_ids": {
+ "items": {
+ "prefixItems": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "integer"
+ }
+ ],
+ "type": "array",
+ "maxItems": 2,
+ "minItems": 2
+ },
+ "type": "array",
+ "title": "Message Ids"
+ },
+ "session_name": {
+ "type": "string",
+ "title": "Session Name"
+ },
+ "content": {
+ "type": "string",
+ "title": "Content",
+ "description": "The explicit observation"
+ }
+ },
+ "type": "object",
+ "required": ["created_at", "message_ids", "session_name", "content"],
+ "title": "ExplicitObservation",
+ "description": "Explicit observation with content and metadata."
+ },
+ "HTTPValidationError": {
+ "properties": {
+ "detail": {
+ "items": {
+ "$ref": "#/components/schemas/ValidationError"
+ },
+ "type": "array",
+ "title": "Detail"
+ }
+ },
+ "type": "object",
+ "title": "HTTPValidationError"
+ },
+ "Message": {
+ "properties": {
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
+ "content": {
+ "type": "string",
+ "title": "Content"
+ },
+ "peer_id": {
+ "type": "string",
+ "title": "Peer Id"
+ },
+ "session_id": {
+ "type": "string",
+ "title": "Session Id"
+ },
+ "metadata": {
+ "additionalProperties": true,
+ "type": "object",
+ "title": "Metadata"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Created At"
+ },
+ "workspace_id": {
+ "type": "string",
+ "title": "Workspace Id"
+ },
+ "token_count": {
+ "type": "integer",
+ "title": "Token Count"
+ }
+ },
+ "type": "object",
+ "required": [
+ "id",
+ "content",
+ "peer_id",
+ "session_id",
+ "created_at",
+ "workspace_id",
+ "token_count"
+ ],
+ "title": "Message"
+ },
+ "MessageBatchCreate": {
+ "properties": {
+ "messages": {
+ "items": {
+ "$ref": "#/components/schemas/MessageCreate"
+ },
+ "type": "array",
+ "maxItems": 100,
+ "minItems": 1,
+ "title": "Messages"
+ }
+ },
+ "type": "object",
+ "required": ["messages"],
+ "title": "MessageBatchCreate",
+ "description": "Schema for batch message creation with a max of 100 messages"
+ },
+ "MessageCreate": {
+ "properties": {
+ "content": {
+ "type": "string",
+ "maxLength": 25000,
+ "minLength": 0,
+ "title": "Content"
+ },
+ "peer_id": {
+ "type": "string",
+ "title": "Peer Id"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Metadata"
+ },
+ "created_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Created At"
+ }
+ },
+ "type": "object",
+ "required": ["content", "peer_id"],
+ "title": "MessageCreate"
+ },
+ "MessageGet": {
+ "properties": {
+ "filters": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Filters"
+ }
+ },
+ "type": "object",
+ "title": "MessageGet"
+ },
+ "MessageSearchOptions": {
+ "properties": {
+ "query": {
+ "type": "string",
+ "title": "Query",
+ "description": "Search query"
+ },
+ "filters": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Filters",
+ "description": "Filters to scope the search"
+ },
+ "limit": {
+ "type": "integer",
+ "maximum": 100,
+ "minimum": 1,
+ "title": "Limit",
+ "description": "Number of results to return",
+ "default": 10
+ }
+ },
+ "type": "object",
+ "required": ["query"],
+ "title": "MessageSearchOptions"
+ },
+ "MessageUpdate": {
+ "properties": {
+ "metadata": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Metadata"
+ }
+ },
+ "type": "object",
+ "title": "MessageUpdate"
+ },
+ "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", "page", "size"],
+ "title": "Page[Message]"
+ },
+ "Page_Peer_": {
+ "properties": {
+ "items": {
+ "items": {
+ "$ref": "#/components/schemas/Peer"
+ },
+ "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", "page", "size"],
+ "title": "Page[Peer]"
+ },
+ "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", "page", "size"],
+ "title": "Page[Session]"
+ },
+ "Page_WebhookEndpoint_": {
+ "properties": {
+ "items": {
+ "items": {
+ "$ref": "#/components/schemas/WebhookEndpoint"
+ },
+ "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", "page", "size"],
+ "title": "Page[WebhookEndpoint]"
+ },
+ "Page_Workspace_": {
+ "properties": {
+ "items": {
+ "items": {
+ "$ref": "#/components/schemas/Workspace"
+ },
+ "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", "page", "size"],
+ "title": "Page[Workspace]"
+ },
+ "Peer": {
+ "properties": {
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
+ "workspace_id": {
+ "type": "string",
+ "title": "Workspace Id"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Created At"
+ },
+ "metadata": {
+ "additionalProperties": true,
+ "type": "object",
+ "title": "Metadata"
+ },
+ "configuration": {
+ "additionalProperties": true,
+ "type": "object",
+ "title": "Configuration"
+ }
+ },
+ "type": "object",
+ "required": ["id", "workspace_id", "created_at"],
+ "title": "Peer"
+ },
+ "PeerCardResponse": {
+ "properties": {
+ "peer_card": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Peer Card",
+ "description": "The peer card content, or None if not found"
+ }
+ },
+ "type": "object",
+ "title": "PeerCardResponse"
+ },
+ "PeerCreate": {
+ "properties": {
+ "id": {
+ "type": "string",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "^[a-zA-Z0-9_-]+$",
+ "title": "Id"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Metadata"
+ },
+ "configuration": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Configuration"
+ }
+ },
+ "type": "object",
+ "required": ["id"],
+ "title": "PeerCreate"
+ },
+ "PeerGet": {
+ "properties": {
+ "filters": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Filters"
+ }
+ },
+ "type": "object",
+ "title": "PeerGet"
+ },
+ "PeerRepresentationGet": {
+ "properties": {
+ "session_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Session Id",
+ "description": "Get the working representation within this session"
+ },
+ "target": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Target",
+ "description": "Optional peer ID to get the representation for, from the perspective of this peer"
+ }
+ },
+ "type": "object",
+ "title": "PeerRepresentationGet"
+ },
+ "PeerUpdate": {
+ "properties": {
+ "metadata": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Metadata"
+ },
+ "configuration": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Configuration"
+ }
+ },
+ "type": "object",
+ "title": "PeerUpdate"
+ },
+ "Representation": {
+ "properties": {
+ "explicit": {
+ "items": {
+ "$ref": "#/components/schemas/ExplicitObservation"
+ },
+ "type": "array",
+ "title": "Explicit",
+ "description": "Facts LITERALLY stated by the user - direct quotes or clear paraphrases only, no interpretation or inference. Example: ['The user is 25 years old', 'The user has a dog']"
+ },
+ "deductive": {
+ "items": {
+ "$ref": "#/components/schemas/DeductiveObservation"
+ },
+ "type": "array",
+ "title": "Deductive",
+ "description": "Conclusions that MUST be true given explicit facts and premises - strict logical necessities. Each deduction should have premises and a single conclusion."
+ }
+ },
+ "type": "object",
+ "title": "Representation",
+ "description": "A Representation is a traversable and diffable map of observations.\nAt the base, we have a list of explicit observations, derived from a peer's messages.\n\nFrom there, deductive observations can be made by establishing logical relationships between explicit observations.\n\nIn the future, we can add more levels of reasoning on top of these.\n\nAll of a peer's observations are stored as documents in a collection. These documents can be queried in various ways\nto produce this Representation object.\n\nAdditionally, a \"working representation\" is a version of this data structure representing the most recent observations\nwithin a single session.\n\nA representation can have a maximum number of observations, which is applied individually to each level of reasoning.\nIf a maximum is set, observations are added and removed in FIFO order."
+ },
+ "Session": {
+ "properties": {
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
+ "is_active": {
+ "type": "boolean",
+ "title": "Is Active"
+ },
+ "workspace_id": {
+ "type": "string",
+ "title": "Workspace Id"
+ },
+ "metadata": {
+ "additionalProperties": true,
+ "type": "object",
+ "title": "Metadata"
+ },
+ "configuration": {
+ "additionalProperties": true,
+ "type": "object",
+ "title": "Configuration"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Created At"
+ }
+ },
+ "type": "object",
+ "required": ["id", "is_active", "workspace_id", "created_at"],
+ "title": "Session"
+ },
+ "SessionContext": {
+ "properties": {
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
+ "messages": {
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
+ "type": "array",
+ "title": "Messages"
+ },
+ "summary": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/Summary"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The summary if available"
+ },
+ "peer_representation": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/Representation"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The peer representation, if context is requested from a specific perspective"
+ },
+ "peer_card": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Peer Card",
+ "description": "The peer card, if context is requested from a specific perspective"
+ }
+ },
+ "type": "object",
+ "required": ["id", "messages"],
+ "title": "SessionContext"
+ },
+ "SessionCreate": {
+ "properties": {
+ "id": {
+ "type": "string",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "^[a-zA-Z0-9_-]+$",
+ "title": "Id"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Metadata"
+ },
+ "peers": {
+ "anyOf": [
+ {
+ "additionalProperties": {
+ "$ref": "#/components/schemas/SessionPeerConfig"
+ },
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Peers"
+ },
+ "configuration": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Configuration"
+ }
+ },
+ "type": "object",
+ "required": ["id"],
+ "title": "SessionCreate"
+ },
+ "SessionDeriverStatus": {
+ "properties": {
+ "session_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Session Id",
+ "description": "Session ID if filtered by session"
+ },
+ "total_work_units": {
+ "type": "integer",
+ "title": "Total Work Units",
+ "description": "Total work units"
+ },
+ "completed_work_units": {
+ "type": "integer",
+ "title": "Completed Work Units",
+ "description": "Completed work units"
+ },
+ "in_progress_work_units": {
+ "type": "integer",
+ "title": "In Progress Work Units",
+ "description": "Work units currently being processed"
+ },
+ "pending_work_units": {
+ "type": "integer",
+ "title": "Pending Work Units",
+ "description": "Work units waiting to be processed"
+ }
+ },
+ "type": "object",
+ "required": [
+ "total_work_units",
+ "completed_work_units",
+ "in_progress_work_units",
+ "pending_work_units"
+ ],
+ "title": "SessionDeriverStatus"
+ },
+ "SessionGet": {
+ "properties": {
+ "filters": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Filters"
+ }
+ },
+ "type": "object",
+ "title": "SessionGet"
+ },
+ "SessionPeerConfig": {
+ "properties": {
+ "observe_others": {
+ "type": "boolean",
+ "title": "Observe Others",
+ "description": "Whether this peer should form a session-level theory-of-mind representation of other peers in the session",
+ "default": false
+ },
+ "observe_me": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Observe Me",
+ "description": "Whether other peers in this session should try to form a session-level theory-of-mind representation of this peer"
+ }
+ },
+ "type": "object",
+ "title": "SessionPeerConfig"
+ },
+ "SessionSummaries": {
+ "properties": {
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
+ "short_summary": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/Summary"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The short summary if available"
+ },
+ "long_summary": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/Summary"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The long summary if available"
+ }
+ },
+ "type": "object",
+ "required": ["id"],
+ "title": "SessionSummaries"
+ },
+ "SessionUpdate": {
+ "properties": {
+ "metadata": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Metadata"
+ },
+ "configuration": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Configuration"
+ }
+ },
+ "type": "object",
+ "title": "SessionUpdate"
+ },
+ "Summary": {
+ "properties": {
+ "content": {
+ "type": "string",
+ "title": "Content",
+ "description": "The summary text"
+ },
+ "message_id": {
+ "type": "string",
+ "title": "Message Id",
+ "description": "The public ID of the message that this summary covers up to"
+ },
+ "summary_type": {
+ "type": "string",
+ "title": "Summary Type",
+ "description": "The type of summary (short or long)"
+ },
+ "created_at": {
+ "type": "string",
+ "title": "Created At",
+ "description": "The timestamp of when the summary was created (ISO format)"
+ },
+ "token_count": {
+ "type": "integer",
+ "title": "Token Count",
+ "description": "The number of tokens in the summary text"
+ }
+ },
+ "type": "object",
+ "required": [
+ "content",
+ "message_id",
+ "summary_type",
+ "created_at",
+ "token_count"
+ ],
+ "title": "Summary"
+ },
+ "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"
+ },
+ "WebhookEndpoint": {
+ "properties": {
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
+ "workspace_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Workspace Id"
+ },
+ "url": {
+ "type": "string",
+ "title": "Url"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Created At"
+ }
+ },
+ "type": "object",
+ "required": ["id", "workspace_id", "url", "created_at"],
+ "title": "WebhookEndpoint"
+ },
+ "WebhookEndpointCreate": {
+ "properties": {
+ "url": {
+ "type": "string",
+ "title": "Url"
+ }
+ },
+ "type": "object",
+ "required": ["url"],
+ "title": "WebhookEndpointCreate"
+ },
+ "Workspace": {
+ "properties": {
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
+ "metadata": {
+ "additionalProperties": true,
+ "type": "object",
+ "title": "Metadata"
+ },
+ "configuration": {
+ "additionalProperties": true,
+ "type": "object",
+ "title": "Configuration"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Created At"
+ }
+ },
+ "type": "object",
+ "required": ["id", "created_at"],
+ "title": "Workspace"
+ },
+ "WorkspaceCreate": {
+ "properties": {
+ "id": {
+ "type": "string",
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "^[a-zA-Z0-9_-]+$",
+ "title": "Id"
+ },
+ "metadata": {
+ "additionalProperties": true,
+ "type": "object",
+ "title": "Metadata",
+ "default": {}
+ },
+ "configuration": {
+ "additionalProperties": true,
+ "type": "object",
+ "title": "Configuration",
+ "default": {}
+ }
+ },
+ "type": "object",
+ "required": ["id"],
+ "title": "WorkspaceCreate"
+ },
+ "WorkspaceGet": {
+ "properties": {
+ "filters": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Filters"
+ }
+ },
+ "type": "object",
+ "title": "WorkspaceGet"
+ },
+ "WorkspaceUpdate": {
+ "properties": {
+ "metadata": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Metadata"
+ },
+ "configuration": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Configuration"
+ }
+ },
+ "type": "object",
+ "title": "WorkspaceUpdate"
+ }
+ },
+ "securitySchemes": {
+ "HTTPBearer": {
+ "type": "http",
+ "scheme": "bearer"
+ }
+ }
+ }
+}
diff --git a/docs/v2/openapi.documented.yml b/docs/v2/openapi.documented.yml
deleted file mode 100644
index 876e5069..00000000
--- a/docs/v2/openapi.documented.yml
+++ /dev/null
@@ -1,3660 +0,0 @@
-openapi: 3.1.0
-info:
- title: Honcho API
- summary: The Identity Layer for the Agentic World
- description: Honcho is a platform for giving agents user-centric memory and social cognition
- contact:
- name: Plastic Labs
- url: https://honcho.dev/
- email: hello@plasticlabs.ai
- version: 2.3.3
-servers:
- - url: http://localhost:8000
- description: Local Development Server
- - url: https://demo.honcho.dev
- description: Demo Server
- - url: https://api.honcho.dev
- description: Production SaaS Platform
-paths:
- /v2/workspaces:
- post:
- tags:
- - workspaces
- summary: Get Or Create Workspace
- description: |-
- Get a Workspace by ID.
-
- If workspace_id is provided as a query parameter, it uses that (must match JWT workspace_id).
- Otherwise, it uses the workspace_id from the JWT.
- operationId: get_or_create_workspace_v2_workspaces_post
- requestBody:
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/WorkspaceCreate"
- description: Workspace creation parameters
- required: true
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Workspace"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- security:
- - HTTPBearer: []
- - {}
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const workspace = await client.workspaces.getOrCreate({ id: 'id' });
-
- console.log(workspace.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- workspace = client.workspaces.get_or_create(
- id="id",
- )
- print(workspace.id)
- /v2/workspaces/list:
- post:
- tags:
- - workspaces
- summary: Get All Workspaces
- description: Get all Workspaces
- operationId: get_all_workspaces_v2_workspaces_list_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - 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
- requestBody:
- content:
- application/json:
- schema:
- anyOf:
- - $ref: "#/components/schemas/WorkspaceGet"
- - type: "null"
- description: Filtering and pagination options for the workspaces list
- title: Options
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Page_Workspace_"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- // Automatically fetches more pages as needed.
- for await (const workspace of client.workspaces.list()) {
- console.log(workspace.id);
- }
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- page = client.workspaces.list()
- page = page.items[0]
- print(page.id)
- /v2/workspaces/{workspace_id}:
- put:
- tags:
- - workspaces
- summary: Update Workspace
- description: Update a Workspace
- operationId: update_workspace_v2_workspaces__workspace_id__put
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace to update
- title: Workspace Id
- description: ID of the workspace to update
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/WorkspaceUpdate"
- description: Updated workspace parameters
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Workspace"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const workspace = await client.workspaces.update('workspace_id');
-
- console.log(workspace.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- workspace = client.workspaces.update(
- workspace_id="workspace_id",
- )
- print(workspace.id)
- /v2/workspaces/{workspace_id}/search:
- post:
- tags:
- - workspaces
- summary: Search Workspace
- description: Search a Workspace
- operationId: search_workspace_v2_workspaces__workspace_id__search_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace to search
- title: Workspace Id
- description: ID of the workspace to search
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/MessageSearchOptions"
- description: "Message search parameters "
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: "#/components/schemas/Message"
- title: Response Search Workspace V2 Workspaces Workspace Id Search Post
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const messages = await client.workspaces.search('workspace_id', { query: 'query' });
-
- console.log(messages);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- messages = client.workspaces.search(
- workspace_id="workspace_id",
- query="query",
- )
- print(messages)
- /v2/workspaces/{workspace_id}/deriver/status:
- get:
- tags:
- - workspaces
- summary: Get Deriver Status
- description: Get the deriver processing status, optionally scoped to an observer, sender, and/or session
- operationId: get_deriver_status_v2_workspaces__workspace_id__deriver_status_get
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: observer_id
- in: query
- required: false
- schema:
- anyOf:
- - type: string
- - type: "null"
- description: Optional observer ID to filter by
- title: Observer Id
- description: Optional observer ID to filter by
- - name: sender_id
- in: query
- required: false
- schema:
- anyOf:
- - type: string
- - type: "null"
- description: Optional sender ID to filter by
- title: Sender Id
- description: Optional sender ID to filter by
- - name: session_id
- in: query
- required: false
- schema:
- anyOf:
- - type: string
- - type: "null"
- description: Optional session ID to filter by
- title: Session Id
- description: Optional session ID to filter by
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/DeriverStatus"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const deriverStatus = await client.workspaces.deriverStatus('workspace_id');
-
- console.log(deriverStatus.completed_work_units);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- deriver_status = client.workspaces.deriver_status(
- workspace_id="workspace_id",
- )
- print(deriver_status.completed_work_units)
- /v2/workspaces/{workspace_id}/peers/list:
- post:
- tags:
- - peers
- summary: Get Peers
- description: Get All Peers for a Workspace
- operationId: get_peers_v2_workspaces__workspace_id__peers_list_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - 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
- requestBody:
- content:
- application/json:
- schema:
- anyOf:
- - $ref: "#/components/schemas/PeerGet"
- - type: "null"
- description: Filtering options for the peers list
- title: Options
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Page_Peer_"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- // Automatically fetches more pages as needed.
- for await (const peer of client.workspaces.peers.list('workspace_id')) {
- console.log(peer.id);
- }
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- page = client.workspaces.peers.list(
- workspace_id="workspace_id",
- )
- page = page.items[0]
- print(page.id)
- /v2/workspaces/{workspace_id}/peers:
- post:
- tags:
- - peers
- summary: Get Or Create Peer
- description: |-
- Get a Peer by ID
-
- If peer_id is provided as a query parameter, it uses that (must match JWT workspace_id).
- Otherwise, it uses the peer_id from the JWT.
- operationId: get_or_create_peer_v2_workspaces__workspace_id__peers_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/PeerCreate"
- description: Peer creation parameters
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Peer"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const peer = await client.workspaces.peers.getOrCreate('workspace_id', { id: 'id' });
-
- console.log(peer.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- peer = client.workspaces.peers.get_or_create(
- workspace_id="workspace_id",
- id="id",
- )
- print(peer.id)
- /v2/workspaces/{workspace_id}/peers/{peer_id}:
- put:
- tags:
- - peers
- summary: Update Peer
- description: Update a Peer's name and/or metadata
- operationId: update_peer_v2_workspaces__workspace_id__peers__peer_id__put
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: peer_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the peer to update
- title: Peer Id
- description: ID of the peer to update
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/PeerUpdate"
- description: Updated peer parameters
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Peer"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const peer = await client.workspaces.peers.update('workspace_id', 'peer_id');
-
- console.log(peer.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- peer = client.workspaces.peers.update(
- peer_id="peer_id",
- workspace_id="workspace_id",
- )
- print(peer.id)
- /v2/workspaces/{workspace_id}/peers/{peer_id}/sessions:
- post:
- tags:
- - peers
- summary: Get Sessions For Peer
- description: Get All Sessions for a Peer
- operationId: get_sessions_for_peer_v2_workspaces__workspace_id__peers__peer_id__sessions_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: peer_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the peer
- title: Peer Id
- description: ID of the peer
- - 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
- requestBody:
- content:
- application/json:
- schema:
- anyOf:
- - $ref: "#/components/schemas/SessionGet"
- - type: "null"
- description: Filtering options for the sessions list
- title: Options
- 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/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- // Automatically fetches more pages as needed.
- for await (const session of client.workspaces.peers.sessions.list('workspace_id', 'peer_id')) {
- console.log(session.id);
- }
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- page = client.workspaces.peers.sessions.list(
- peer_id="peer_id",
- workspace_id="workspace_id",
- )
- page = page.items[0]
- print(page.id)
- /v2/workspaces/{workspace_id}/peers/{peer_id}/chat:
- post:
- tags:
- - peers
- summary: Chat
- operationId: chat_v2_workspaces__workspace_id__peers__peer_id__chat_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: peer_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the peer
- title: Peer Id
- description: ID of the peer
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/DialecticOptions"
- description: Dialectic Endpoint Parameters
- responses:
- "200":
- description: Response to a question informed by Honcho's User Representation
- content:
- application/json:
- schema:
- properties:
- content:
- title: Content
- type: string
- required:
- - content
- title: DialecticResponse
- type: object
- text/event-stream: {}
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const response = await client.workspaces.peers.chat('workspace_id', 'peer_id', { query: 'x' });
-
- console.log(response.content);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- response = client.workspaces.peers.chat(
- peer_id="peer_id",
- workspace_id="workspace_id",
- query="x",
- )
- print(response.content)
- /v2/workspaces/{workspace_id}/peers/{peer_id}/representation:
- post:
- tags:
- - peers
- summary: Get Working Representation
- description: >-
- Get a peer's working representation for a session.
-
-
- If a session_id is provided in the body, we get the working representation of the peer in that
- session.
-
- If a target is provided, we get the representation of the target from the perspective of the peer.
-
- If no target is provided, we get the global representation of the peer.
- operationId: get_working_representation_v2_workspaces__workspace_id__peers__peer_id__representation_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: peer_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the peer
- title: Peer Id
- description: ID of the peer
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/PeerRepresentationGet"
- description: Options for getting the peer representation
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- type: object
- additionalProperties: true
- title: >-
- Response Get Working Representation V2 Workspaces Workspace Id Peers Peer Id
- Representation Post
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const response = await client.workspaces.peers.workingRepresentation('workspace_id', 'peer_id', {
- session_id: 'session_id',
- });
-
- console.log(response);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- response = client.workspaces.peers.working_representation(
- peer_id="peer_id",
- workspace_id="workspace_id",
- session_id="session_id",
- )
- print(response)
- /v2/workspaces/{workspace_id}/peers/{peer_id}/card:
- get:
- tags:
- - peers
- summary: Get Peer Card
- description: |-
- Get a peer card for a specific peer relationship.
-
- Returns the peer card that the observer peer has for the target peer if it exists.
- If no target is specified, returns the observer's own peer card.
- operationId: get_peer_card_v2_workspaces__workspace_id__peers__peer_id__card_get
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: peer_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the observer peer
- title: Peer Id
- description: ID of the observer peer
- - name: target
- in: query
- required: false
- schema:
- anyOf:
- - type: string
- - type: "null"
- description: The peer whose card to retrieve. If not provided, returns the observer's own card
- title: Target
- description: The peer whose card to retrieve. If not provided, returns the observer's own card
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/PeerCardResponse"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const response = await client.workspaces.peers.card('workspace_id', 'peer_id');
-
- console.log(response.peer_card);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- response = client.workspaces.peers.card(
- peer_id="peer_id",
- workspace_id="workspace_id",
- )
- print(response.peer_card)
- /v2/workspaces/{workspace_id}/peers/{peer_id}/search:
- post:
- tags:
- - peers
- summary: Search Peer
- description: Search a Peer
- operationId: search_peer_v2_workspaces__workspace_id__peers__peer_id__search_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: peer_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the peer
- title: Peer Id
- description: ID of the peer
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/MessageSearchOptions"
- description: "Message search parameters "
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: "#/components/schemas/Message"
- title: Response Search Peer V2 Workspaces Workspace Id Peers Peer Id Search Post
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: >-
- import Honcho from '@honcho-ai/core';
-
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
-
- const messages = await client.workspaces.peers.search('workspace_id', 'peer_id', { query: 'query'
- });
-
-
- console.log(messages);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- messages = client.workspaces.peers.search(
- peer_id="peer_id",
- workspace_id="workspace_id",
- query="query",
- )
- print(messages)
- /v2/workspaces/{workspace_id}/sessions:
- post:
- tags:
- - sessions
- summary: Get Or Create Session
- description: |-
- Get a specific session in a workspace.
-
- If session_id is provided as a query parameter, it verifies the session is in the workspace.
- Otherwise, it uses the session_id from the JWT for verification.
- operationId: get_or_create_session_v2_workspaces__workspace_id__sessions_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/SessionCreate"
- description: Session creation parameters
- 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/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const session = await client.workspaces.sessions.getOrCreate('workspace_id', { id: 'id' });
-
- console.log(session.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- session = client.workspaces.sessions.get_or_create(
- workspace_id="workspace_id",
- id="id",
- )
- print(session.id)
- /v2/workspaces/{workspace_id}/sessions/list:
- post:
- tags:
- - sessions
- summary: Get Sessions
- description: Get All Sessions in a Workspace
- operationId: get_sessions_v2_workspaces__workspace_id__sessions_list_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - 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
- requestBody:
- content:
- application/json:
- schema:
- anyOf:
- - $ref: "#/components/schemas/SessionGet"
- - type: "null"
- description: Filtering and pagination options for the sessions list
- title: Options
- 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/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- // Automatically fetches more pages as needed.
- for await (const session of client.workspaces.sessions.list('workspace_id')) {
- console.log(session.id);
- }
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- page = client.workspaces.sessions.list(
- workspace_id="workspace_id",
- )
- page = page.items[0]
- print(page.id)
- /v2/workspaces/{workspace_id}/sessions/{session_id}:
- put:
- tags:
- - sessions
- summary: Update Session
- description: Update the metadata of a Session
- operationId: update_session_v2_workspaces__workspace_id__sessions__session_id__put
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session to update
- title: Session Id
- description: ID of the session to update
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/SessionUpdate"
- description: Updated session parameters
- 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/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const session = await client.workspaces.sessions.update('workspace_id', 'session_id');
-
- console.log(session.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- session = client.workspaces.sessions.update(
- session_id="session_id",
- workspace_id="workspace_id",
- )
- print(session.id)
- delete:
- tags:
- - sessions
- summary: Delete Session
- description: Delete a session by marking it as inactive
- operationId: delete_session_v2_workspaces__workspace_id__sessions__session_id__delete
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session to delete
- title: Session Id
- description: ID of the session to delete
- 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/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const session = await client.workspaces.sessions.delete('workspace_id', 'session_id');
-
- console.log(session);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- session = client.workspaces.sessions.delete(
- session_id="session_id",
- workspace_id="workspace_id",
- )
- print(session)
- /v2/workspaces/{workspace_id}/sessions/{session_id}/clone:
- get:
- tags:
- - sessions
- summary: Clone Session
- description: Clone a session, optionally up to a specific message
- operationId: clone_session_v2_workspaces__workspace_id__sessions__session_id__clone_get
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session to clone
- title: Session Id
- description: ID of the session to clone
- - name: message_id
- in: query
- required: false
- schema:
- anyOf:
- - type: string
- - type: "null"
- description: Message ID to cut off the clone at
- title: Message Id
- description: Message ID to cut off the clone at
- 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/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const session = await client.workspaces.sessions.clone('workspace_id', 'session_id');
-
- console.log(session.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- session = client.workspaces.sessions.clone(
- session_id="session_id",
- workspace_id="workspace_id",
- )
- print(session.id)
- /v2/workspaces/{workspace_id}/sessions/{session_id}/peers:
- post:
- tags:
- - sessions
- summary: Add Peers To Session
- description: Add peers to a session
- operationId: add_peers_to_session_v2_workspaces__workspace_id__sessions__session_id__peers_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session
- title: Session Id
- description: ID of the session
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- additionalProperties:
- $ref: "#/components/schemas/SessionPeerConfig"
- description: List of peer IDs to add to the session
- title: Peers
- 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/core';
-
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
-
- const session = await client.workspaces.sessions.peers.add('workspace_id', 'session_id', { foo: {}
- });
-
-
- console.log(session.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- session = client.workspaces.sessions.peers.add(
- session_id="session_id",
- workspace_id="workspace_id",
- body={
- "foo": {}
- },
- )
- print(session.id)
- put:
- tags:
- - sessions
- summary: Set Session Peers
- description: Set the peers in a session
- operationId: set_session_peers_v2_workspaces__workspace_id__sessions__session_id__peers_put
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session
- title: Session Id
- description: ID of the session
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- additionalProperties:
- $ref: "#/components/schemas/SessionPeerConfig"
- description: List of peer IDs to set for the session
- title: Peers
- 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/core';
-
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
-
- const session = await client.workspaces.sessions.peers.set('workspace_id', 'session_id', { foo: {}
- });
-
-
- console.log(session.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- session = client.workspaces.sessions.peers.set(
- session_id="session_id",
- workspace_id="workspace_id",
- body={
- "foo": {}
- },
- )
- print(session.id)
- delete:
- tags:
- - sessions
- summary: Remove Peers From Session
- description: Remove peers from a session
- operationId: remove_peers_from_session_v2_workspaces__workspace_id__sessions__session_id__peers_delete
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session
- title: Session Id
- description: ID of the session
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: array
- items:
- type: string
- description: List of peer IDs to remove from the session
- title: Peers
- 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/core';
-
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
-
- const session = await client.workspaces.sessions.peers.remove('workspace_id', 'session_id',
- ['string']);
-
-
- console.log(session.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- session = client.workspaces.sessions.peers.remove(
- session_id="session_id",
- workspace_id="workspace_id",
- body=["string"],
- )
- print(session.id)
- get:
- tags:
- - sessions
- summary: Get Session Peers
- description: Get peers from a session
- operationId: get_session_peers_v2_workspaces__workspace_id__sessions__session_id__peers_get
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session
- title: Session Id
- description: ID of the session
- - 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_Peer_"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- // Automatically fetches more pages as needed.
- for await (const peer of client.workspaces.sessions.peers.list('workspace_id', 'session_id')) {
- console.log(peer.id);
- }
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- page = client.workspaces.sessions.peers.list(
- session_id="session_id",
- workspace_id="workspace_id",
- )
- page = page.items[0]
- print(page.id)
- /v2/workspaces/{workspace_id}/sessions/{session_id}/peers/{peer_id}/config:
- get:
- tags:
- - sessions
- summary: Get Peer Config
- description: Get the configuration for a peer in a session
- operationId: get_peer_config_v2_workspaces__workspace_id__sessions__session_id__peers__peer_id__config_get
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session
- title: Session Id
- description: ID of the session
- - name: peer_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the peer
- title: Peer Id
- description: ID of the peer
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/SessionPeerConfig"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const sessionPeerConfig = await client.workspaces.sessions.peers.getConfig(
- 'workspace_id',
- 'session_id',
- 'peer_id',
- );
-
- console.log(sessionPeerConfig.observe_me);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- session_peer_config = client.workspaces.sessions.peers.get_config(
- peer_id="peer_id",
- workspace_id="workspace_id",
- session_id="session_id",
- )
- print(session_peer_config.observe_me)
- post:
- tags:
- - sessions
- summary: Set Peer Config
- description: Set the configuration for a peer in a session
- operationId: set_peer_config_v2_workspaces__workspace_id__sessions__session_id__peers__peer_id__config_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session
- title: Session Id
- description: ID of the session
- - name: peer_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the peer
- title: Peer Id
- description: ID of the peer
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/SessionPeerConfig"
- description: Peer configuration
- 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/core';
-
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
-
- const response = await client.workspaces.sessions.peers.setConfig('workspace_id', 'session_id',
- 'peer_id');
-
-
- console.log(response);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- response = client.workspaces.sessions.peers.set_config(
- peer_id="peer_id",
- workspace_id="workspace_id",
- session_id="session_id",
- )
- print(response)
- /v2/workspaces/{workspace_id}/sessions/{session_id}/context:
- get:
- tags:
- - sessions
- summary: Get Session Context
- description: >-
- Produce a context object from the session. The caller provides an optional token limit which the
- entire context must fit into.
-
- If not provided, the context will be exhaustive (within configured max tokens). To do this, we
- allocate 40% of the token limit
-
- to the summary, and 60% to recent messages -- as many as can fit. Note that the summary will usually
- take up less space than
-
- this. If the caller does not want a summary, we allocate all the tokens to recent messages.
- operationId: get_session_context_v2_workspaces__workspace_id__sessions__session_id__context_get
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session
- title: Session Id
- description: ID of the session
- - name: tokens
- in: query
- required: false
- schema:
- anyOf:
- - type: integer
- maximum: 100000
- - type: "null"
- description: >-
- Number of tokens to use for the context. Includes summary if set to true. If not provided, the
- context will be exhaustive (within 100000 tokens)
- title: Tokens
- description: >-
- Number of tokens to use for the context. Includes summary if set to true. If not provided, the
- context will be exhaustive (within 100000 tokens)
- - name: summary
- in: query
- required: false
- schema:
- type: boolean
- description: Whether or not to include a summary *if* one is available for the session
- default: true
- title: Summary
- description: Whether or not to include a summary *if* one is available for the session
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/SessionContext"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const response = await client.workspaces.sessions.getContext('workspace_id', 'session_id');
-
- console.log(response.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- response = client.workspaces.sessions.get_context(
- session_id="session_id",
- workspace_id="workspace_id",
- )
- print(response.id)
- /v2/workspaces/{workspace_id}/sessions/{session_id}/summaries:
- get:
- tags:
- - sessions
- summary: Get Session Summaries
- description: |-
- Get available summaries for a session.
-
- Returns both short and long summaries if available, including metadata like
- the message ID they cover up to, creation timestamp, and token count.
- operationId: get_session_summaries_v2_workspaces__workspace_id__sessions__session_id__summaries_get
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session
- title: Session Id
- description: ID of the session
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/SessionSummaries"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const response = await client.workspaces.sessions.summaries('workspace_id', 'session_id');
-
- console.log(response.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- response = client.workspaces.sessions.summaries(
- session_id="session_id",
- workspace_id="workspace_id",
- )
- print(response.id)
- /v2/workspaces/{workspace_id}/sessions/{session_id}/search:
- post:
- tags:
- - sessions
- summary: Search Session
- description: Search a Session
- operationId: search_session_v2_workspaces__workspace_id__sessions__session_id__search_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session
- title: Session Id
- description: ID of the session
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/MessageSearchOptions"
- description: Message search parameters
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: "#/components/schemas/Message"
- title: Response Search Session V2 Workspaces Workspace Id Sessions Session Id Search Post
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: >-
- import Honcho from '@honcho-ai/core';
-
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
-
- const messages = await client.workspaces.sessions.search('workspace_id', 'session_id', { query:
- 'query' });
-
-
- console.log(messages);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- messages = client.workspaces.sessions.search(
- session_id="session_id",
- workspace_id="workspace_id",
- query="query",
- )
- print(messages)
- /v2/workspaces/{workspace_id}/sessions/{session_id}/messages/:
- post:
- tags:
- - messages
- summary: Create Messages For Session
- description: Create messages for a session with JSON data (original functionality).
- operationId: create_messages_for_session_v2_workspaces__workspace_id__sessions__session_id__messages__post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- title: Workspace Id
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- title: Session Id
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/MessageBatchCreate"
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: "#/components/schemas/Message"
- title: >-
- Response Create Messages For Session V2 Workspaces Workspace Id Sessions Session Id
- Messages Post
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const messages = await client.workspaces.sessions.messages.create('workspace_id', 'session_id', {
- messages: [{ content: 'content', peer_id: 'peer_id' }],
- });
-
- console.log(messages);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- messages = client.workspaces.sessions.messages.create(
- session_id="session_id",
- workspace_id="workspace_id",
- messages=[{
- "content": "content",
- "peer_id": "peer_id",
- }],
- )
- print(messages)
- /v2/workspaces/{workspace_id}/sessions/{session_id}/messages/upload:
- post:
- tags:
- - messages
- summary: Create Messages With File
- description: Create messages from uploaded files. Files are converted to text and split into multiple messages.
- operationId: create_messages_with_file_v2_workspaces__workspace_id__sessions__session_id__messages_upload_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- title: Workspace Id
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- title: Session Id
- requestBody:
- required: true
- content:
- multipart/form-data:
- schema:
- $ref: >-
- #/components/schemas/Body_create_messages_with_file_v2_workspaces__workspace_id__sessions__session_id__messages_upload_post
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: "#/components/schemas/Message"
- title: >-
- Response Create Messages With File V2 Workspaces Workspace Id Sessions Session Id
- Messages Upload Post
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const messages = await client.workspaces.sessions.messages.upload('workspace_id', 'session_id', {
- file: fs.createReadStream('path/to/file'),
- peer_id: 'peer_id',
- });
-
- console.log(messages);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- messages = client.workspaces.sessions.messages.upload(
- session_id="session_id",
- workspace_id="workspace_id",
- file=b"raw file contents",
- peer_id="peer_id",
- )
- print(messages)
- /v2/workspaces/{workspace_id}/sessions/{session_id}/messages/list:
- post:
- tags:
- - messages
- summary: Get Messages
- description: Get all messages for a session
- operationId: get_messages_v2_workspaces__workspace_id__sessions__session_id__messages_list_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session
- title: Session Id
- description: ID of the session
- - name: reverse
- in: query
- required: false
- schema:
- anyOf:
- - type: boolean
- - type: "null"
- description: Whether to reverse the order of results
- default: false
- title: Reverse
- description: Whether to reverse the order of results
- - 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
- requestBody:
- content:
- application/json:
- schema:
- anyOf:
- - $ref: "#/components/schemas/MessageGet"
- - type: "null"
- description: Filtering options for the messages list
- title: Options
- 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/core';
-
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
-
- // Automatically fetches more pages as needed.
-
- for await (const message of client.workspaces.sessions.messages.list('workspace_id',
- 'session_id')) {
- console.log(message.id);
- }
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- page = client.workspaces.sessions.messages.list(
- session_id="session_id",
- workspace_id="workspace_id",
- )
- page = page.items[0]
- print(page.id)
- /v2/workspaces/{workspace_id}/sessions/{session_id}/messages/{message_id}:
- get:
- tags:
- - messages
- summary: Get Message
- description: Get a Message by ID
- operationId: get_message_v2_workspaces__workspace_id__sessions__session_id__messages__message_id__get
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session
- title: Session Id
- description: ID of the session
- - name: message_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the message to retrieve
- title: Message Id
- description: ID of the message to retrieve
- 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/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const message = await client.workspaces.sessions.messages.retrieve(
- 'workspace_id',
- 'session_id',
- 'message_id',
- );
-
- console.log(message.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- message = client.workspaces.sessions.messages.retrieve(
- message_id="message_id",
- workspace_id="workspace_id",
- session_id="session_id",
- )
- print(message.id)
- put:
- tags:
- - messages
- summary: Update Message
- description: Update the metadata of a Message
- operationId: update_message_v2_workspaces__workspace_id__sessions__session_id__messages__message_id__put
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the workspace
- title: Workspace Id
- description: ID of the workspace
- - name: session_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the session
- title: Session Id
- description: ID of the session
- - name: message_id
- in: path
- required: true
- schema:
- type: string
- description: ID of the message to update
- title: Message Id
- description: ID of the message to update
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/MessageUpdate"
- description: Updated message parameters
- 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/core';
-
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
-
- const message = await client.workspaces.sessions.messages.update('workspace_id', 'session_id',
- 'message_id');
-
-
- console.log(message.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- message = client.workspaces.sessions.messages.update(
- message_id="message_id",
- workspace_id="workspace_id",
- session_id="session_id",
- )
- print(message.id)
- /v2/keys:
- post:
- tags:
- - keys
- summary: Create Key
- description: Create a new Key
- operationId: create_key_v2_keys_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: query
- required: false
- schema:
- anyOf:
- - type: string
- - type: "null"
- description: ID of the workspace to scope the key to
- title: Workspace Id
- description: ID of the workspace to scope the key to
- - name: peer_id
- in: query
- required: false
- schema:
- anyOf:
- - type: string
- - type: "null"
- description: ID of the peer to scope the key to
- title: Peer Id
- description: ID of the peer to scope the key to
- - name: session_id
- in: query
- required: false
- schema:
- anyOf:
- - type: string
- - type: "null"
- description: ID of the session to scope the key to
- title: Session Id
- description: ID of the session to scope the key to
- - name: expires_at
- in: query
- required: false
- schema:
- anyOf:
- - type: string
- format: date-time
- - type: "null"
- title: Expires At
- 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/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const key = await client.keys.create();
-
- console.log(key);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- key = client.keys.create()
- print(key)
- /v2/workspaces/{workspace_id}/webhooks:
- post:
- tags:
- - webhooks
- summary: Get Or Create Webhook Endpoint
- description: Get or create a webhook endpoint URL.
- operationId: get_or_create_webhook_endpoint_v2_workspaces__workspace_id__webhooks_post
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: Workspace ID
- title: Workspace Id
- description: Workspace ID
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/WebhookEndpointCreate"
- description: Webhook endpoint parameters
- responses:
- "200":
- description: Successful Response
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/WebhookEndpoint"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: >-
- import Honcho from '@honcho-ai/core';
-
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
-
- const webhookEndpoint = await client.workspaces.webhooks.getOrCreate('workspace_id', { url: 'url'
- });
-
-
- console.log(webhookEndpoint.id);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- webhook_endpoint = client.workspaces.webhooks.get_or_create(
- workspace_id="workspace_id",
- url="url",
- )
- print(webhook_endpoint.id)
- get:
- tags:
- - webhooks
- summary: List Webhook Endpoints
- description: List all webhook endpoints, optionally filtered by workspace.
- operationId: list_webhook_endpoints_v2_workspaces__workspace_id__webhooks_get
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: Workspace ID
- title: Workspace Id
- description: Workspace ID
- - 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_WebhookEndpoint_"
- "422":
- description: Validation Error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/HTTPValidationError"
- x-codeSamples:
- - lang: JavaScript
- source: |-
- import Honcho from '@honcho-ai/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- // Automatically fetches more pages as needed.
- for await (const webhookEndpoint of client.workspaces.webhooks.list('workspace_id')) {
- console.log(webhookEndpoint.id);
- }
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- page = client.workspaces.webhooks.list(
- workspace_id="workspace_id",
- )
- page = page.items[0]
- print(page.id)
- /v2/workspaces/{workspace_id}/webhooks/{endpoint_id}:
- delete:
- tags:
- - webhooks
- summary: Delete Webhook Endpoint
- description: Delete a specific webhook endpoint.
- operationId: delete_webhook_endpoint_v2_workspaces__workspace_id__webhooks__endpoint_id__delete
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: Workspace ID
- title: Workspace Id
- description: Workspace ID
- - name: endpoint_id
- in: path
- required: true
- schema:
- type: string
- description: Webhook endpoint ID
- title: Endpoint Id
- description: Webhook endpoint 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/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const webhook = await client.workspaces.webhooks.delete('workspace_id', 'endpoint_id');
-
- console.log(webhook);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- webhook = client.workspaces.webhooks.delete(
- endpoint_id="endpoint_id",
- workspace_id="workspace_id",
- )
- print(webhook)
- /v2/workspaces/{workspace_id}/webhooks/test:
- get:
- tags:
- - webhooks
- summary: Test Emit
- description: Test publishing a webhook event.
- operationId: test_emit_v2_workspaces__workspace_id__webhooks_test_get
- security:
- - HTTPBearer: []
- - {}
- parameters:
- - name: workspace_id
- in: path
- required: true
- schema:
- type: string
- description: Workspace ID
- title: Workspace Id
- description: Workspace 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/core';
-
- const client = new Honcho({
- apiKey: 'My API Key',
- });
-
- const response = await client.workspaces.webhooks.testEmit('workspace_id');
-
- console.log(response);
- - lang: Python
- source: |-
- from honcho_core import Honcho
-
- client = Honcho(
- api_key="My API Key",
- )
- response = client.workspaces.webhooks.test_emit(
- "workspace_id",
- )
- print(response)
-components:
- schemas:
- Body_create_messages_with_file_v2_workspaces__workspace_id__sessions__session_id__messages_upload_post:
- properties:
- file:
- type: string
- format: binary
- title: File
- peer_id:
- type: string
- title: Peer Id
- type: object
- required:
- - file
- - peer_id
- title: Body_create_messages_with_file_v2_workspaces__workspace_id__sessions__session_id__messages_upload_post
- DeriverStatus:
- properties:
- total_work_units:
- type: integer
- title: Total Work Units
- description: Total work units
- completed_work_units:
- type: integer
- title: Completed Work Units
- description: Completed work units
- in_progress_work_units:
- type: integer
- title: In Progress Work Units
- description: Work units currently being processed
- pending_work_units:
- type: integer
- title: Pending Work Units
- description: Work units waiting to be processed
- sessions:
- anyOf:
- - additionalProperties:
- $ref: "#/components/schemas/SessionDeriverStatus"
- type: object
- - type: "null"
- title: Sessions
- description: Per-session status when not filtered by session
- type: object
- required:
- - total_work_units
- - completed_work_units
- - in_progress_work_units
- - pending_work_units
- title: DeriverStatus
- DialecticOptions:
- properties:
- session_id:
- anyOf:
- - type: string
- - type: "null"
- title: Session Id
- description: ID of the session to scope the representation to
- target:
- anyOf:
- - type: string
- - type: "null"
- title: Target
- description: Optional peer to get the representation for, from the perspective of this peer
- query:
- type: string
- maxLength: 10000
- minLength: 1
- title: Query
- description: Dialectic API Prompt
- stream:
- type: boolean
- title: Stream
- default: false
- type: object
- required:
- - query
- title: DialecticOptions
- HTTPValidationError:
- properties:
- detail:
- items:
- $ref: "#/components/schemas/ValidationError"
- type: array
- title: Detail
- type: object
- title: HTTPValidationError
- Message:
- properties:
- id:
- type: string
- title: Id
- content:
- type: string
- title: Content
- peer_id:
- type: string
- title: Peer Id
- session_id:
- type: string
- title: Session Id
- metadata:
- additionalProperties: true
- type: object
- title: Metadata
- created_at:
- type: string
- format: date-time
- title: Created At
- workspace_id:
- type: string
- title: Workspace Id
- token_count:
- type: integer
- title: Token Count
- type: object
- required:
- - id
- - content
- - peer_id
- - session_id
- - created_at
- - workspace_id
- - token_count
- title: Message
- MessageBatchCreate:
- properties:
- messages:
- items:
- $ref: "#/components/schemas/MessageCreate"
- type: array
- maxItems: 100
- minItems: 1
- title: Messages
- type: object
- required:
- - messages
- title: MessageBatchCreate
- description: Schema for batch message creation with a max of 100 messages
- MessageCreate:
- properties:
- content:
- type: string
- maxLength: 25000
- minLength: 0
- title: Content
- peer_id:
- type: string
- title: Peer Id
- metadata:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Metadata
- created_at:
- anyOf:
- - type: string
- format: date-time
- - type: "null"
- title: Created At
- type: object
- required:
- - content
- - peer_id
- title: MessageCreate
- MessageGet:
- properties:
- filters:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Filters
- type: object
- title: MessageGet
- MessageSearchOptions:
- properties:
- query:
- type: string
- title: Query
- description: Search query
- filters:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Filters
- description: Filters to scope the search
- limit:
- type: integer
- maximum: 100
- minimum: 1
- title: Limit
- description: Number of results to return
- default: 10
- type: object
- required:
- - query
- title: MessageSearchOptions
- MessageUpdate:
- properties:
- metadata:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Metadata
- type: object
- title: MessageUpdate
- 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
- - page
- - size
- title: Page[Message]
- Page_Peer_:
- properties:
- items:
- items:
- $ref: "#/components/schemas/Peer"
- 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
- - page
- - size
- title: Page[Peer]
- 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
- - page
- - size
- title: Page[Session]
- Page_WebhookEndpoint_:
- properties:
- items:
- items:
- $ref: "#/components/schemas/WebhookEndpoint"
- 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
- - page
- - size
- title: Page[WebhookEndpoint]
- Page_Workspace_:
- properties:
- items:
- items:
- $ref: "#/components/schemas/Workspace"
- 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
- - page
- - size
- title: Page[Workspace]
- Peer:
- properties:
- id:
- type: string
- title: Id
- workspace_id:
- type: string
- title: Workspace Id
- created_at:
- type: string
- format: date-time
- title: Created At
- metadata:
- additionalProperties: true
- type: object
- title: Metadata
- configuration:
- additionalProperties: true
- type: object
- title: Configuration
- type: object
- required:
- - id
- - workspace_id
- - created_at
- title: Peer
- PeerCardResponse:
- properties:
- peer_card:
- anyOf:
- - items:
- type: string
- type: array
- - type: "null"
- title: Peer Card
- description: The peer card content, or None if not found
- type: object
- title: PeerCardResponse
- PeerCreate:
- properties:
- id:
- type: string
- maxLength: 100
- minLength: 1
- pattern: ^[a-zA-Z0-9_-]+$
- title: Id
- metadata:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Metadata
- configuration:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Configuration
- type: object
- required:
- - id
- title: PeerCreate
- PeerGet:
- properties:
- filters:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Filters
- type: object
- title: PeerGet
- PeerRepresentationGet:
- properties:
- session_id:
- type: string
- title: Session Id
- description: Get the working representation within this session
- target:
- anyOf:
- - type: string
- - type: "null"
- title: Target
- description: Optional peer ID to get the representation for, from the perspective of this peer
- type: object
- required:
- - session_id
- title: PeerRepresentationGet
- PeerUpdate:
- properties:
- metadata:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Metadata
- configuration:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Configuration
- type: object
- title: PeerUpdate
- Session:
- properties:
- id:
- type: string
- title: Id
- is_active:
- type: boolean
- title: Is Active
- workspace_id:
- type: string
- title: Workspace Id
- metadata:
- additionalProperties: true
- type: object
- title: Metadata
- configuration:
- additionalProperties: true
- type: object
- title: Configuration
- created_at:
- type: string
- format: date-time
- title: Created At
- type: object
- required:
- - id
- - is_active
- - workspace_id
- - created_at
- title: Session
- SessionContext:
- properties:
- id:
- type: string
- title: Id
- messages:
- items:
- $ref: "#/components/schemas/Message"
- type: array
- title: Messages
- summary:
- anyOf:
- - $ref: "#/components/schemas/Summary"
- - type: "null"
- description: The summary if available
- type: object
- required:
- - id
- - messages
- title: SessionContext
- SessionCreate:
- properties:
- id:
- type: string
- maxLength: 100
- minLength: 1
- pattern: ^[a-zA-Z0-9_-]+$
- title: Id
- metadata:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Metadata
- peers:
- anyOf:
- - additionalProperties:
- $ref: "#/components/schemas/SessionPeerConfig"
- type: object
- - type: "null"
- title: Peers
- configuration:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Configuration
- type: object
- required:
- - id
- title: SessionCreate
- SessionDeriverStatus:
- properties:
- session_id:
- anyOf:
- - type: string
- - type: "null"
- title: Session Id
- description: Session ID if filtered by session
- total_work_units:
- type: integer
- title: Total Work Units
- description: Total work units
- completed_work_units:
- type: integer
- title: Completed Work Units
- description: Completed work units
- in_progress_work_units:
- type: integer
- title: In Progress Work Units
- description: Work units currently being processed
- pending_work_units:
- type: integer
- title: Pending Work Units
- description: Work units waiting to be processed
- type: object
- required:
- - total_work_units
- - completed_work_units
- - in_progress_work_units
- - pending_work_units
- title: SessionDeriverStatus
- SessionGet:
- properties:
- filters:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Filters
- type: object
- title: SessionGet
- SessionPeerConfig:
- properties:
- observe_others:
- type: boolean
- title: Observe Others
- description: >-
- Whether this peer should form a session-level theory-of-mind representation of other peers in the
- session
- default: false
- observe_me:
- anyOf:
- - type: boolean
- - type: "null"
- title: Observe Me
- description: >-
- Whether other peers in this session should try to form a session-level theory-of-mind
- representation of this peer
- type: object
- title: SessionPeerConfig
- SessionSummaries:
- properties:
- id:
- type: string
- title: Id
- short_summary:
- anyOf:
- - $ref: "#/components/schemas/Summary"
- - type: "null"
- description: The short summary if available
- long_summary:
- anyOf:
- - $ref: "#/components/schemas/Summary"
- - type: "null"
- description: The long summary if available
- type: object
- required:
- - id
- title: SessionSummaries
- SessionUpdate:
- properties:
- metadata:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Metadata
- configuration:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Configuration
- type: object
- title: SessionUpdate
- Summary:
- properties:
- content:
- type: string
- title: Content
- description: The summary text
- message_id:
- type: integer
- title: Message Id
- description: The ID of the message that this summary covers up to
- summary_type:
- type: string
- title: Summary Type
- description: The type of summary (short or long)
- created_at:
- type: string
- title: Created At
- description: The timestamp of when the summary was created (ISO format)
- token_count:
- type: integer
- title: Token Count
- description: The number of tokens in the summary text
- type: object
- required:
- - content
- - message_id
- - summary_type
- - created_at
- - token_count
- title: Summary
- 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
- WebhookEndpoint:
- properties:
- id:
- type: string
- title: Id
- workspace_id:
- anyOf:
- - type: string
- - type: "null"
- title: Workspace Id
- url:
- type: string
- title: Url
- created_at:
- type: string
- format: date-time
- title: Created At
- type: object
- required:
- - id
- - workspace_id
- - url
- - created_at
- title: WebhookEndpoint
- WebhookEndpointCreate:
- properties:
- url:
- type: string
- title: Url
- type: object
- required:
- - url
- title: WebhookEndpointCreate
- Workspace:
- properties:
- id:
- type: string
- title: Id
- metadata:
- additionalProperties: true
- type: object
- title: Metadata
- configuration:
- additionalProperties: true
- type: object
- title: Configuration
- created_at:
- type: string
- format: date-time
- title: Created At
- type: object
- required:
- - id
- - created_at
- title: Workspace
- WorkspaceCreate:
- properties:
- id:
- type: string
- maxLength: 100
- minLength: 1
- pattern: ^[a-zA-Z0-9_-]+$
- title: Id
- metadata:
- additionalProperties: true
- type: object
- title: Metadata
- default: {}
- configuration:
- additionalProperties: true
- type: object
- title: Configuration
- default: {}
- type: object
- required:
- - id
- title: WorkspaceCreate
- WorkspaceGet:
- properties:
- filters:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Filters
- type: object
- title: WorkspaceGet
- WorkspaceUpdate:
- properties:
- metadata:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Metadata
- configuration:
- anyOf:
- - additionalProperties: true
- type: object
- - type: "null"
- title: Configuration
- type: object
- title: WorkspaceUpdate
- securitySchemes:
- HTTPBearer:
- type: http
- scheme: bearer
diff --git a/pyproject.toml b/pyproject.toml
index 95475114..9b0de576 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "honcho"
-version = "2.3.3"
+version = "2.4.0"
description = "Honcho Server"
authors = [
{name = "Plastic Labs", email = "hello@plasticlabs.ai"},
diff --git a/sdks/python/CHANGELOG.md b/sdks/python/CHANGELOG.md
index 2ce0448c..bc4a1f33 100644
--- a/sdks/python/CHANGELOG.md
+++ b/sdks/python/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
+## [1.5.0] - 2025-10-08
+
+### Changed
+
+- message_id of `Summary` model is a string nanoid
+
## [1.4.1] — 2025-10-09
### Added
diff --git a/sdks/python/src/honcho/__init__.py b/sdks/python/src/honcho/__init__.py
index 27609e22..f44ce715 100644
--- a/sdks/python/src/honcho/__init__.py
+++ b/sdks/python/src/honcho/__init__.py
@@ -47,7 +47,7 @@ from .session import Session
from .session_context import SessionContext, SessionSummaries, Summary
from .types import DialecticStreamResponse
-__version__ = "1.4.0"
+__version__ = "1.5.0"
__author__ = "Plastic Labs"
__email__ = "hello@plasticlabs.ai"
diff --git a/sdks/typescript/CHANGELOG.md b/sdks/typescript/CHANGELOG.md
index 1cbc337b..4e00824c 100644
--- a/sdks/typescript/CHANGELOG.md
+++ b/sdks/typescript/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
+## [1.5.0] - 2025-10-08
+
+### Changed
+
+- message_id of `Summary` model is a string nanoid
+
## [1.4.1] — 2025-10-09
### Added
diff --git a/sdks/typescript/__tests__/session_context.test.ts b/sdks/typescript/__tests__/session_context.test.ts
index 5865c765..203d4f98 100644
--- a/sdks/typescript/__tests__/session_context.test.ts
+++ b/sdks/typescript/__tests__/session_context.test.ts
@@ -1,10 +1,15 @@
-import { SessionContext, Summary } from '../src/session_context';
-import { Peer } from '../src/peer';
+import { SessionContext, Summary } from '../src/session_context'
+import { Peer } from '../src/peer'
/**
* Helper function to create a proper Message object for testing
*/
-function createTestMessage(id: string, content: string, peer_id: string, additionalProps: any = {}): any {
+function createTestMessage(
+ id: string,
+ content: string,
+ peer_id: string,
+ additionalProps: any = {}
+): any {
return {
id,
content,
@@ -13,8 +18,8 @@ function createTestMessage(id: string, content: string, peer_id: string, additio
session_id: 'test-session',
token_count: 0,
workspace_id: 'test-workspace',
- ...additionalProps
- };
+ ...additionalProps,
+ }
}
/**
@@ -23,16 +28,16 @@ function createTestMessage(id: string, content: string, peer_id: string, additio
function createTestSummary(content: string): Summary {
return new Summary({
content,
- message_id: "1",
+ message_id: 'test-message-id',
summary_type: 'short',
created_at: new Date().toISOString(),
- token_count: content.length
- });
+ token_count: content.length,
+ })
}
describe('SessionContext', () => {
- let sessionContext: SessionContext;
- let mockMessages: any[];
+ let sessionContext: SessionContext
+ let mockMessages: any[]
beforeEach(() => {
mockMessages = [
@@ -40,185 +45,223 @@ describe('SessionContext', () => {
createTestMessage('msg2', 'Hi there', 'user'),
createTestMessage('msg3', 'How are you?', 'user'),
createTestMessage('msg4', 'I am doing well, thank you!', 'assistant'),
- ];
+ ]
- sessionContext = new SessionContext('test-session', mockMessages, null);
- });
+ sessionContext = new SessionContext('test-session', mockMessages, null)
+ })
describe('constructor', () => {
it('should initialize with all properties', () => {
- expect(sessionContext.sessionId).toBe('test-session');
- expect(sessionContext.messages).toEqual(mockMessages);
- expect(sessionContext.summary).toBe(null);
- });
+ expect(sessionContext.sessionId).toBe('test-session')
+ expect(sessionContext.messages).toEqual(mockMessages)
+ expect(sessionContext.summary).toBe(null)
+ })
it('should initialize with null summary when not provided', () => {
- const context = new SessionContext('session-id', mockMessages);
+ const context = new SessionContext('session-id', mockMessages)
- expect(context.sessionId).toBe('session-id');
- expect(context.messages).toEqual(mockMessages);
- expect(context.summary).toBe(null);
- });
+ expect(context.sessionId).toBe('session-id')
+ expect(context.messages).toEqual(mockMessages)
+ expect(context.summary).toBe(null)
+ })
it('should handle empty messages array', () => {
- const summary = createTestSummary('No messages');
- const context = new SessionContext('session-id', [], summary);
+ const summary = createTestSummary('No messages')
+ const context = new SessionContext('session-id', [], summary)
- expect(context.sessionId).toBe('session-id');
- expect(context.messages).toEqual([]);
- expect(context.summary).toBe(summary);
- });
+ expect(context.sessionId).toBe('session-id')
+ expect(context.messages).toEqual([])
+ expect(context.summary).toBe(summary)
+ })
it('should handle null/undefined summary', () => {
- const context1 = new SessionContext('session-id', mockMessages, undefined as any);
- const context2 = new SessionContext('session-id', mockMessages, null);
+ const context1 = new SessionContext(
+ 'session-id',
+ mockMessages,
+ undefined as any
+ )
+ const context2 = new SessionContext('session-id', mockMessages, null)
- expect(context1.summary).toBe(null);
- expect(context2.summary).toBe(null);
- });
- });
+ expect(context1.summary).toBe(null)
+ expect(context2.summary).toBe(null)
+ })
+ })
describe('toOpenAI', () => {
it('should convert messages to OpenAI format with string assistant', () => {
- const openAIMessages = sessionContext.toOpenAI('assistant');
+ const openAIMessages = sessionContext.toOpenAI('assistant')
expect(openAIMessages).toEqual([
{ role: 'assistant', content: 'Hello', name: 'assistant' },
{ role: 'user', content: 'Hi there', name: 'user' },
{ role: 'user', content: 'How are you?', name: 'user' },
- { role: 'assistant', content: 'I am doing well, thank you!', name: 'assistant' },
- ]);
- });
+ {
+ role: 'assistant',
+ content: 'I am doing well, thank you!',
+ name: 'assistant',
+ },
+ ])
+ })
it('should convert messages to OpenAI format with Peer object', () => {
- const mockClient = {} as any;
- const assistantPeer = new Peer('assistant', 'test-workspace', mockClient);
+ const mockClient = {} as any
+ const assistantPeer = new Peer('assistant', 'test-workspace', mockClient)
- const openAIMessages = sessionContext.toOpenAI(assistantPeer);
+ const openAIMessages = sessionContext.toOpenAI(assistantPeer)
expect(openAIMessages).toEqual([
{ role: 'assistant', content: 'Hello', name: 'assistant' },
{ role: 'user', content: 'Hi there', name: 'user' },
{ role: 'user', content: 'How are you?', name: 'user' },
- { role: 'assistant', content: 'I am doing well, thank you!', name: 'assistant' },
- ]);
- });
+ {
+ role: 'assistant',
+ content: 'I am doing well, thank you!',
+ name: 'assistant',
+ },
+ ])
+ })
it('should handle messages where assistant is different peer', () => {
- const openAIMessages = sessionContext.toOpenAI('different-assistant');
+ const openAIMessages = sessionContext.toOpenAI('different-assistant')
expect(openAIMessages).toEqual([
{ role: 'user', content: 'Hello', name: 'assistant' },
{ role: 'user', content: 'Hi there', name: 'user' },
{ role: 'user', content: 'How are you?', name: 'user' },
- { role: 'user', content: 'I am doing well, thank you!', name: 'assistant' },
- ]);
- });
+ {
+ role: 'user',
+ content: 'I am doing well, thank you!',
+ name: 'assistant',
+ },
+ ])
+ })
it('should handle empty messages array', () => {
- const emptyContext = new SessionContext('session-id', []);
- const openAIMessages = emptyContext.toOpenAI('assistant');
+ const emptyContext = new SessionContext('session-id', [])
+ const openAIMessages = emptyContext.toOpenAI('assistant')
- expect(openAIMessages).toEqual([]);
- });
+ expect(openAIMessages).toEqual([])
+ })
it('should include summary message when summary exists', () => {
- const summary = createTestSummary('This is a summary');
- const contextWithSummary = new SessionContext('test-session', mockMessages, summary);
- const openAIMessages = contextWithSummary.toOpenAI('assistant');
+ const summary = createTestSummary('This is a summary')
+ const contextWithSummary = new SessionContext(
+ 'test-session',
+ mockMessages,
+ summary
+ )
+ const openAIMessages = contextWithSummary.toOpenAI('assistant')
expect(openAIMessages).toEqual([
{ role: 'system', content: 'This is a summary' },
{ role: 'assistant', content: 'Hello', name: 'assistant' },
{ role: 'user', content: 'Hi there', name: 'user' },
{ role: 'user', content: 'How are you?', name: 'user' },
- { role: 'assistant', content: 'I am doing well, thank you!', name: 'assistant' },
- ]);
- });
+ {
+ role: 'assistant',
+ content: 'I am doing well, thank you!',
+ name: 'assistant',
+ },
+ ])
+ })
it('should handle messages with missing peer_id', () => {
const messagesWithMissingPeer = [
createTestMessage('msg1', 'Hello', 'assistant'),
createTestMessage('msg2', 'No peer', ''), // missing peer_id
createTestMessage('msg3', 'Another message', ''), // null peer_id
- ];
- const context = new SessionContext('test', messagesWithMissingPeer);
+ ]
+ const context = new SessionContext('test', messagesWithMissingPeer)
- const openAIMessages = context.toOpenAI('assistant');
+ const openAIMessages = context.toOpenAI('assistant')
expect(openAIMessages).toEqual([
{ role: 'assistant', content: 'Hello', name: 'assistant' },
{ role: 'user', content: 'No peer', name: '' },
{ role: 'user', content: 'Another message', name: '' },
- ]);
- });
+ ])
+ })
it('should handle complex message content', () => {
const complexMessages = [
- createTestMessage('msg1', 'Message with\nnewlines and special chars!@#$%', 'assistant'),
+ createTestMessage(
+ 'msg1',
+ 'Message with\nnewlines and special chars!@#$%',
+ 'assistant'
+ ),
createTestMessage('msg2', '', 'user'), // empty content
createTestMessage('msg3', ' whitespace ', 'assistant'),
- ];
- const context = new SessionContext('test', complexMessages);
+ ]
+ const context = new SessionContext('test', complexMessages)
- const openAIMessages = context.toOpenAI('assistant');
+ const openAIMessages = context.toOpenAI('assistant')
expect(openAIMessages).toEqual([
- { role: 'assistant', content: 'Message with\nnewlines and special chars!@#$%', name: 'assistant' },
+ {
+ role: 'assistant',
+ content: 'Message with\nnewlines and special chars!@#$%',
+ name: 'assistant',
+ },
{ role: 'user', content: '', name: 'user' },
{ role: 'assistant', content: ' whitespace ', name: 'assistant' },
- ]);
- });
- });
+ ])
+ })
+ })
describe('toAnthropic', () => {
it('should convert messages to Anthropic format with string assistant', () => {
- const anthropicMessages = sessionContext.toAnthropic('assistant');
+ const anthropicMessages = sessionContext.toAnthropic('assistant')
expect(anthropicMessages).toEqual([
{ role: 'assistant', content: 'Hello' },
{ role: 'user', content: 'user: Hi there' },
{ role: 'user', content: 'user: How are you?' },
{ role: 'assistant', content: 'I am doing well, thank you!' },
- ]);
- });
+ ])
+ })
it('should convert messages to Anthropic format with Peer object', () => {
- const mockClient = {} as any;
- const assistantPeer = new Peer('assistant', 'test-workspace', mockClient);
+ const mockClient = {} as any
+ const assistantPeer = new Peer('assistant', 'test-workspace', mockClient)
- const anthropicMessages = sessionContext.toAnthropic(assistantPeer);
+ const anthropicMessages = sessionContext.toAnthropic(assistantPeer)
expect(anthropicMessages).toEqual([
{ role: 'assistant', content: 'Hello' },
{ role: 'user', content: 'user: Hi there' },
{ role: 'user', content: 'user: How are you?' },
{ role: 'assistant', content: 'I am doing well, thank you!' },
- ]);
- });
+ ])
+ })
it('should handle messages where assistant is different peer', () => {
- const anthropicMessages = sessionContext.toAnthropic('different-assistant');
+ const anthropicMessages = sessionContext.toAnthropic(
+ 'different-assistant'
+ )
expect(anthropicMessages).toEqual([
{ role: 'user', content: 'assistant: Hello' },
{ role: 'user', content: 'user: Hi there' },
{ role: 'user', content: 'user: How are you?' },
{ role: 'user', content: 'assistant: I am doing well, thank you!' },
- ]);
- });
+ ])
+ })
it('should handle empty messages array', () => {
- const emptyContext = new SessionContext('session-id', []);
- const anthropicMessages = emptyContext.toAnthropic('assistant');
+ const emptyContext = new SessionContext('session-id', [])
+ const anthropicMessages = emptyContext.toAnthropic('assistant')
- expect(anthropicMessages).toEqual([]);
- });
+ expect(anthropicMessages).toEqual([])
+ })
it('should include summary message when summary exists', () => {
- const summary = createTestSummary('This is a summary');
- const contextWithSummary = new SessionContext('test-session', mockMessages, summary);
- const anthropicMessages = contextWithSummary.toAnthropic('assistant');
+ const summary = createTestSummary('This is a summary')
+ const contextWithSummary = new SessionContext(
+ 'test-session',
+ mockMessages,
+ summary
+ )
+ const anthropicMessages = contextWithSummary.toAnthropic('assistant')
expect(anthropicMessages).toEqual([
{ role: 'user', content: 'This is a summary' },
@@ -226,157 +269,169 @@ describe('SessionContext', () => {
{ role: 'user', content: 'user: Hi there' },
{ role: 'user', content: 'user: How are you?' },
{ role: 'assistant', content: 'I am doing well, thank you!' },
- ]);
- });
+ ])
+ })
it('should handle messages with missing peer_id', () => {
const messagesWithMissingPeer = [
createTestMessage('msg1', 'Hello', 'assistant'),
createTestMessage('msg2', 'No peer', ''), // missing peer_id
createTestMessage('msg3', 'Another message', ''), // undefined peer_id
- ];
- const context = new SessionContext('test', messagesWithMissingPeer);
+ ]
+ const context = new SessionContext('test', messagesWithMissingPeer)
- const anthropicMessages = context.toAnthropic('assistant');
+ const anthropicMessages = context.toAnthropic('assistant')
expect(anthropicMessages).toEqual([
{ role: 'assistant', content: 'Hello' },
{ role: 'user', content: ': No peer' },
{ role: 'user', content: ': Another message' },
- ]);
- });
- });
+ ])
+ })
+ })
describe('length getter', () => {
it('should return correct message count', () => {
- expect(sessionContext.length).toBe(4);
- });
+ expect(sessionContext.length).toBe(4)
+ })
it('should return zero for empty messages', () => {
- const emptyContext = new SessionContext('session-id', []);
- expect(emptyContext.length).toBe(0);
- });
+ const emptyContext = new SessionContext('session-id', [])
+ expect(emptyContext.length).toBe(0)
+ })
it('should return correct count for single message', () => {
- const singleMessageContext = new SessionContext('session-id', [mockMessages[0]]);
- expect(singleMessageContext.length).toBe(1);
- });
- });
+ const singleMessageContext = new SessionContext('session-id', [
+ mockMessages[0],
+ ])
+ expect(singleMessageContext.length).toBe(1)
+ })
+ })
describe('toString', () => {
it('should return correct string representation', () => {
- const result = sessionContext.toString();
- expect(result).toBe('SessionContext(messages=4, summary=none)');
- });
+ const result = sessionContext.toString()
+ expect(result).toBe('SessionContext(messages=4, summary=none)')
+ })
it('should handle empty messages', () => {
- const emptyContext = new SessionContext('session-id', []);
- const result = emptyContext.toString();
- expect(result).toBe('SessionContext(messages=0, summary=none)');
- });
+ const emptyContext = new SessionContext('session-id', [])
+ const result = emptyContext.toString()
+ expect(result).toBe('SessionContext(messages=0, summary=none)')
+ })
it('should handle large number of messages', () => {
const manyMessages = Array.from({ length: 1000 }, (_, i) =>
- createTestMessage(`msg${i}`, `Message ${i}`, i % 2 === 0 ? 'assistant' : 'user')
- );
- const context = new SessionContext('session-id', manyMessages);
+ createTestMessage(
+ `msg${i}`,
+ `Message ${i}`,
+ i % 2 === 0 ? 'assistant' : 'user'
+ )
+ )
+ const context = new SessionContext('session-id', manyMessages)
- const result = context.toString();
- expect(result).toBe('SessionContext(messages=1000, summary=none)');
- });
- });
+ const result = context.toString()
+ expect(result).toBe('SessionContext(messages=1000, summary=none)')
+ })
+ })
describe('edge cases and error handling', () => {
it('should handle messages with null content', () => {
const messagesWithNullContent = [
createTestMessage('msg1', null as any, 'assistant'),
createTestMessage('msg2', undefined as any, 'user'),
- ];
- const context = new SessionContext('test', messagesWithNullContent);
+ ]
+ const context = new SessionContext('test', messagesWithNullContent)
- const openAIMessages = context.toOpenAI('assistant');
+ const openAIMessages = context.toOpenAI('assistant')
expect(openAIMessages).toEqual([
{ role: 'assistant', content: null, name: 'assistant' },
{ role: 'user', content: undefined, name: 'user' },
- ]);
- });
+ ])
+ })
it('should handle messages with non-string content', () => {
const messagesWithNonStringContent = [
createTestMessage('msg1', 123 as any, 'assistant'),
createTestMessage('msg2', { text: 'object content' } as any, 'user'),
createTestMessage('msg3', true as any, 'assistant'),
- ];
- const context = new SessionContext('test', messagesWithNonStringContent);
+ ]
+ const context = new SessionContext('test', messagesWithNonStringContent)
- const openAIMessages = context.toOpenAI('assistant');
+ const openAIMessages = context.toOpenAI('assistant')
expect(openAIMessages).toEqual([
{ role: 'assistant', content: 123, name: 'assistant' },
{ role: 'user', content: { text: 'object content' }, name: 'user' },
{ role: 'assistant', content: true, name: 'assistant' },
- ]);
- });
+ ])
+ })
it('should handle very long session IDs and summaries', () => {
- const longSessionId = 'x'.repeat(1000);
- const longSummaryText = 'Very long summary that goes on and on...'.repeat(100);
- const longSummary = createTestSummary(longSummaryText);
- const context = new SessionContext(longSessionId, mockMessages, longSummary);
+ const longSessionId = 'x'.repeat(1000)
+ const longSummaryText = 'Very long summary that goes on and on...'.repeat(
+ 100
+ )
+ const longSummary = createTestSummary(longSummaryText)
+ const context = new SessionContext(
+ longSessionId,
+ mockMessages,
+ longSummary
+ )
- expect(context.sessionId).toBe(longSessionId);
- expect(context.summary).toBe(longSummary);
- expect(context.summary?.content).toBe(longSummaryText);
- expect(context.length).toBe(5); // 4 messages + 1 summary
- });
+ expect(context.sessionId).toBe(longSessionId)
+ expect(context.summary).toBe(longSummary)
+ expect(context.summary?.content).toBe(longSummaryText)
+ expect(context.length).toBe(5) // 4 messages + 1 summary
+ })
it('should handle messages with additional properties', () => {
const messagesWithExtraProps = [
createTestMessage('msg1', 'Hello', 'assistant', {
timestamp: '2023-01-01T00:00:00Z',
metadata: { important: true },
- extra_field: 'extra_value'
+ extra_field: 'extra_value',
}),
- ];
- const context = new SessionContext('test', messagesWithExtraProps);
+ ]
+ const context = new SessionContext('test', messagesWithExtraProps)
- const openAIMessages = context.toOpenAI('assistant');
+ const openAIMessages = context.toOpenAI('assistant')
expect(openAIMessages).toEqual([
{ role: 'assistant', content: 'Hello', name: 'assistant' },
- ]);
- });
+ ])
+ })
it('should handle case-sensitive peer names', () => {
const caseMessages = [
createTestMessage('msg1', 'Hello', 'Assistant'),
createTestMessage('msg2', 'Hi', 'ASSISTANT'),
createTestMessage('msg3', 'Hey', 'assistant'),
- ];
- const context = new SessionContext('test', caseMessages);
+ ]
+ const context = new SessionContext('test', caseMessages)
- const openAIMessages = context.toOpenAI('assistant');
+ const openAIMessages = context.toOpenAI('assistant')
expect(openAIMessages).toEqual([
{ role: 'user', content: 'Hello', name: 'Assistant' }, // 'Assistant' != 'assistant'
{ role: 'user', content: 'Hi', name: 'ASSISTANT' }, // 'ASSISTANT' != 'assistant'
{ role: 'assistant', content: 'Hey', name: 'assistant' }, // exact match
- ]);
- });
+ ])
+ })
it('should handle messages without id field', () => {
const messagesWithoutId = [
createTestMessage('', 'Message without ID', 'assistant'),
createTestMessage('', 'Another message', 'user'),
- ];
- const context = new SessionContext('test', messagesWithoutId);
+ ]
+ const context = new SessionContext('test', messagesWithoutId)
- expect(context.length).toBe(2);
+ expect(context.length).toBe(2)
expect(context.toOpenAI('assistant')).toEqual([
{ role: 'assistant', content: 'Message without ID', name: 'assistant' },
{ role: 'user', content: 'Another message', name: 'user' },
- ]);
- });
- });
-});
+ ])
+ })
+ })
+})
diff --git a/src/main.py b/src/main.py
index c7f4c53d..c1cb1976 100644
--- a/src/main.py
+++ b/src/main.py
@@ -119,7 +119,7 @@ app = FastAPI(
title="Honcho API",
summary="The Identity Layer for the Agentic World",
description="""Honcho is a platform for giving agents user-centric memory and social cognition""",
- version="2.3.3",
+ version="2.4.0",
contact={
"name": "Plastic Labs",
"url": "https://honcho.dev",
diff --git a/uv.lock b/uv.lock
index 3569fc78..9d96e1cf 100644
--- a/uv.lock
+++ b/uv.lock
@@ -673,7 +673,7 @@ wheels = [
[[package]]
name = "honcho"
-version = "2.3.3"
+version = "2.4.0"
source = { virtual = "." }
dependencies = [
{ name = "alembic" },