Feature/pyagenity 0.2.1#2
Merged
Merged
Conversation
- Added injectq_path property to GraphConfig for injectq configuration. - Introduced redis_url property to GraphConfig for Redis connection. - Enhanced auth_config method to support JWT and custom authentication methods. - Added generate_thread_name and thread_model_name properties to GraphConfig. fix: Improve Sentry initialization with error handling - Wrapped Sentry initialization in a try-except block to handle ImportError and other exceptions gracefully. refactor: Update Settings class for improved configuration - Changed SUMMARY value to "Pyagenity Backend". - Removed unused JWT and auth-related settings from the Settings class. feat: Implement InjectQ and BaseAuth loading in loader.py - Added load_container and load_auth functions to load InjectQ and BaseAuth dynamically. - Updated attach_all_modules to bind the auth backend to the container. chore: Update main.py to integrate new loading mechanisms - Refactored lifespan context manager to load graph and auth backend using new methods. - Ensured proper resource cleanup on application shutdown. feat: Enhance CheckpointerService with state caching - Updated put_state method to also update the state cache after storing the state. refactor: Streamline GraphService for improved streaming - Refactored stream_graph method to use AsyncIterable for streaming responses. - Improved thread name generation logic based on new config properties. feat: Introduce ThreadService for dynamic thread name generation - Implemented thread name generation using LLM based on conversation context. - Added methods for saving and generating thread names based on messages. chore: Remove deprecated text.py and replace with api_check.py - Consolidated API testing logic into a new api_check.py file for better organization. feat: Add base authentication structure with JWT support - Created BaseAuth class for defining authentication methods. - Implemented JwtAuth class for handling JWT-based authentication. feat: Implement Snowflake ID generator for unique ID creation - Added SnowFlakeIdGenerator class to generate unique IDs using Snowflake algorithm.
Sarthak422004
pushed a commit
to Sarthak422004/pyagenity-api
that referenced
this pull request
Sep 24, 2025
Replace with Injector
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.
This pull request refactors and improves the authentication and configuration system for the Pyagenity API. It introduces a flexible, pluggable authentication backend architecture, updates configuration handling, and enhances module loading and dependency injection. The changes also improve error handling and modularity, making it easier to customize authentication and other integrations.
Authentication System Refactor:
BaseAuthclass (pyagenity_api/src/app/core/auth/base_auth.py) to define a standard authentication interface, enabling pluggable authentication backends.JwtAuthclass (pyagenity_api/src/app/core/auth/jwt_auth.py) for JWT-based authentication, replacing the previous inline JWT logic and improving error handling.auth_backend.pyto use dependency injection for loading authentication backends, removing the oldverify_jwtfunction and supporting custom or JWT methods via configuration. [1] [2]Configuration and Module Loading:
GraphConfigto support new fields (injectq,redis,thread_model_name, etc.), flexible authentication configuration, and improved error handling for unsupported auth methods. [1] [2]load_container,load_auth,attach_all_modules) inloader.pyto support dynamic loading and binding of containers and authentication backends using dependency injection.Application Initialization and Error Handling:
main.pyto use the new container and attach modules viaattach_all_modules, binding configuration and authentication instances for use throughout the app. Improved shutdown resource cleanup. [1] [2] [3]sentry_config.pyto handle missing dependencies gracefully and log warnings instead of failing. [1] [2] [3]Documentation and Miscellaneous:
Config.md) to describe supported authentication methods and configuration options.These changes collectively modernize the authentication system and configuration handling, making the API framework more extensible and robust for future integrations.