This repo contains the python backend for the Code4Me plugin(s). Below you can find the api specification for the endpoints.
The Base URL for the (currently) deployed server is:
https://code4me.me/
Each request must contain the following Authorization header:
Authorization: Bearer <TOKEN>
This token must be created once on the client, as a UUID v4, without dashes.
The current version of the API.
The autocompletion endpoint.
Content-Type: application/json
{
"leftContext": string,
"rightContext": string,
"triggerPoint": string,
"language": string,
"ide": string,
"keybind": boolean,
"pluginVersion": string,
"storeContext": boolean
}
leftContext: the context left of the predictionrightContext: the context right of the predictiontriggerPoint: the trigger keyword in case a trigger point was used, null otherwiselanguage: language of the source fileide: the ide the request was fired fromkeybind: a boolean indicating whether the keybind was used to autocompletepluginVersion: the version of the plugin that made the requeststoreContext: a boolean indicating whether the user allows to store the context
{
"predictions": string[],
"verifyToken": string,
"survey: boolean
}
predictions: the suggestion(s) made by the serververifyToken: a token to be used for the/api/v1/prediction/verifyendpoint.survey: whether a survey should be prompted to the user
The verification endpoint. Called after 30 seconds from the client, such that the server knows the ground truth of the prediction.
Content-Type: application/json
{
"verifyToken": string,
"chosenPrediction": string | null,
"groundTruth": string
}
verifyToken: the token from the response of/api/v1/prediction/autocompletechosenPrediction: the chosen prediction from the clientgroundTruth: the ground truth of the prediction (the line from the same offset as the completion after 30s)
N/A