From 6303c8c61d798414741f0fd272d39f04b603b16d Mon Sep 17 00:00:00 2001 From: vmpuri <45368418+vmpuri@users.noreply.github.com> Date: Wed, 31 Jul 2024 15:39:26 -0700 Subject: [PATCH] Add warning comments referring to unimplemented functionality --- api/api.py | 11 +++++++++++ server.py | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/api/api.py b/api/api.py index e52870d60..be5a1cfbf 100644 --- a/api/api.py +++ b/api/api.py @@ -224,6 +224,17 @@ def __init__(self, *args, **kwargs): def completion(self, completion_request: CompletionRequest): """Handle a chat completion request and yield a chunked response. + ** Warning ** : Not all arguments of the CompletionRequest are consumed as the server isn't completely implemented. + Current treatment of parameters is described below. + + - messages: The server consumes the final element of the array as the prompt. + - model: This has no impact on the server state, i.e. changing the model in the request + will not change which model is responding. Instead, use the --model flag to seelect the model when starting the server. + - temperature: This is used to control the randomness of the response. The server will use the temperature + + See https://github.com/pytorch/torchchat/issues/973 for more details. + + Args: completion_request: Request object with prompt and other parameters. diff --git a/server.py b/server.py index a9132b98d..7ffa0b56f 100644 --- a/server.py +++ b/server.py @@ -21,6 +21,11 @@ def chat_endpoint(): """ Endpoint for the Chat API. This endpoint is used to generate a response to a user prompt. This endpoint emulates the behavior of the OpenAI Chat API. (https://platform.openai.com/docs/api-reference/chat) + + ** Warning ** : Not all arguments of the CompletionRequest are consumed. + + See https://github.com/pytorch/torchchat/issues/973 and the OpenAiApiGenerator class for more details. + """ data = request.get_json()