From 015a29f344ac0bb6c25784cf67b8fdc93c443aa9 Mon Sep 17 00:00:00 2001 From: vinicvaz Date: Thu, 18 Jan 2024 08:52:48 -0300 Subject: [PATCH] summarizer input model tests --- pieces/PromptCreatorForImageGeneratorPiece/models.py | 6 +++--- pieces/TextGeneratorPiece/models.py | 2 +- pieces/TextSummarizerPiece/models.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pieces/PromptCreatorForImageGeneratorPiece/models.py b/pieces/PromptCreatorForImageGeneratorPiece/models.py index 37002df..87b272a 100644 --- a/pieces/PromptCreatorForImageGeneratorPiece/models.py +++ b/pieces/PromptCreatorForImageGeneratorPiece/models.py @@ -23,7 +23,7 @@ class InputModel(BaseModel): """ context: str = Field( ..., - description="The context to generate an image from" + description="The context to generate an image from", ) art_style: str = Field( default="You know many art styles, so you always vary a lot on your suggestions!", @@ -32,7 +32,7 @@ class InputModel(BaseModel): output_type: OutputTypeType = Field( default=OutputTypeType.string, description="The type of output to return" - + ) openai_model: LLMModelType = Field( default=LLMModelType.gpt_3_5_turbo, @@ -67,7 +67,7 @@ class OutputModel(BaseModel): class SecretsModel(BaseModel): """ PromptCreatorForImageGeneratorPiece secrets model - """ + """ OPENAI_API_KEY: str = Field( description="Your OpenAI API key" ) \ No newline at end of file diff --git a/pieces/TextGeneratorPiece/models.py b/pieces/TextGeneratorPiece/models.py index 43948e3..0ef44d5 100644 --- a/pieces/TextGeneratorPiece/models.py +++ b/pieces/TextGeneratorPiece/models.py @@ -63,7 +63,7 @@ class InputModel(BaseModel): description="OpenAI model name." ) completion_max_tokens: int = Field( - default=500, + default=500, description="The maximum number of tokens in the generated text." ) temperature: float = Field( diff --git a/pieces/TextSummarizerPiece/models.py b/pieces/TextSummarizerPiece/models.py index d39f750..829520c 100644 --- a/pieces/TextSummarizerPiece/models.py +++ b/pieces/TextSummarizerPiece/models.py @@ -24,15 +24,15 @@ class InputModel(BaseModel): """ TextSummarizerPiece Input model """ - text: Optional[str] = Field( - default=None, + text: str = Field( + default="", description="Text to summarize", json_schema_extra={ 'widget': "textarea", } ) - text_file_path: Optional[str] = Field( - default=None, + text_file_path: str = Field( + default="", description="Use it only if not using text field. File path to the text to summarize", json_schema_extra={ "from_upstream": "always"