docs: update API Reference download model from DevDocs (#2170)

docs: update API Reference download model from DevDocs
This commit is contained in:
Henry 2024-03-02 17:22:44 +09:00 committed by GitHub
commit 199c272164
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -171,10 +171,40 @@ paths:
$ref: specs/models.yaml#/components/schemas/DownloadModelResponse
x-codeSamples:
- lang: cURL
source: |
source: |-
curl -X 'GET' \
'http://localhost:1337/v1/models/download/{model_id}' \
-H 'accept: application/json'
- lang: JavaScript
source: >-
const response = await
fetch('http://localhost:1337/v1/models/download/{model_id}', {
method: 'GET',
headers: {accept: 'application/json'}
});
const data = await response.json();
- lang: Node.js
source: |-
const fetch = require('node-fetch');
fetch('http://localhost:1337/v1/models/download/{model_id}', {
method: 'GET',
headers: {accept: 'application/json'}
})
.then(res => res.json())
.then(data => console.log(data));
- lang: Python
source: >-
import requests
response =
requests.get('http://localhost:1337/v1/models/download/{model_id}',
headers={'accept': 'application/json'})
data = response.json()
/models/{model_id}:
get:
operationId: retrieveModel