honcho/docs/v2/openapi.documented.yml

3329 lines
96 KiB
YAML

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.0.1
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 token.
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const workspace = await client.workspaces.getOrCreate({ id: 'id' });
console.log(workspace.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const workspace of client.workspaces.list()) {
console.log(workspace.id);
}
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const workspace = await client.workspaces.update('workspace_id');
console.log(workspace.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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
- 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:
required: true
content:
application/json:
schema:
type: string
description: Search query
title: Query
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const message of client.workspaces.search('workspace_id', { body: 'body' })) {
console.log(message.id);
}
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
page = client.workspaces.search(
workspace_id="workspace_id",
body="body",
)
page = page.items[0]
print(page.id)
/v2/workspaces/{workspace_id}/deriver/status:
get:
tags:
- workspaces
summary: Get Deriver Status
description: Get the deriver processing status, optionally scoped to a peer 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: peer_id
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Optional peer ID to filter by
title: Peer Id
description: Optional peer 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
- name: include_sender
in: query
required: false
schema:
type: boolean
description: Include work units triggered by this peer
default: false
title: Include Sender
description: Include work units triggered by this peer
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const deriverStatus = await client.workspaces.deriverStatus('workspace_id');
console.log(deriverStatus.peer_id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
deriver_status = client.workspaces.deriver_status(
workspace_id="workspace_id",
)
print(deriver_status.peer_id)
/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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const peer of client.workspaces.peers.list('workspace_id')) {
console.log(peer.id);
}
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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 token.
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const peer = await client.workspaces.peers.getOrCreate('workspace_id', { id: 'id' });
console.log(peer.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const peer = await client.workspaces.peers.update('workspace_id', 'peer_id');
console.log(peer.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
// 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: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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:
$ref: '#/components/schemas/DialecticResponse'
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const response = await client.workspaces.peers.chat('workspace_id', 'peer_id', { queries: 'string'
});
console.log(response.content);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
response = client.workspaces.peers.chat(
peer_id="peer_id",
workspace_id="workspace_id",
queries="string",
)
print(response.content)
/v2/workspaces/{workspace_id}/peers/{peer_id}/messages:
post:
tags:
- peers
summary: Create Messages For Peer
description: Create messages for a peer
operationId: create_messages_for_peer_v2_workspaces__workspace_id__peers__peer_id__messages_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/MessageBatchCreate'
description: Batch of messages to create
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Message'
title: Response Create Messages For Peer V2 Workspaces Workspace Id Peers Peer 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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const messages = await client.workspaces.peers.messages.create('workspace_id', 'peer_id', {
messages: [{ content: 'content', peer_id: 'peer_id' }],
});
console.log(messages);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
messages = client.workspaces.peers.messages.create(
peer_id="peer_id",
workspace_id="workspace_id",
messages=[{
"content": "content",
"peer_id": "peer_id",
}],
)
print(messages)
/v2/workspaces/{workspace_id}/peers/{peer_id}/messages/list:
post:
tags:
- peers
summary: Get Messages For Peer
description: Get all messages for a peer
operationId: get_messages_for_peer_v2_workspaces__workspace_id__peers__peer_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: peer_id
in: path
required: true
schema:
type: string
description: ID of the peer
title: Peer Id
description: ID of the peer
- 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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const message of client.workspaces.peers.messages.list('workspace_id', 'peer_id')) {
console.log(message.id);
}
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
page = client.workspaces.peers.messages.list(
peer_id="peer_id",
workspace_id="workspace_id",
)
page = page.items[0]
print(page.id)
/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.
In the current implementation, we don't offer representations of `target` so that parameter is
ignored.
Future releases will allow for this.
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const response = await client.workspaces.peers.workingRepresentation('workspace_id', 'peer_id', {
session_id: 'session_id',
});
console.log(response);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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}/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
- 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:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MessageSearchOptions'
description: 'Message search parameters '
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const message of client.workspaces.peers.search('workspace_id', 'peer_id', { query:
'query' })) {
console.log(message.id);
}
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
page = client.workspaces.peers.search(
peer_id="peer_id",
workspace_id="workspace_id",
query="query",
)
page = page.items[0]
print(page.id)
/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 token 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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const session = await client.workspaces.sessions.getOrCreate('workspace_id', { id: 'id' });
console.log(session.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const session of client.workspaces.sessions.list('workspace_id')) {
console.log(session.id);
}
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const session = await client.workspaces.sessions.update('workspace_id', 'session_id');
console.log(session.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const session = await client.workspaces.sessions.delete('workspace_id', 'session_id');
console.log(session);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const session = await client.workspaces.sessions.clone('workspace_id', 'session_id');
console.log(session.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const session = await client.workspaces.sessions.peers.add('workspace_id', 'session_id', { foo: {}
});
console.log(session.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const session = await client.workspaces.sessions.peers.set('workspace_id', 'session_id', { foo: {}
});
console.log(session.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const session = await client.workspaces.sessions.peers.remove('workspace_id', 'session_id',
['string']);
console.log(session.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
// 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: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const response = await client.workspaces.sessions.peers.getConfig('workspace_id', 'session_id',
'peer_id');
console.log(response.observe_me);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
response = client.workspaces.sessions.peers.get_config(
peer_id="peer_id",
workspace_id="workspace_id",
session_id="session_id",
)
print(response.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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const response = await client.workspaces.sessions.peers.setConfig('workspace_id', 'session_id',
'peer_id');
console.log(response);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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 a token limit which the entire context
must fit into.
To do this, we allocate 40% of the token limit to the summary, and 60% to recent messages -- as many
as can fit.
If the caller does not want a summary, we allocate all the tokens to recent messages.
The default token limit if not provided is 2048. (TODO: make this configurable)
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
- type: 'null'
description: Number of tokens to use for the context. Includes summary if set to true
title: Tokens
description: Number of tokens to use for the context. Includes summary if set to true
- name: summary
in: query
required: false
schema:
type: boolean
description: Whether to summarize the session history prior to the cutoff message
default: false
title: Summary
description: Whether to summarize the session history prior to the cutoff message
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const response = await client.workspaces.sessions.getContext('workspace_id', 'session_id');
console.log(response.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
response = client.workspaces.sessions.get_context(
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
- 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:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MessageSearchOptions'
description: 'Message search parameters '
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const message of client.workspaces.sessions.search('workspace_id', 'session_id', {
query: 'query',
})) {
console.log(message.id);
}
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
page = client.workspaces.sessions.search(
session_id="session_id",
workspace_id="workspace_id",
query="query",
)
page = page.items[0]
print(page.id)
/v2/workspaces/{workspace_id}/sessions/{session_id}/messages/:
post:
tags:
- messages
summary: Create Messages For Session
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
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/MessageBatchCreate'
description: Batch of messages to create
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
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: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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/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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
// 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: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const message = await client.workspaces.sessions.messages.retrieve(
'workspace_id',
'session_id',
'message_id',
);
console.log(message.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const message = await client.workspaces.sessions.messages.update('workspace_id', 'session_id',
'message_id');
console.log(message.id);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
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: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
const key = await client.keys.create();
console.log(key);
- lang: Python
source: |-
import os
from honcho_core import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
key = client.keys.create()
print(key)
components:
schemas:
DeriverStatus:
properties:
peer_id:
anyOf:
- type: string
- type: 'null'
title: Peer Id
description: ID of the peer (optional when filtering by session only)
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
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
queries:
anyOf:
- type: string
- items:
type: string
type: array
title: Queries
stream:
type: boolean
title: Stream
default: false
type: object
required:
- queries
title: DialecticOptions
DialecticResponse:
properties:
content:
type: string
title: Content
type: object
required:
- content
title: DialecticResponse
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:
anyOf:
- type: string
- type: 'null'
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: 50000
minLength: 0
title: Content
peer_id:
type: string
title: Peer Id
metadata:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Metadata
type: object
required:
- content
- peer_id
title: MessageCreate
MessageGet:
properties:
filter:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Filter
type: object
title: MessageGet
MessageSearchOptions:
properties:
query:
type: string
title: Query
description: Search query
semantic:
anyOf:
- type: boolean
- type: 'null'
title: Semantic
description: Whether to explicitly use semantic search to filter the results
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_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
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:
filter:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Filter
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:
type: string
title: Summary
type: object
required:
- id
- messages
- summary
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:
peer_id:
anyOf:
- type: string
- type: 'null'
title: Peer Id
description: ID of the peer (optional when filtering by session only)
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:
filter:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Filter
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
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
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
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:
filter:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Filter
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