Create a code based on given topic.
CURL
curl -H 'content-type: application/json'
-H 'Accept: application/json'
-H 'api-key: your-key'
-X POST https://www.learnitive.com/api/v1/codes
--data '{"input": "Bubble sort with input",
"mode": "python",
"model": "expert",
"max_tokens":"256",
"temperature":"0"
}'
Output
Example output.
{
"success": true,
"status": "success",
"message": [{
"index": 0,
"text": "def bubble_sort(arr):\n n = len(arr)\n for i in range(n):\n for j in range(0, n-i-1):\n...",
"id":"b2f5ff95-46b2-4c92-8674-74aaa0c73831"
}]
}
Parameter
- input: string. The topic of the code.
- mode: string. Languages: “python”, “java”, “go”, “php”, “javascript”, “js_regex”. Default: “python”
- max_tokens: integer. The maximum number of tokens to generate. Default: 256
- model: The language model to use, “fast”, “balanced”, “strong” and “expart”. Defaul: “fast”.
- emperature: number. The sampling temperature to be used in text generation. The higher the temperature, the higher the risk of the output to sound “made up”. Default: 0.65