"docs/vscode:/vscode.git/clone" did not exist on "87cf88ed3d351cc4e2b7cdd462ddf7a4ebf2109e"
Unverified Commit 68a54e06 authored by Xinyuan Tong's avatar Xinyuan Tong Committed by GitHub
Browse files

Sets default model name in request classes (#9683)


Signed-off-by: default avatarXinyuan Tong <xinyuantong.cs@gmail.com>
parent fd18995c
...@@ -35,6 +35,8 @@ from pydantic import ( ...@@ -35,6 +35,8 @@ from pydantic import (
) )
from typing_extensions import Literal from typing_extensions import Literal
DEFAULT_MODEL_NAME = "default"
class ModelCard(BaseModel): class ModelCard(BaseModel):
"""Model cards.""" """Model cards."""
...@@ -183,7 +185,7 @@ class BatchResponse(BaseModel): ...@@ -183,7 +185,7 @@ class BatchResponse(BaseModel):
class CompletionRequest(BaseModel): class CompletionRequest(BaseModel):
# Ordered by official OpenAI API documentation # Ordered by official OpenAI API documentation
# https://platform.openai.com/docs/api-reference/completions/create # https://platform.openai.com/docs/api-reference/completions/create
model: str model: str = DEFAULT_MODEL_NAME
prompt: Union[List[int], List[List[int]], str, List[str]] prompt: Union[List[int], List[List[int]], str, List[str]]
best_of: Optional[int] = None best_of: Optional[int] = None
echo: bool = False echo: bool = False
...@@ -410,7 +412,7 @@ class ChatCompletionRequest(BaseModel): ...@@ -410,7 +412,7 @@ class ChatCompletionRequest(BaseModel):
# Ordered by official OpenAI API documentation # Ordered by official OpenAI API documentation
# https://platform.openai.com/docs/api-reference/chat/create # https://platform.openai.com/docs/api-reference/chat/create
messages: List[ChatCompletionMessageParam] messages: List[ChatCompletionMessageParam]
model: str model: str = DEFAULT_MODEL_NAME
frequency_penalty: float = 0.0 frequency_penalty: float = 0.0
logit_bias: Optional[Dict[str, float]] = None logit_bias: Optional[Dict[str, float]] = None
logprobs: bool = False logprobs: bool = False
...@@ -572,7 +574,7 @@ class EmbeddingRequest(BaseModel): ...@@ -572,7 +574,7 @@ class EmbeddingRequest(BaseModel):
# Ordered by official OpenAI API documentation # Ordered by official OpenAI API documentation
# https://platform.openai.com/docs/api-reference/embeddings/create # https://platform.openai.com/docs/api-reference/embeddings/create
input: EmbeddingInput input: EmbeddingInput
model: str model: str = DEFAULT_MODEL_NAME
encoding_format: str = "float" encoding_format: str = "float"
dimensions: Optional[int] = None dimensions: Optional[int] = None
user: Optional[str] = None user: Optional[str] = None
...@@ -606,7 +608,7 @@ class ScoringRequest(BaseModel): ...@@ -606,7 +608,7 @@ class ScoringRequest(BaseModel):
) )
apply_softmax: bool = False apply_softmax: bool = False
item_first: bool = False item_first: bool = False
model: str model: str = DEFAULT_MODEL_NAME
class ScoringResponse(BaseModel): class ScoringResponse(BaseModel):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment