Operation Search Index API Reference
The search index powers search_operations, describe_operation,
list_operations, and list_tags in the
Generic Toolkit. It is also usable
standalone.
langchain_openapi_tools.search.OperationIndex
In-memory searchable index of parsed OpenAPI operations.
Source code in langchain_openapi_tools/search.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
get(operation_id)
Return an entry by canonical id, operationId, or METHOD PATH.
Source code in langchain_openapi_tools/search.py
list_entries(tag=None, method=None)
List operations, optionally filtered by tag and/or HTTP method.
Source code in langchain_openapi_tools/search.py
search(query, limit=10, method=None, tag=None)
Rank operations by relevance to query.
The scoring combines three signals:
- Substring — full query appearing verbatim inside the operation id / summary / path.
- Token overlap — how many query tokens appear anywhere in the entry's haystack.
- Fuzzy ratio —
difflib.SequenceMatcheragainst the haystack, providing a semantic-friendly tiebreaker.
Source code in langchain_openapi_tools/search.py
tags()
Return the sorted set of unique tags across all operations.
langchain_openapi_tools.search.OperationEntry
dataclass
Indexable projection of an :class:Operation.
Attributes:
| Name | Type | Description |
|---|---|---|
canonical_id |
str
|
Stable identifier used by discovery tools
( |
method |
str
|
HTTP method in upper case ( |
path |
str
|
URL path template (e.g. |
summary |
str | None
|
Short human-readable summary. |
description |
str | None
|
Longer description. |
tags |
list[str]
|
OpenAPI tags associated with the operation. |
operation |
Operation | None
|
The underlying :class: |
Source code in langchain_openapi_tools/search.py
haystack()
Concatenated searchable text used for scoring.
Source code in langchain_openapi_tools/search.py
langchain_openapi_tools.search.SearchResult
dataclass
A ranked operation match returned by :meth:OperationIndex.search.