Skip to content

Add Pydantic request validation for /ask-llm endpoint#60

Open
vanshjohri09-collab wants to merge 1 commit intosugarlabs:mainfrom
vanshjohri09-collab:question-validation
Open

Add Pydantic request validation for /ask-llm endpoint#60
vanshjohri09-collab wants to merge 1 commit intosugarlabs:mainfrom
vanshjohri09-collab:question-validation

Conversation

@vanshjohri09-collab
Copy link

@vanshjohri09-collab vanshjohri09-collab commented Mar 9, 2026

This PR introduces request validation for the /ask-llm endpoint using a Pydantic model.

Previously, the endpoint could accept empty or excessively long questions, which might lead to unnecessary processing or unexpected behavior in the AI pipeline. This change adds validation constraints to ensure the question field contains meaningful input within a reasonable length.

By validating the request at the API layer, this improves reliability and prevents invalid requests from reaching the LLM processing stage.

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