The root API of Stenography is /
.
The results from /
feed into /autopilot
/
The core API works on all the major programming languages. The API's purpose is to provide helpful knowledge for a code block to make coding easier.
curl --request POST \\
--url <https://stenography-worker.stenography.workers.dev/> \\
--header 'Content-Type: application/json' \\
--data '{
"code": "[REQUIRED] {...}",
"api_key": "[REQUIRED] MY_API_KEY",
"audience": "[REQUIRED] pm"
"populate": "[OPTIONAL] true",
"stackoverflow": "[OPTIONAL] true",
}'
code
- the block of code you want explainedaudience
- "pm" (in the future there will be different audience arguments) a simple straightforward explanation of what the code block is doingpopulate
- hydrate the response with documentation links from across the webstackoverflow
- hydrate the response with Stack Overflow search suggestions{
"pm": "..."
"metadata": {
"language": "..."
}
"stackoverflow": {
"stackOverflowURLs": [
{
"question": "...?",
"url": "<https://stackoverflow.com/search?q=>..."
},
}
pm
- simple English response from Stenography. Can be populate
with relevant documentation links as <a href"...">
metadata
- extraneous data
language
- Stenography will guess at what language the code block is instackoverflow.stackOverflowURLs[]
- a list of potential {question, url}
generated by StenographyTry completing against individual functions that follow the Clean Code rules for best results
Like functions, according to Clean Code, classes should also be “smaller than small”. Some people recommend that 200 lines is a good limit for a class – not a method, or as few as 50-60 lines (in Ben Nadel's Object Calisthenics exercise) and that a class should consist of “less than 10” or “not more than 20” methods.