LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

Chat LangChain

What can I help with?

Enter to send·Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmithresourcessandboxescommand_historyCommandHistoryResourcequery
Method●Since v0.16

query

Copy
query(
  self,
  sandbox_id: str,
  *,
  cursor: str | Omit 
View source on GitHub
=
omit
,
filters
:
command_history_query_params
.
Filters
|
Omit
=
omit
,
page_size
:
int
|
Omit
=
omit
,
since
:
str
|
Omit
=
omit
,
extra_headers
:
Headers
|
None
=
None
,
extra_query
:
Query
|
None
=
None
,
extra_body
:
Body
|
None
=
None
,
timeout
:
float
|
httpx
.
Timeout
|
None
|
NotGiven
=
not_given
)
->
CommandHistoryQueryResponse

Parameters

NameTypeDescription
page_sizeint | Omit
Default:omit

Maximum commands per page.

extra_headersHeaders | None
Default:None

Send extra headers

extra_queryQuery | None
Default:None
extra_bodyBody | None
Default:None
timeoutfloat | httpx.Timeout | None | NotGiven
Default:not_given

GET with body payload — no resources created.

Returns the commands matching the query passed as the request payload: retained Execute API commands, newest first. Beta: these log reads may change in incompatible ways before general availability. A cursor continues the first page's listing; even a short or empty page may return next_cursor. Continue until next_cursor is null. cursor and since are mutually exclusive. Every response carries a tail_cursor; a request with since set to it returns the commands that started or changed since, with tail_overflow when more changed than page_size; reload the first page when tail_overflow is true. History remains readable while the sandbox is stopped. Access requires the sandbox creator or sandboxes:exec. Capture and retention may be incomplete; UNKNOWN status has no known exit result.

Add additional query parameters to the request

Add additional JSON properties to the request

Override the client-level default timeout for this request, in seconds