find tool
Use find before choosing a library or a function for a task, as
xpd find does. It searches the index in the xpd binary, so it works for a
library that the project has not installed. Read an entry it returns with api
before writing code. find runs in the server's working folder, because it reads no project
file.
find(task, package=null, kind=null, limit=null)- Changes no file
- A second call with the same arguments changes nothing more
- Stays inside the project
Tags: discovery.
Description
Section titled “Description”The server gives the agent this description of the tool.
Find up to five symbols, three rules and three recipes, ranked within each kind.
Search before choosing a library, even when it is not installed. Describe the task in your own words, because search ranks by meaning as well as by keywords. Read the chosen symbol with api before writing code.
Arguments
Section titled “Arguments”Type: string. Required.
The task in your own words, such as "grouped regression".
package
Section titled “package”Type: string or null. Optional, default null.
Search only this library, by its Python import name, such as sklearn.
Type: string or null. Optional, default null.
Search only symbol, rule or recipe entries.
Type: integer or null. Optional, default null.
The most entries of each kind. Default: 5 symbols, 3 rules and 3 recipes.
Result
Section titled “Result”Candidates ranked separately within each kind, including entries read through api.
The 48 fields of the result
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
symbols |
list of object | no | ||
symbols[].kind |
string | yes | ||
symbols[].package |
string | yes | ||
symbols[].name |
string | yes | ||
symbols[].callable |
"class", "function", "method", "property" or null |
yes | ||
symbols[].parameters |
list of string | yes | ||
symbols[].parameters_written |
list of string | no | The parameter list as the source writes it: each parameter with its type annotation and default, and a * or / that stands alone between parameters. A stub file writes ... for a default, which says only that the parameter is optional. | |
symbols[].summary |
string | yes | ||
symbols[].members |
list of object | yes | ||
symbols[].members[].name |
string | yes | ||
symbols[].members[].parameters |
list of string | yes | ||
symbols[].members[].parameters_written |
list of string | no | The parameter list as the source writes it: each parameter with its type annotation and default, and a * or / that stands alone between parameters. A stub file writes ... for a default, which says only that the parameter is optional. | |
symbols[].members[].summary |
string | yes | ||
symbols[].members[].property |
boolean | no | false |
The member is read and not called. |
symbols[].rules |
list of string | yes | ||
symbols[].signature |
string or null | yes | Return indexed parameter names. parameters_written has the defaults and kinds. |
|
rules |
list of object | no | ||
rules[].kind |
string | yes | ||
rules[].package |
string | yes | ||
rules[].name |
string | yes | ||
rules[].callable |
"class", "function", "method", "property" or null |
yes | ||
rules[].parameters |
list of string | yes | ||
rules[].parameters_written |
list of string | no | The parameter list as the source writes it: each parameter with its type annotation and default, and a * or / that stands alone between parameters. A stub file writes ... for a default, which says only that the parameter is optional. | |
rules[].summary |
string | yes | ||
rules[].members |
list of object | yes | ||
rules[].members[].name |
string | yes | ||
rules[].members[].parameters |
list of string | yes | ||
rules[].members[].parameters_written |
list of string | no | The parameter list as the source writes it: each parameter with its type annotation and default, and a * or / that stands alone between parameters. A stub file writes ... for a default, which says only that the parameter is optional. | |
rules[].members[].summary |
string | yes | ||
rules[].members[].property |
boolean | no | false |
The member is read and not called. |
rules[].rules |
list of string | yes | ||
rules[].signature |
string or null | yes | Return indexed parameter names. parameters_written has the defaults and kinds. |
|
recipes |
list of object | no | ||
recipes[].kind |
string | yes | ||
recipes[].package |
string | yes | ||
recipes[].name |
string | yes | ||
recipes[].callable |
"class", "function", "method", "property" or null |
yes | ||
recipes[].parameters |
list of string | yes | ||
recipes[].parameters_written |
list of string | no | The parameter list as the source writes it: each parameter with its type annotation and default, and a * or / that stands alone between parameters. A stub file writes ... for a default, which says only that the parameter is optional. | |
recipes[].summary |
string | yes | ||
recipes[].members |
list of object | yes | ||
recipes[].members[].name |
string | yes | ||
recipes[].members[].parameters |
list of string | yes | ||
recipes[].members[].parameters_written |
list of string | no | The parameter list as the source writes it: each parameter with its type annotation and default, and a * or / that stands alone between parameters. A stub file writes ... for a default, which says only that the parameter is optional. | |
recipes[].members[].summary |
string | yes | ||
recipes[].members[].property |
boolean | no | false |
The member is read and not called. |
recipes[].rules |
list of string | yes | ||
recipes[].signature |
string or null | yes | Return indexed parameter names. parameters_written has the defaults and kinds. |
Example
Section titled “Example”{"task":"rounded bars","kind":"recipe","limit":1}The result has symbols, rules and recipes. The one recipe is shown without its code.
{"symbols":[],"rules":[],"recipes":[{"kind":"recipe","package":"plotly","name":"plotly/recipe/rounded-bars","callable":null,"rules":[],"recipe":{"title":"Rounded Bars","symbols":["plotly.data.medals_wide","plotly.graph_objects.Bar","plotly.subplots.make_subplots"],"source":"https://github.com/plotly/plotly.py/blob/v7.1.0/doc/python/bar-charts.md#L746","license":"MIT","modified":false},"signature":null}]}Errors
Section titled “Errors”No match gives empty lists. The first call can take a few minutes, because it downloads the 333 MB search model.