add docs for the model/model_id endpoints
This commit is contained in:
parent
d7bf98b68a
commit
16357178bf
@ -113,38 +113,10 @@ paths:
|
|||||||
$ref: specs/models.yaml#/components/schemas/ListModelsResponse
|
$ref: specs/models.yaml#/components/schemas/ListModelsResponse
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: cURL
|
- lang: cURL
|
||||||
source: |-
|
source: |
|
||||||
curl -X 'GET' \
|
curl -X 'GET' \
|
||||||
'http://localhost:1337/v1/models' \
|
'http://localhost:1337/v1/models' \
|
||||||
-H 'accept: application/json'
|
-H 'accept: application/json'
|
||||||
- lang: JavaScript
|
|
||||||
source: |-
|
|
||||||
const response = await fetch('http://localhost:1337/v1/models', {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {Accept: 'application/json'}
|
|
||||||
});
|
|
||||||
const data = await response.json();
|
|
||||||
- lang: Python
|
|
||||||
source: |-
|
|
||||||
import requests
|
|
||||||
|
|
||||||
url = 'http://localhost:1337/v1/models'
|
|
||||||
headers = {'Accept': 'application/json'}
|
|
||||||
response = requests.get(url, headers=headers)
|
|
||||||
data = response.json()
|
|
||||||
- lang: Node.js
|
|
||||||
source: |-
|
|
||||||
const fetch = require('node-fetch');
|
|
||||||
|
|
||||||
const url = 'http://localhost:1337/v1/models';
|
|
||||||
const options = {
|
|
||||||
method: 'GET',
|
|
||||||
headers: { Accept: 'application/json' }
|
|
||||||
};
|
|
||||||
|
|
||||||
fetch(url, options)
|
|
||||||
.then(res => res.json())
|
|
||||||
.then(json => console.log(json));
|
|
||||||
/models/download/{model_id}:
|
/models/download/{model_id}:
|
||||||
get:
|
get:
|
||||||
operationId: downloadModel
|
operationId: downloadModel
|
||||||
@ -204,10 +176,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 +244,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