feat: Add model version tracking with API endpoints and response metadata (#8795)
This commit is contained in:
@@ -240,6 +240,7 @@ class CompletionResponse(BaseModel):
|
||||
model: str
|
||||
choices: List[CompletionResponseChoice]
|
||||
usage: UsageInfo
|
||||
metadata: Optional[Dict[str, Any]] = None
|
||||
|
||||
|
||||
class CompletionResponseStreamChoice(BaseModel):
|
||||
@@ -517,6 +518,7 @@ class ChatCompletionResponse(BaseModel):
|
||||
model: str
|
||||
choices: List[ChatCompletionResponseChoice]
|
||||
usage: UsageInfo
|
||||
metadata: Optional[Dict[str, Any]] = None
|
||||
|
||||
|
||||
class DeltaMessage(BaseModel):
|
||||
|
||||
@@ -723,6 +723,7 @@ class OpenAIServingChat(OpenAIServingBase):
|
||||
model=request.model,
|
||||
choices=choices,
|
||||
usage=usage,
|
||||
metadata={"weight_version": ret[0]["meta_info"]["weight_version"]},
|
||||
)
|
||||
|
||||
def _process_logprobs_tokens(
|
||||
|
||||
@@ -373,6 +373,7 @@ class OpenAIServingCompletion(OpenAIServingBase):
|
||||
created=created,
|
||||
choices=choices,
|
||||
usage=usage,
|
||||
metadata={"weight_version": ret[0]["meta_info"]["weight_version"]},
|
||||
)
|
||||
|
||||
def _get_echo_text(self, request: CompletionRequest, index: int) -> str:
|
||||
|
||||
Reference in New Issue
Block a user