-
-
Notifications
You must be signed in to change notification settings - Fork 42
Improve Parameter Handling and Logger Output #134
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
Conversation
There was a problem hiding this 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 improves error handling and debugging capabilities for the OpenAI LLM integration by adding support for invalid request errors (HTTP 400), enhancing debug logging for undocumented responses, and fixing parameter handling to only send the stop parameter when it's specified.
Key Changes:
- Add new
invalidRequesterror case with localized error messages for HTTP 400 responses - Implement debug logging to capture response body details when undocumented errors occur
- Conditionally include the
stopparameter only when the stop sequence is not empty
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Sources/SpeziLLMOpenAI/Resources/Localizable.xcstrings | Adds localized strings for invalid request error (description, failure reason, recovery suggestion) |
| Sources/SpeziLLMOpenAI/LLMOpenAISession+Generation.swift | Adds debug logging to capture and log response body for undocumented errors |
| Sources/SpeziLLMOpenAI/LLMOpenAISession+Configuration.swift | Conditionally sets stop parameter to nil when stopSequence is empty |
| Sources/SpeziLLMOpenAI/LLMOpenAIError.swift | Adds new invalidRequest error case, implements error handling for HTTP 400, and adds error messages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #134 +/- ##
==========================================
- Coverage 44.64% 44.47% -0.17%
==========================================
Files 69 69
Lines 522 524 +2
==========================================
Hits 233 233
- Misses 289 291 +2
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Improve Parameter Handling and Logger Output
♻️ Current situation & Problem
⚙️ Release Notes
📝 Code of Conduct & Contributing Guidelines
By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: