docs: update API Reference model_id from DevDocs (#2169)

docs: update API Reference model_id from DevDocs
This commit is contained in:
Henry 2024-03-02 17:16:53 +09:00 committed by GitHub
commit 69be8d730e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -204,10 +204,47 @@ paths:
$ref: specs/models.yaml#/components/schemas/GetModelResponse $ref: specs/models.yaml#/components/schemas/GetModelResponse
x-codeSamples: x-codeSamples:
- lang: cURL - lang: cURL
source: | source: |-
curl -X 'GET' \ curl -X 'GET' \
'http://localhost:1337/v1/models/{model_id}' \ 'http://localhost:1337/v1/models/{model_id}' \
-H 'accept: application/json' -H 'accept: application/json'
- lang: JavaScript
source: |-
const fetch = require('node-fetch');
const modelId = 'mistral-ins-7b-q4';
fetch(`http://localhost:1337/v1/models/${modelId}`, {
method: 'GET',
headers: {'accept': 'application/json'}
})
.then(res => res.json())
.then(json => console.log(json));
- lang: Node.js
source: |-
const fetch = require('node-fetch');
const modelId = 'mistral-ins-7b-q4';
fetch(`http://localhost:1337/v1/models/${modelId}`, {
method: 'GET',
headers: {'accept': 'application/json'}
})
.then(res => res.json())
.then(json => console.log(json));
- lang: Python
source: >-
import requests
model_id = 'mistral-ins-7b-q4'
response =
requests.get(f'http://localhost:1337/v1/models/{model_id}',
headers={'accept': 'application/json'})
print(response.json())
delete: delete:
operationId: deleteModel operationId: deleteModel
tags: tags:
@ -235,10 +272,45 @@ paths:
$ref: specs/models.yaml#/components/schemas/DeleteModelResponse $ref: specs/models.yaml#/components/schemas/DeleteModelResponse
x-codeSamples: x-codeSamples:
- lang: cURL - lang: cURL
source: | source: |-
curl -X 'DELETE' \ curl -X 'DELETE' \
'http://localhost:1337/v1/models/{model_id}' \ 'http://localhost:1337/v1/models/{model_id}' \
-H 'accept: application/json' -H 'accept: application/json'
- lang: JavaScript
source: |-
const fetch = require('node-fetch');
const modelId = 'mistral-ins-7b-q4';
fetch(`http://localhost:1337/v1/models/${modelId}`, {
method: 'DELETE',
headers: { 'accept': 'application/json' }
})
.then(res => res.json())
.then(json => console.log(json));
- lang: Node.js
source: |-
const fetch = require('node-fetch');
const modelId = 'mistral-ins-7b-q4';
fetch(`http://localhost:1337/v1/models/${modelId}`, {
method: 'DELETE',
headers: { 'accept': 'application/json' }
})
.then(res => res.json())
.then(json => console.log(json));
- lang: Python
source: >-
import requests
model_id = 'mistral-ins-7b-q4'
response =
requests.delete(f'http://localhost:1337/v1/models/{model_id}',
headers={'accept': 'application/json'})
/threads: /threads:
post: post:
operationId: createThread operationId: createThread