POST /: create a grid, your own store of items; no API key needed. Returns its `api_key`, shown only now:
pass it as `api_key` to every other tool, or send it as the header `Authorization: Bearer hg-…`. It holds up
to `max_items` items, queries included. Each address may create only a few grids a day.
輸入參數name
GET /: the grid the API key opens: its name and its limit on items, `max_items` (queries included; null:
no limit).
輸入參數api_key
DELETE /: delete the grid and everything in it, items, queries and grades; its key stops working.
輸入參數api_key
PUT /items/key: write the item at `key` (e.g. "42", no leading /), creating it or replacing its content.
Text is a string and a record a JSON object, each up to 8 KB; an image its bytes as base64, kept as a WebP of
at most 512 px (its width and height come back); an emb a list of floats from the grid's model. DNA
embeds the rest itself and keeps it only to embed it again; results and listings never return it. `type` is one of text/plain, application/json, image/png, image/jpeg, image/webp, image/gif, application/vnd.hashgrid.emb+json; leave it out for text, a record or an emb,
which DNA tells apart, not for an image. Group items under a prefix (e.g. "tools/42") to search groups
apart. Returns the item: its key, type, size, etag, ctime and mtime.
輸入參數key必填typeapi_keycontent必填
GET /items/key: the item at `key`, with its `content` as put_item takes it.
輸入參數key必填api_key
DELETE /items/key: delete the item at `key`, and every grade of it.
輸入參數key必填api_key
GET /items?prefix=: `items`, those whose keys start with `prefix` (e.g. "tools/"; all by default), in key
order, without their content (get_item reads one), at most `limit` (1 to 100, 32 by default). `next`: for the
next page, pass it as `after` (null: this was the last).
輸入參數afterlimitprefixapi_key
POST /queries: store a question to ask of the items, its content as put_item takes it. Returns its `id`,
which the other query tools take. Its results are ready at once; ask again with the same `id` rather than
creating the same query twice, so its grades add up.
輸入參數typeapi_keycontent必填
GET /queries/id: the query `id`, with its `content` as create_query takes it.
輸入參數id必填api_key
DELETE /queries/id: delete the query `id` and its grades.
輸入參數id必填api_key
GET /queries/id/results: `results`, the query's best items under any of `prefixes` (e.g. ["tools/"]; all
items by default), best first, each with its `score`, DNA's estimate of the grade you would give it (on the
grades' scale once the grid has some; before, only the order means anything), as list_items shows
it, without content. `ungraded`: leave out the items you already graded for this query. Grade what you judged with
put_grade: the results learn from it within a few seconds.
輸入參數id必填limitapi_keyprefixesungraded
PUT /queries/id/grades/key: grade the item at `key` (as get_results returns it, e.g. "42") for the query `id`.
`score` is from -1 (wrong) to 1 (right), anything between for partly right; it trains DNA and replaces the
grade before. Grade the results you judged, typically the first few.
輸入參數id必填key必填score必填api_key
GET /queries/id/grades/key: the query's grade of the item at `key`.
輸入參數id必填key必填api_key
DELETE /queries/id/grades/key: forget the query's grade of the item at `key`.
輸入參數id必填key必填api_key
GET /queries/id/grades: `grades`, the query's grades, {"key", "score"}, in path order.
輸入參數id必填api_key