-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Remove initialize() Method from LlamaStackAsLibrary #2979
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
feat: Remove initialize() Method from LlamaStackAsLibrary #2979
Conversation
Code overall is looking good to me, not sure why those unit tests are failing? |
i tried to fix them but seems unrelated to my changes 🤔 |
I forgot why I had added a separate |
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.
please remove all extraneous changes
3eec93f
to
ea66d34
Compare
@ashwinb probably __init__ can't be async |
Yeah. But I didn't know about |
ea66d34
to
74817a7
Compare
3334941
to
692843f
Compare
269c854
to
af21f69
Compare
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.
why did you remove skip_logger_removal
from the sync client and add it to the async client?
thanks for your review 🙏🏽 so i received this review #2979 (comment), which actually makes sense imo :) please let me know if you have other thoughts |
0ec41e9
to
78f7be7
Compare
Hi @ashwinb Any more required changes here ? If not, I would appreciate it very much if we merge this PR. I have already 4 open PRs, and I can not pick up more work till I merge them :) thanks in advance :) |
78f7be7
to
a39ca14
Compare
rebased 👍🏽 |
07c04cf
to
a1c4f17
Compare
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.
downgrading my review to a comment. looks like @ashwinb has this handled.
681182d
to
a8436ee
Compare
rebased 👍🏽 cc @ashwinb |
a8436ee
to
3e3a380
Compare
3e3a380
to
5bc261f
Compare
Currently client.initialize() had to be invoked by user. To improve dev experience and to avoid runtime errors, this PR init LlamaStackAsLibrary implicitly upon using the client. It prevents also multiple init of the same client, while maintaining backward ccompatibility. Signed-off-by: Mustafa Elbehery <[email protected]>
…r removing initialize method The recent refactor (3778a4c) introduced automatic initialization for LlamaStackAsLibraryClient but the unit tests were expecting manual initalization and _is_initialized. This caused test failure. Changes: - Update test assertions to check route_impls is not None instead of _is_initialized - Add proper mocking in tests to avoid external provider dependencies - Maintain test coverage for automatic initialization behavior - Ensure backward compatibility testing for deprecated initialize() method Signed-off-by: Mustafa Elbehery <[email protected]>
5bc261f
to
2ebdfce
Compare
…#2979) # What does this PR do? <!-- Provide a short summary of what this PR does and why. Link to relevant issues if applicable. --> This PR removes `init()` from `LlamaStackAsLibrary` Currently client.initialize() had to be invoked by user. To improve dev experience and to avoid runtime errors, this PR init LlamaStackAsLibrary implicitly upon using the client. It prevents also multiple init of the same client, while maintaining backward ccompatibility. This PR does the following - Automatic Initialization: Constructor calls initialize_impl() automatically. - Client is fully initialized after __init__ completes. - Prevents consecutive initialization after the client has been successfully initialized. - initialize() method still exists but is now a no-op. <!-- If resolving an issue, uncomment and update the line below --> <!-- Closes #[issue-number] --> fixes llamastack#2946 --------- Signed-off-by: Mustafa Elbehery <[email protected]>
What does this PR do?
This PR removes
init()
fromLlamaStackAsLibrary
Currently client.initialize() had to be invoked by user.
To improve dev experience and to avoid runtime errors, this PR init LlamaStackAsLibrary implicitly upon using the client.
It prevents also multiple init of the same client, while maintaining backward ccompatibility.
This PR does the following
fixes #2946