Skip to main content
GET
/
v2
/
workspaces
/
{workspace_id}
/
sessions
/
{session_id}
/
context
Get Session Context
curl --request GET \
  --url http://localhost:8000/v2/workspaces/{workspace_id}/sessions/{session_id}/context \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "messages": [
    {
      "id": "<string>",
      "content": "<string>",
      "peer_id": "<string>",
      "session_id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "workspace_id": "<string>",
      "token_count": 123,
      "metadata": {}
    }
  ],
  "summary": {
    "content": "<string>",
    "message_id": "<string>",
    "summary_type": "<string>",
    "created_at": "<string>",
    "token_count": 123
  },
  "peer_representation": {
    "explicit": [
      {
        "created_at": "2023-11-07T05:31:56Z",
        "message_ids": [
          123
        ],
        "session_name": "<string>",
        "content": "<string>"
      }
    ],
    "deductive": [
      {
        "created_at": "2023-11-07T05:31:56Z",
        "message_ids": [
          123
        ],
        "session_name": "<string>",
        "conclusion": "<string>",
        "premises": [
          "<string>"
        ]
      }
    ]
  },
  "peer_card": [
    "<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. Includes representation and peer card if they are included in the response. If not provided, the context will be exhaustive (within 100000 tokens)

Required range: x <= 100000
last_message
string | null

The most recent message, used to fetch semantically relevant observations

summary
boolean
default:true

Whether or not to include a summary if one is available for the session

peer_target
string | null

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.

peer_perspective
string | null

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.

limit_to_session
boolean
default:false

Only used if last_message is provided. Whether to limit the representation to the session (as opposed to everything known about the target peer)

search_top_k
integer | null

Only used if last_message is provided. The number of semantic-search-retrieved observations to include in the representation

Required range: 1 <= x <= 100
search_max_distance
number | null

Only used if last_message is provided. The maximum distance to search for semantically relevant observations

Required range: 0 <= x <= 1
include_most_derived
boolean
default:false

Only used if last_message is provided. Whether to include the most derived observations in the representation

max_observations
integer | null

Only used if last_message is provided. The maximum number of observations to include in the representation

Required range: 1 <= x <= 100

Response

Successful Response

id
string
required
messages
Message · object[]
required
summary
Summary · object

The summary if available

peer_representation
Representation · object

The peer representation, if context is requested from a specific perspective

peer_card
string[] | null

The peer card, if context is requested from a specific perspective