From b31104768c7cf8d9c40be2898f817c6c622bab20 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Fri, 4 Aug 2023 12:27:47 -0700 Subject: [PATCH] filling out generate Signed-off-by: Matt Williams --- docs/api.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/docs/api.md b/docs/api.md index c2b9f8ca6..cdde3d52b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -3,19 +3,69 @@ # API ## Generate a Prompt -**/api/generate** +**POST /api/generate** +The **Generate** endpoint takes a JSON object with the following fields: + +``` +{ + Model: "modelname", + Prompt: "prompt", + Context: "context", +} +``` + +Context is optional, but is used to provide additional context, such as memory of earlier prompts. + +The response is a stream of JSON objects with the following fields: + +``` +{ + "model": "modelname", + "created_at": "2023-08-04T08:52:19.385406455-07:00" + "response": "the current token", + "done": false +} +``` + +| field | description | +| --- | --- | +| model | the name of the model | +| created_at | the time the response was generated | +| response | the current token | +| done | whether the response is complete | ## Create a Model -**/api/create** +**POST /api/create** ## List Local Models -**/api/list** +**GET /api/tags** + +### Return Object +``` +{ + "models": [ + { + "name": "modelname:tags", + "modified_at": "2023-08-04T08:52:19.385406455-07:00", + "size": size + } + ] + +} +``` ## Copy a Model **/api/copy** +## Delete a Model +**/api/delete** + ## Pull a Model **/api/pull** ## Push a Model -**/api/push** \ No newline at end of file +**/api/push** + +## Heartbeat +**/** +