<commit_before>HTTP API
========

QM's Application Programming Interface (API) uses JavaScript Object Notation
(JSON) as its common data interchange format and Hypertext Transfer Protocol
(HTTP) as its communications protocol. It also supports
`Cross-Origin Resource Sharing <http://www.w3.org/TR/cors/>`_.


Stable
------

This table specifies the "routes" understood by QM's API server. Request and
response data use JSON format, but data may be omitted where values are left
blank. JSON objects are denoted ``{}``, and JSON arrays are denoted ``[]``.


================= ============================= ======== ======== =======
 HTTP Request                                            HTTP Response
-------------------------------------------------------- ----------------
 Method           URL                           Data     Code     Data
================= ============================= ======== ======== =======
 GET              /box/cardboard?key=world               200      ``{}``
 GET              /box/cardboard?status=waiting          200      ``[]``
 POST             /box/cardboard?key=world      ``{}``   201
================= ============================= ======== ======== =======


The data model is based on Quanah_'s asynchronous variables ("avars"). An
avar is a JS object that acts as a generic container for other types. Each avar
stores a unique identifier, "key", alongside the contained data, "val". QM
extends this model for by adding a "box" parameter to allow grouping and a
"status" parameter for avars that represent job descriptions.


Get avar
~~~~~~~~

To get the value of an avar, a client must request it by known box and known
key.

For the first route, an avar storing a value of 2 would look like

.. code-block:: js

    {"box":"cardboard","key":"world","val":2}


Get jobs
~~~~~~~~

To get unknown job descriptions, a client must request a list of their keys by
known box and known status.<commit_msg>Removed another mistake<commit_after>HTTP API
========

QM's Application Programming Interface (API) uses JavaScript Object Notation
(JSON) as its common data interchange format and Hypertext Transfer Protocol
(HTTP) as its communications protocol. It also supports
`Cross-Origin Resource Sharing <http://www.w3.org/TR/cors/>`_.


Stable
------

This table specifies the "routes" understood by QM's API server. Request and
response data use JSON format, but data may be omitted where values are left
blank. JSON objects are denoted ``{}``, and JSON arrays are denoted ``[]``.


================= ============================= ======== ======== =======
 HTTP Request                                            HTTP Response
-------------------------------------------------------- ----------------
 Method           URL                           Data     Code     Data
================= ============================= ======== ======== =======
 GET              /box/cardboard?key=world               200      ``{}``
 GET              /box/cardboard?status=waiting          200      ``[]``
 POST             /box/cardboard?key=world      ``{}``   201
================= ============================= ======== ======== =======


The data model is based on Quanah_'s asynchronous variables ("avars"). An
avar is a JS object that acts as a generic container for other types. Each avar
stores a unique identifier, "key", alongside the contained data, "val". QM
extends this model by adding a "box" parameter to allow grouping and a "status"
parameter for avars that represent job descriptions.


Get avar
~~~~~~~~

To get the value of an avar, a client must request it by known box and known
key.

For the first route, an avar storing a value of 2 would look like

.. code-block:: js

    {"box":"cardboard","key":"world","val":2}


Get jobs
~~~~~~~~

To get unknown job descriptions, a client must request a list of their keys by
known box and known status.
{'fraction_non_alphanumeric': 0.22125256673511293, 'fraction_numerical': 0.006160164271047228, 'mean_word_length': 2.662593984962406, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '574571', 'n_tokens_mistral': 970, 'n_tokens_neox': 893, 'n_words': 416}