Skip to content

Conversation

@OEvortex
Copy link
Owner

Summary

  • update the /v1/chat/completions example body so Swagger UI shows proper parameters
  • require a ChatCompletionRequest body in chat_completions

Testing

  • ruff check webscout/Provider/OPENAI/api.py | head -n 5
  • ruff check webscout/Provider/OPENAI/api.py | tail -n 20

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the /v1/chat/completions endpoint by revising the example request body in Swagger UI and enforcing a required ChatCompletionRequest body in the endpoint signature.

  • Updated the example schema to include "messages", "max_tokens", and "temperature" parameters.
  • Changed the API endpoint from accepting an optional ChatCompletionRequest via manual fallback parsing to requiring it via Body(...).
Comments suppressed due to low confidence (2)

webscout/Provider/OPENAI/api.py:612

  • The removal of the manual parsing fallback means that invalid or missing request bodies will now rely on Pydantic validation. Please add tests to validate proper error responses for invalid input scenarios to ensure robust request handling.
chat_request: ChatCompletionRequest = Body(...)

webscout/Provider/OPENAI/api.py:598

  • The updated schema example now excludes fields like 'model', 'choices', and 'usage'. Please ensure that the API documentation is updated accordingly to reflect the new example schema and parameter expectations.
"messages": [

@OEvortex OEvortex merged commit 139c1c2 into main May 20, 2025
2 of 3 checks passed
@OEvortex OEvortex deleted the codex/fix-swagger-ui-parameters-and-api-body-issue branch December 1, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants