|
|
|
@ -164,3 +164,91 @@ class ManySteps(BaseModel):
|
|
|
|
|
[],
|
|
|
|
|
description="A list of task steps.",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GenerationOutputMetadata(BaseModel):
|
|
|
|
|
num_of_tokens: int = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The number of tokens generated.",
|
|
|
|
|
examples=[7894],
|
|
|
|
|
)
|
|
|
|
|
estimated_cost: str = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The estimated cost of the generation.",
|
|
|
|
|
examples=["0,24$"],
|
|
|
|
|
)
|
|
|
|
|
time_to_generate: str = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The time taken to generate the output.",
|
|
|
|
|
examples=["1.2s"],
|
|
|
|
|
)
|
|
|
|
|
tokens_per_second: int = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The number of tokens generated per second.",
|
|
|
|
|
examples=[657],
|
|
|
|
|
)
|
|
|
|
|
model_name: str = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The model used to generate the output.",
|
|
|
|
|
examples=["gpt-3.5-turbo"],
|
|
|
|
|
)
|
|
|
|
|
max_tokens: int = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The maximum number of tokens allowed to generate.",
|
|
|
|
|
examples=[2048],
|
|
|
|
|
)
|
|
|
|
|
temperature: float = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The temperature used for generation.",
|
|
|
|
|
examples=[0.7],
|
|
|
|
|
)
|
|
|
|
|
top_p: float = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The top p value used for generation.",
|
|
|
|
|
examples=[0.9],
|
|
|
|
|
)
|
|
|
|
|
frequency_penalty: float = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The frequency penalty used for generation.",
|
|
|
|
|
examples=[0.0],
|
|
|
|
|
)
|
|
|
|
|
presence_penalty: float = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The presence penalty used for generation.",
|
|
|
|
|
examples=[0.0],
|
|
|
|
|
)
|
|
|
|
|
stop_sequence: str | None = Field(
|
|
|
|
|
None,
|
|
|
|
|
description="The sequence used to stop the generation.",
|
|
|
|
|
examples=["<stop_sequence>"],
|
|
|
|
|
)
|
|
|
|
|
model_type: str = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The type of model used for generation.",
|
|
|
|
|
examples=["text"],
|
|
|
|
|
)
|
|
|
|
|
model_version: str = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The version of the model used for generation.",
|
|
|
|
|
examples=["1.0.0"],
|
|
|
|
|
)
|
|
|
|
|
model_description: str = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The description of the model used for generation.",
|
|
|
|
|
examples=["A model that generates text."],
|
|
|
|
|
)
|
|
|
|
|
model_author: str = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The author of the model used for generation.",
|
|
|
|
|
examples=["John Doe"],
|
|
|
|
|
)
|
|
|
|
|
n: int = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The number of outputs generated.",
|
|
|
|
|
examples=[1],
|
|
|
|
|
)
|
|
|
|
|
n_best: int = Field(
|
|
|
|
|
...,
|
|
|
|
|
description="The number of best outputs generated.",
|
|
|
|
|
examples=[1],
|
|
|
|
|
)
|
|
|
|
|