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
Pythonlangsmithresourcesai_searchAsyncAISearchResourceparse
Method●Since v0.15

parse

Copy
parse(
  self,
  *,
  ai_search: str,
  project_ids: SequenceNotStr[str],
  
View source on GitHub
allow_clarification
:
bool
|
Omit
=
omit
,
scope
:
Literal
[
'runs'
,
'traces'
,
'threads'
]
|
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
)
->
AISearchParseResponse

Parameters

NameTypeDescription
ai_search*str

Natural-language description of the runs, traces or threads to find, at most 2000 UTF-8 bytes.

project_ids*SequenceNotStr[str]

Tracing project UUIDs used to interpret the search. Send the same projects to the query API.

allow_clarificationbool | Omit
Default:omit
scopeLiteral['runs', 'traces', 'threads'] | Omit
Default:omit
extra_headersHeaders | None
Default:None
extra_queryQuery | None
Default:None
extra_bodyBody | None
Default:None
timeoutfloat | httpx.Timeout | None | NotGiven
Default:not_given

Translates a natural-language search into the scope, filters, semantic criterion and time bounds for the runs, traces or threads query API, without running the search. No resources are created. Send the returned fields to the query API named by scope, with the same projects. When scope is omitted, it is inferred from the search and defaults to traces. A time period in the search sets min_start_time or max_start_time; bounds the search does not mention are omitted so you can keep your own time range. Requires AI search to be enabled for the organization and read access to every project. Returns a single JSON response.

When true, an ambiguous search returns clarification options instead of a single plan. Defaults to false.

Query API to plan for: runs, traces or threads. When omitted, it is inferred from the search and defaults to traces.

Send extra headers

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