GET
/
v2
/
workspaces
/
{workspace_id}
/
sessions
/
{session_id}
/
context
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);
{
  "id": "<string>",
  "messages": [
    {
      "id": "<string>",
      "content": "<string>",
      "peer_id": "<string>",
      "session_id": "<string>",
      "metadata": {},
      "created_at": "2023-11-07T05:31:56Z",
      "workspace_id": "<string>",
      "token_count": 123
    }
  ],
  "summary": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspace_id
string
required

ID of the workspace

session_id
string
required

ID of the session

Query Parameters

tokens
integer | null

Number of tokens to use for the context. Includes summary if set to true

summary
boolean
default:false

Whether to summarize the session history prior to the cutoff message

Response

200
application/json

Successful Response

The response is of type object.