-
-
Notifications
You must be signed in to change notification settings - Fork 416
Allow chat handlers to be initialized in any order #1268
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
@Darshan808 Thank you for working on this so quickly! The code looks perfect, aside from some minor feedback above. |
Thanks for the feedback |
Good work @Darshan808 |
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.
@Darshan808 Awesome, thank you! 🎉
I'll merge this to help fix Jupyter AI on main
. Can you help backport this to 2.x
?
@meeseeksdev please backport to 2.x |
Oh wow, it was backported without conflicts. Didn't expect that. We can take this from here and reach out if we need anything. |
…#1269) Co-authored-by: Darshan Poudel <[email protected]>
* lazy-initialize-retriever * add-retriever-property
* make native chat handlers customizable * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove-ci-error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add-disabled-check-and-sort-entrypoints * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor Chat Handlers to Simplify Initialization (#1257) * simplify-entrypoints-loading * fix-lint * fix-tests * add-retriever-typing * remove-retriever-from-base * fix-circular-import(ydoc-import) * fix-tests * fix-type-check-failure * refactor-retriever-init * Allow chat handlers to be initialized in any order (#1268) * lazy-initialize-retriever * add-retriever-property * rebase-into-main * update-docs * update-documentation --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* make native chat handlers customizable * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove-ci-error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add-disabled-check-and-sort-entrypoints * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor Chat Handlers to Simplify Initialization (jupyterlab#1257) * simplify-entrypoints-loading * fix-lint * fix-tests * add-retriever-typing * remove-retriever-from-base * fix-circular-import(ydoc-import) * fix-tests * fix-type-check-failure * refactor-retriever-init * Allow chat handlers to be initialized in any order (jupyterlab#1268) * lazy-initialize-retriever * add-retriever-property * rebase-into-main * update-docs * update-documentation --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…enAI provider (#1264) * Simplifying the OpenAI provider to use multiple model providers * Update openrouter.md * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * openai general interface added * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * embedding * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Updated settings to take OpenAI generic embedding models * added openai generic embeddings screenshot * Fixed Issue 1261 * bump version floor on jupyter server * linter * adding embedding model fields * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update test_config_manager * Update pyproject.toml * Update pyproject.toml * Update pyproject.toml * pyproject.toml fixes * pyproject.toml updates * Update pyproject.toml * Update pyproject.toml * Make Native Chat Handlers Overridable via Entry Points (#1249) * make native chat handlers customizable * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove-ci-error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add-disabled-check-and-sort-entrypoints * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor Chat Handlers to Simplify Initialization (#1257) * simplify-entrypoints-loading * fix-lint * fix-tests * add-retriever-typing * remove-retriever-from-base * fix-circular-import(ydoc-import) * fix-tests * fix-type-check-failure * refactor-retriever-init * Allow chat handlers to be initialized in any order (#1268) * lazy-initialize-retriever * add-retriever-property * rebase-into-main * update-docs * update-documentation --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * pyproject toml files * pyproject toml updates * update snapshot * writing config file correctly * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * tsx lint * Update use-server-info.ts * Update pyproject.toml * adds embedding_models attribute * Fixed display of Base url for embeddings and completions * removed embedding_models * Added help fields * Update chat-settings.tsx * minor reversions moved to new issue --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Darshan Poudel <[email protected]>
Fixes #1267
This PR resolves issue seen in #1257 by ensuring that chat handlers can be initialized in any order.
Specifically, it modifies
AskChatHandler._retriever
to be a lazily initialized property, eliminating the need forLearnChatHandler
to be defined and stored before initializingAskChatHandler
. This improves maintainability and flexibility in handler initialization.