From bb43789314eeb29f1edf50de078b6caa2063a2e9 Mon Sep 17 00:00:00 2001 From: Dmitry Paramonov Date: Thu, 9 May 2024 17:20:47 +0300 Subject: [PATCH] fix: Make tool ID optional, support older syntax --- model-serving/model_api/protocol.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model-serving/model_api/protocol.py b/model-serving/model_api/protocol.py index dcffdce40..ba566abdd 100644 --- a/model-serving/model_api/protocol.py +++ b/model-serving/model_api/protocol.py @@ -1,5 +1,5 @@ from enum import Enum -from typing import Literal, TypeAlias, Union +from typing import Literal, TypeAlias, Union, Optional from pydantic import BaseModel, Field, ConfigDict, validator from vllm.entrypoints.openai.protocol import ( CompletionRequest, @@ -93,7 +93,7 @@ class Type(Enum): class Tool(BaseModel): type: Type function: FunctionDef - id: str | None = None + id: Optional[str] = None class SamplingParams(SamplingParams):