docs: update API Reference model_id from DevDocs (#2169)
docs: update API Reference model_id from DevDocs
This commit is contained in:
commit
69be8d730e
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user