Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(simplebot)🔧: Refactor JSON response handling to use Pydantic models #161

Merged
merged 6 commits into from
Dec 20, 2024

Conversation

ericmjl
Copy link
Owner

@ericmjl ericmjl commented Dec 20, 2024

  • Added import for Pydantic BaseModel.
  • Implemented checks for pydantic_model attribute and its inheritance from BaseModel.
  • Updated the JSON response format to use json_schema from the Pydantic model.

… models

- Added import for Pydantic BaseModel.
- Implemented checks for pydantic_model attribute and its inheritance from BaseModel.
- Updated the JSON response format to use json_schema from the Pydantic model.
Copy link

github-actions bot commented Dec 20, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://ericmjl.github.io/llamabot/pr-preview/pr-161/
on branch gh-pages at 2024-12-20 10:49 UTC

…andling

- Filter message dumps to include only 'role' and 'content' keys.
- Change response format assignment to use direct model attribute.
- Remove unused imports and simplify task message generation.
- Streamline message processing and validation in StructuredBot.
…st handling

- Remove redundant model_config from StructuredBot class.
- Correct data type in test_structuredbot for mock_response.content to use a dictionary instead of a string.
… response

- Correct the format of mock_response.content to be a JSON string.
…irectly.

- Updated the StructuredBot to use the parsed codeblock directly in model construction.
- Modified the CommitMessage model to require the footer field explicitly.
…eration function.

- Eliminated an unnecessary print statement used for debugging purposes.
- Ensured the function returns the response without extraneous output.
@ericmjl ericmjl merged commit ebcf93d into main Dec 20, 2024
11 checks passed
@ericmjl ericmjl deleted the structuredbot-structured-output branch December 20, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant