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

This pull request adds request validation for the "/ask-llm" endpoint using a Pydantic model.

Changes

  • Added "QuestionRequest" Pydantic model with validation rules
  • Added "min_length" and "max_length" constraints for the "question" field
  • Updated "/ask-llm" endpoint to accept structured request body

Benefits

  • Prevents empty or invalid questions
  • Improves API reliability
  • Follows best practices for request validation in FastAPI

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