Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR centralizes and validates API key handling for the Ryzenth client and aligns documentation with the new authentication requirements. Class diagram for updated API key handling in Ryzenth clientclassDiagram
class _default_chats {
- parent
- _client
+ _get_client() RyzenthApiClient
}
class RyzenthApiClient {
+ tools_name
+ api_key
+ rate_limit
+ use_default_headers
}
class AuthenticationError
_default_chats --> RyzenthApiClient : uses
_default_chats --> AuthenticationError : raises
_default_chats : +_get_client() now validates api_key
_default_chats : +_get_client() raises AuthenticationError if api_key missing/invalid
RyzenthApiClient : +api_key expects {"ryzenth-v2": [{"Authorization": "Bearer <api_key>"}]}
Flow diagram for API key retrieval and validationflowchart TD
A["_get_client() called"] --> B["Check if _client is None"]
B --> C["Retrieve api_key from parent._api_key or RYZENTH_API_KEY env"]
C --> D{"Is api_key valid?"}
D -- No --> E["Raise AuthenticationError"]
D -- Yes --> F["Initialize RyzenthApiClient with api_key"]
F --> G["Assign to self._client"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Enforce API key validation for Ryzenth client initialization with proper bearer authorization and clean up README by removing outdated FAQ and updating example credentials
Enhancements:
Documentation: