mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-01 08:11:45 +00:00
feat(model): New metrics param to model API
This commit is contained in:
parent
1240352e54
commit
b45360441d
@ -54,6 +54,8 @@ class ModelOutput:
|
|||||||
model_context: Dict = None
|
model_context: Dict = None
|
||||||
finish_reason: str = None
|
finish_reason: str = None
|
||||||
usage: Dict[str, Any] = None
|
usage: Dict[str, Any] = None
|
||||||
|
metrics: Dict[str, Any] = None
|
||||||
|
"""Some metrics for model inference"""
|
||||||
|
|
||||||
def to_dict(self) -> Dict:
|
def to_dict(self) -> Dict:
|
||||||
return asdict(self)
|
return asdict(self)
|
||||||
|
@ -21,6 +21,8 @@ class PromptRequest(BaseModel):
|
|||||||
context_len: int = None
|
context_len: int = None
|
||||||
echo: bool = True
|
echo: bool = True
|
||||||
span_id: str = None
|
span_id: str = None
|
||||||
|
metrics: bool = False
|
||||||
|
"""Whether to return metrics of inference"""
|
||||||
|
|
||||||
|
|
||||||
class EmbeddingsRequest(BaseModel):
|
class EmbeddingsRequest(BaseModel):
|
||||||
|
Loading…
Reference in New Issue
Block a user