diff --git a/llamabot/bot/structuredbot.py b/llamabot/bot/structuredbot.py index d6dbfd8b7..dd9ae6f7a 100644 --- a/llamabot/bot/structuredbot.py +++ b/llamabot/bot/structuredbot.py @@ -118,9 +118,7 @@ def __call__( if attempt == num_attempts - 1: if self.allow_failed_validation and last_codeblock is not None: # If we allow failed validation, return the last attempt - return self.pydantic_model.model_construct( - **json.loads(last_codeblock) - ) + return self.pydantic_model.model_construct(**last_codeblock) raise e # Otherwise, if we failed, give the LLM the validation error and try again. diff --git a/llamabot/cli/git.py b/llamabot/cli/git.py index 45158ed44..634768e54 100644 --- a/llamabot/cli/git.py +++ b/llamabot/cli/git.py @@ -130,7 +130,9 @@ class CommitMessage(BaseModel): ..., description="Whether or not there is a breaking change in the commit. " ) - footer: str = Field("", description="An optional footer.") + footer: str = Field( + ..., description="An optional footer. Most of the time should be empty." + ) emoji: str = Field(..., description="An emoji that represents the commit content.") @model_validator(mode="after")