Skip to content
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

Base chat handler refactor for custom slash commands #398

Merged
merged 35 commits into from
Dec 7, 2023

Conversation

JasonWeill
Copy link
Collaborator

@JasonWeill JasonWeill commented Sep 27, 2023

Prep for #351.

Refactors chat handlers to use the entry points framework.

Known issue: The /help message does not pull from chat handlers' help messages. (#436)

@3coins 3coins added the enhancement New feature or request label Sep 27, 2023
packages/jupyter-ai/jupyter_ai/chat_handlers/base.py Outdated Show resolved Hide resolved
packages/jupyter-ai/jupyter_ai/chat_handlers/base.py Outdated Show resolved Hide resolved
packages/jupyter-ai/jupyter_ai/chat_handlers/base.py Outdated Show resolved Hide resolved
packages/jupyter-ai/jupyter_ai/chat_handlers/base.py Outdated Show resolved Hide resolved
packages/jupyter-ai/jupyter_ai/extension.py Outdated Show resolved Hide resolved
packages/jupyter-ai/jupyter_ai/extension.py Outdated Show resolved Hide resolved
packages/jupyter-ai/jupyter_ai/extension.py Outdated Show resolved Hide resolved
packages/jupyter-ai/pyproject.toml Outdated Show resolved Hide resolved
Copy link
Collaborator

@dlqqq dlqqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think from our discussion ~1 month ago, we don’t want to load our native chat handlers (i.e. the ones we define) via entry points. This is because they may be overridden by another package accidentally/maliciously defining another chat handler of the same ID.
That would mean that we can statically declare our native chat handlers like the old approach, which also conveniently avoids the learn/ask interdependency you encountered:

        jai_chat_handlers = {
            "default": default_chat_handler,
            "/ask": ask_chat_handler,
            "/clear": clear_chat_handler,
            "/generate": generate_chat_handler,
            "/learn": learn_chat_handler,
            "/help": help_chat_handler,
        }

We will still use entry points, but only to extend this dictionary, not to initialize it. Let me know what you think of this, I may be forgetting something important.

@JasonWeill JasonWeill force-pushed the base-chat-handler-refactor branch 2 times, most recently from 3b397ba to b221758 Compare October 24, 2023 22:49
@JasonWeill
Copy link
Collaborator Author

This is still a WIP; I'm getting an error when passing a message to my custom handler /custom, defined in the pyproject.toml as:

[project.entry-points."jupyter_ai.chat_handlers"]
custom = "jupyter_ai:chat_handlers.CustomChatHandler"

Note the dot (not colon) before CustomChatHandler, per @dlqqq.

The error is:

future: <Task finished name='Task-7950' coro=<RootChatHandler._route() done, defined at /Users/jweill/git/jupyter-ai/packages/jupyter-ai/jupyter_ai/handlers.py:211> exception=TypeError("BaseChatHandler.process_message() missing 1 required positional argument: 'message'")>
Traceback (most recent call last):
  File "/Users/jweill/git/jupyter-ai/packages/jupyter-ai/jupyter_ai/handlers.py", line 225, in _route
    await self.chat_handlers[command].process_message(message)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: BaseChatHandler.process_message() missing 1 required positional argument: 'message'

@JasonWeill JasonWeill marked this pull request as ready for review October 25, 2023 22:48
@JasonWeill
Copy link
Collaborator Author

JasonWeill commented Oct 25, 2023

Updated per @dlqqq 's feedback. Tested all of the commands, including the /custom command, and they work locally.

@JasonWeill JasonWeill changed the title WIP: Base chat handler refactor Base chat handler refactor for custom slash commands Oct 26, 2023
packages/jupyter-ai/jupyter_ai/chat_handlers/custom.py Outdated Show resolved Hide resolved
packages/jupyter-ai/jupyter_ai/chat_handlers/base.py Outdated Show resolved Hide resolved
packages/jupyter-ai/jupyter_ai/extension.py Outdated Show resolved Hide resolved
@Zsailer
Copy link
Member

Zsailer commented Dec 5, 2023

Also, I think from our discussion ~1 month ago, we don’t want to load our native chat handlers (i.e. the ones we define) via entry points. This is because they may be overridden by another package accidentally/maliciously defining another chat handler of the same ID. That would mean that we can statically declare our native chat handlers like the old approach, which also conveniently avoids the learn/ask interdependency you encountered:

        jai_chat_handlers = {
            "default": default_chat_handler,
            "/ask": ask_chat_handler,
            "/clear": clear_chat_handler,
            "/generate": generate_chat_handler,
            "/learn": learn_chat_handler,
            "/help": help_chat_handler,
        }

We will still use entry points, but only to extend this dictionary, not to initialize it. Let me know what you think of this, I may be forgetting something important.

On the other hand, what if a consumer of this plugin does want to override the /ask, /clear, /generate, etc. handlers defined natively here? Is this something that should be blocked?

@Zsailer
Copy link
Member

Zsailer commented Dec 5, 2023

This is sweet @JasonWeill! I love this refactor. Defining custom commands is a major win for this plugin.

I can't tell when briefly scanning the frontend plugin... do the custom commands appear in the UI of the side panel at the top of the chat?

@JasonWeill
Copy link
Collaborator Author

This is sweet @JasonWeill! I love this refactor. Defining custom commands is a major win for this plugin.

I can't tell when briefly scanning the frontend plugin... do the custom commands appear in the UI of the side panel at the top of the chat?

@Zsailer Not yet; making the help message dynamic is covered by #436 (and making it customizable is covered separately by #279).

@JasonWeill
Copy link
Collaborator Author

On the other hand, what if a consumer of this plugin does want to override the /ask, /clear, /generate, etc. handlers defined natively here? Is this something that should be blocked?

@Zsailer Our first goal here is to allow for additional slash commands. Overriding the existing ones is currently out of scope, but we can have another issue if that's something that a user/developer wants to do.

@3coins
Copy link
Collaborator

3coins commented Dec 6, 2023

@Zsailer

On the other hand, what if a consumer of this plugin does want to override the /ask, /clear, /generate, etc. handlers defined > natively here? Is this something that should be blocked?

This is a good point, and agree that there are valid use cases where this can provide value. The main hesitation for adding this was any use of these to override builtin commands to do bad or unexpected things, which would hurt trust in Jupyter AI. We are open to revisiting this, and would love to hear your thoughts on this.

@Zsailer
Copy link
Member

Zsailer commented Dec 6, 2023

override builtin commands to do bad or unexpected things, which would hurt trust in Jupyter AI.

Sure, but it is Python and a bad actor can simply replace jai_chat_handlers setting from their own package/extension... which is exactly what I would to do to replace these values as a "good actor" 😉. Unfortunately, you can't get around this hackery.

For my immediate use-case, I want to disable some of the default chat handlers (not necessarily replace them) because they don't work well on my system. This already requires me to override the jai_chat_handlers setting. In a not-too-distance future, I could see replacing handlers with my own version that works for my system.

For the "good actors" who want to replace the default handlers—if you allows them to override using the entry-point system, you can detect this and log a warning to the user that the default command is being replaced.

@JasonWeill
Copy link
Collaborator Author

@Zsailer I opened #507 to add a facility to override, or perhaps to remove, built-in commands. I think #436 should be a prerequisite for the latter; currently, the help message is static, so we would need to generate it dynamically instead. Thanks again for your response!

@JasonWeill JasonWeill dismissed 3coins’s stale review December 7, 2023 17:59

Changes made as requested

@JasonWeill JasonWeill merged commit 64e6daf into jupyterlab:main Dec 7, 2023
6 checks passed
@dlqqq
Copy link
Collaborator

dlqqq commented Dec 8, 2023

@meeseeksdev please backport to 1.x

Copy link

lumberbot-app bot commented Dec 8, 2023

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 1.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 64e6daf42b34f6906749de4ec3bafeca42b77210
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #398: Base chat handler refactor for custom slash commands'
  1. Push to a named branch:
git push YOURFORK 1.x:auto-backport-of-pr-398-on-1.x
  1. Create a PR against branch 1.x, I would have named this PR:

"Backport PR #398 on branch 1.x (Base chat handler refactor for custom slash commands)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

JasonWeill added a commit to JasonWeill/jupyter-ai that referenced this pull request Dec 8, 2023
* Adds attributes, starts adding to subclasses

* Consistent syntax

* Help for all handlers

* Fix slash ID error

* Iterate through entry points

* Fix typo in call to select()

* Moves config to magics, modifies extensions to attempt to load classes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moves config to proper location, improves error logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* WIP: Updates per feedback, adds custom handler

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes redundant code, style fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes unnecessary custom message

* Instantiates class

* Validates slash ID

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Consistent arguments to chat handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactors to avoid intentionally unused params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates docs, removes custom handler from source and config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Renames process_message to match base class

* Adds needed parameter that had been deleted

* Joins lines in contributor doc

* Removes natural language routing type, which is not yet used

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Revises per @3coins, avoids Latinism

* Removes Configurable, since we do not yet have configurable traits

* Uses Literal for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>
(cherry picked from commit 64e6daf)
dlqqq pushed a commit to dlqqq/jupyter-ai that referenced this pull request Dec 8, 2023
* Adds attributes, starts adding to subclasses

* Consistent syntax

* Help for all handlers

* Fix slash ID error

* Iterate through entry points

* Fix typo in call to select()

* Moves config to magics, modifies extensions to attempt to load classes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moves config to proper location, improves error logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* WIP: Updates per feedback, adds custom handler

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes redundant code, style fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes unnecessary custom message

* Instantiates class

* Validates slash ID

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Consistent arguments to chat handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactors to avoid intentionally unused params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates docs, removes custom handler from source and config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Renames process_message to match base class

* Adds needed parameter that had been deleted

* Joins lines in contributor doc

* Removes natural language routing type, which is not yet used

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Revises per @3coins, avoids Latinism

* Removes Configurable, since we do not yet have configurable traits

* Uses Literal for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>
dlqqq added a commit that referenced this pull request Dec 8, 2023
* Update Users section of the docs (#494)

* Update example of setting model provider and API key

* resize screenshots

* update chat settings screenshots

* Promote “Custom model providers” and “Customizing prompt templates” to subsections, move them to the bottom of the users doc page

* Update docs/source/users/index.md

Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>

* Update docs/source/users/index.md

Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>

* change double-backtick to single-backticks as they serve the same function

* move  Prompt templates sections to Developers page

* Update snapshots to use the same zoom level

* Update docs/source/developers/index.md

Co-authored-by: Jason Weill <93281816+JasonWeill@users.noreply.github.com>

* move "Custom model providers" section to Dev page

* Update lang model choice screen to show OpenAI models mentioned in text around the screenshot

---------

Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
Co-authored-by: Jason Weill <93281816+JasonWeill@users.noreply.github.com>

* remove config.json-related information (#503)

* Base chat handler refactor for custom slash commands (#398)

* Adds attributes, starts adding to subclasses

* Consistent syntax

* Help for all handlers

* Fix slash ID error

* Iterate through entry points

* Fix typo in call to select()

* Moves config to magics, modifies extensions to attempt to load classes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moves config to proper location, improves error logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* WIP: Updates per feedback, adds custom handler

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes redundant code, style fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes unnecessary custom message

* Instantiates class

* Validates slash ID

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Consistent arguments to chat handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactors to avoid intentionally unused params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates docs, removes custom handler from source and config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Renames process_message to match base class

* Adds needed parameter that had been deleted

* Joins lines in contributor doc

* Removes natural language routing type, which is not yet used

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Revises per @3coins, avoids Latinism

* Removes Configurable, since we do not yet have configurable traits

* Uses Literal for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>

---------

Co-authored-by: Andrii Ieroshenko <aieroshe@amazon.com>
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
Co-authored-by: Jason Weill <93281816+JasonWeill@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>
@dlqqq dlqqq mentioned this pull request Dec 26, 2023
JasonWeill added a commit to JasonWeill/jupyter-ai that referenced this pull request Jan 5, 2024
* Adds attributes, starts adding to subclasses

* Consistent syntax

* Help for all handlers

* Fix slash ID error

* Iterate through entry points

* Fix typo in call to select()

* Moves config to magics, modifies extensions to attempt to load classes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moves config to proper location, improves error logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* WIP: Updates per feedback, adds custom handler

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes redundant code, style fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes unnecessary custom message

* Instantiates class

* Validates slash ID

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Consistent arguments to chat handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactors to avoid intentionally unused params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates docs, removes custom handler from source and config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Renames process_message to match base class

* Adds needed parameter that had been deleted

* Joins lines in contributor doc

* Removes natural language routing type, which is not yet used

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Revises per @3coins, avoids Latinism

* Removes Configurable, since we do not yet have configurable traits

* Uses Literal for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>
(cherry picked from commit 64e6daf)
JasonWeill added a commit that referenced this pull request Jan 5, 2024
… openai history in magics)" (#567)

* Base chat handler refactor for custom slash commands (#398)

* Adds attributes, starts adding to subclasses

* Consistent syntax

* Help for all handlers

* Fix slash ID error

* Iterate through entry points

* Fix typo in call to select()

* Moves config to magics, modifies extensions to attempt to load classes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moves config to proper location, improves error logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* WIP: Updates per feedback, adds custom handler

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes redundant code, style fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes unnecessary custom message

* Instantiates class

* Validates slash ID

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Consistent arguments to chat handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactors to avoid intentionally unused params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates docs, removes custom handler from source and config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Renames process_message to match base class

* Adds needed parameter that had been deleted

* Joins lines in contributor doc

* Removes natural language routing type, which is not yet used

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Revises per @3coins, avoids Latinism

* Removes Configurable, since we do not yet have configurable traits

* Uses Literal for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>
(cherry picked from commit 64e6daf)

* Backport PR #551: Upgrades openai to version 1, removes openai history in magics
JasonWeill added a commit to JasonWeill/jupyter-ai that referenced this pull request Jan 23, 2024
* Adds attributes, starts adding to subclasses

* Consistent syntax

* Help for all handlers

* Fix slash ID error

* Iterate through entry points

* Fix typo in call to select()

* Moves config to magics, modifies extensions to attempt to load classes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moves config to proper location, improves error logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* WIP: Updates per feedback, adds custom handler

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes redundant code, style fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes unnecessary custom message

* Instantiates class

* Validates slash ID

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Consistent arguments to chat handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactors to avoid intentionally unused params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates docs, removes custom handler from source and config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Renames process_message to match base class

* Adds needed parameter that had been deleted

* Joins lines in contributor doc

* Removes natural language routing type, which is not yet used

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Revises per @3coins, avoids Latinism

* Removes Configurable, since we do not yet have configurable traits

* Uses Literal for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>
(cherry picked from commit 64e6daf)
JasonWeill added a commit that referenced this pull request Jan 23, 2024
…ed models for openai) (#598)

* Base chat handler refactor for custom slash commands (#398)

* Adds attributes, starts adding to subclasses

* Consistent syntax

* Help for all handlers

* Fix slash ID error

* Iterate through entry points

* Fix typo in call to select()

* Moves config to magics, modifies extensions to attempt to load classes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moves config to proper location, improves error logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* WIP: Updates per feedback, adds custom handler

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes redundant code, style fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes unnecessary custom message

* Instantiates class

* Validates slash ID

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Consistent arguments to chat handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactors to avoid intentionally unused params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates docs, removes custom handler from source and config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Renames process_message to match base class

* Adds needed parameter that had been deleted

* Joins lines in contributor doc

* Removes natural language routing type, which is not yet used

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Revises per @3coins, avoids Latinism

* Removes Configurable, since we do not yet have configurable traits

* Uses Literal for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>
(cherry picked from commit 64e6daf)

* Removes redundant pydantic import

* Removes deprecated models, adds updated models for openai (#596)

* Removes deprecated models, adds updated models for openai

* ASCIIbetical sort

(cherry picked from commit 71227d9)
JasonWeill added a commit to JasonWeill/jupyter-ai that referenced this pull request Jan 31, 2024
* Adds attributes, starts adding to subclasses

* Consistent syntax

* Help for all handlers

* Fix slash ID error

* Iterate through entry points

* Fix typo in call to select()

* Moves config to magics, modifies extensions to attempt to load classes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moves config to proper location, improves error logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* WIP: Updates per feedback, adds custom handler

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes redundant code, style fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes unnecessary custom message

* Instantiates class

* Validates slash ID

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Consistent arguments to chat handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactors to avoid intentionally unused params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates docs, removes custom handler from source and config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Renames process_message to match base class

* Adds needed parameter that had been deleted

* Joins lines in contributor doc

* Removes natural language routing type, which is not yet used

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Revises per @3coins, avoids Latinism

* Removes Configurable, since we do not yet have configurable traits

* Uses Literal for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>
(cherry picked from commit 64e6daf)
JasonWeill added a commit that referenced this pull request Jan 31, 2024
* Base chat handler refactor for custom slash commands (#398)

* Adds attributes, starts adding to subclasses

* Consistent syntax

* Help for all handlers

* Fix slash ID error

* Iterate through entry points

* Fix typo in call to select()

* Moves config to magics, modifies extensions to attempt to load classes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moves config to proper location, improves error logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* WIP: Updates per feedback, adds custom handler

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes redundant code, style fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes unnecessary custom message

* Instantiates class

* Validates slash ID

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Consistent arguments to chat handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactors to avoid intentionally unused params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates docs, removes custom handler from source and config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Renames process_message to match base class

* Adds needed parameter that had been deleted

* Joins lines in contributor doc

* Removes natural language routing type, which is not yet used

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Revises per @3coins, avoids Latinism

* Removes Configurable, since we do not yet have configurable traits

* Uses Literal for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>
(cherry picked from commit 64e6daf)

* Removes redundant pydantic import

* fix to conda install instructions in readme (#610)

(cherry picked from commit fb77735)

---------

Co-authored-by: Tom Lynch <33132734+Tom-A-Lynch@users.noreply.github.com>
JasonWeill added a commit to JasonWeill/jupyter-ai that referenced this pull request Feb 8, 2024
* Adds attributes, starts adding to subclasses

* Consistent syntax

* Help for all handlers

* Fix slash ID error

* Iterate through entry points

* Fix typo in call to select()

* Moves config to magics, modifies extensions to attempt to load classes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moves config to proper location, improves error logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* WIP: Updates per feedback, adds custom handler

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes redundant code, style fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes unnecessary custom message

* Instantiates class

* Validates slash ID

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Consistent arguments to chat handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactors to avoid intentionally unused params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates docs, removes custom handler from source and config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Renames process_message to match base class

* Adds needed parameter that had been deleted

* Joins lines in contributor doc

* Removes natural language routing type, which is not yet used

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Revises per @3coins, avoids Latinism

* Removes Configurable, since we do not yet have configurable traits

* Uses Literal for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>
(cherry picked from commit 64e6daf)
JasonWeill added a commit that referenced this pull request Feb 8, 2024
… while incorporating model params) (#634)

* Base chat handler refactor for custom slash commands (#398)

* Adds attributes, starts adding to subclasses

* Consistent syntax

* Help for all handlers

* Fix slash ID error

* Iterate through entry points

* Fix typo in call to select()

* Moves config to magics, modifies extensions to attempt to load classes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moves config to proper location, improves error logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* WIP: Updates per feedback, adds custom handler

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes redundant code, style fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes unnecessary custom message

* Instantiates class

* Validates slash ID

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Consistent arguments to chat handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactors to avoid intentionally unused params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates docs, removes custom handler from source and config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Renames process_message to match base class

* Adds needed parameter that had been deleted

* Joins lines in contributor doc

* Removes natural language routing type, which is not yet used

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Revises per @3coins, avoids Latinism

* Removes Configurable, since we do not yet have configurable traits

* Uses Literal for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>
(cherry picked from commit 64e6daf)

* Removes redundant pydantic import

* Unifies parameters to instantiate llm while incorporating model params (#632)

* Unifies parameters to instantiate llm while incorporating model params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit 17326b5)
dbelgrod pushed a commit to dbelgrod/jupyter-ai that referenced this pull request Jun 10, 2024
* Adds attributes, starts adding to subclasses

* Consistent syntax

* Help for all handlers

* Fix slash ID error

* Iterate through entry points

* Fix typo in call to select()

* Moves config to magics, modifies extensions to attempt to load classes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moves config to proper location, improves error logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* WIP: Updates per feedback, adds custom handler

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes redundant code, style fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removes unnecessary custom message

* Instantiates class

* Validates slash ID

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Consistent arguments to chat handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactors to avoid intentionally unused params

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates docs, removes custom handler from source and config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Renames process_message to match base class

* Adds needed parameter that had been deleted

* Joins lines in contributor doc

* Removes natural language routing type, which is not yet used

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Update docs/source/developers/index.md

Co-authored-by: Piyush Jain <piyushjain@duck.com>

* Revises per @3coins, avoids Latinism

* Removes Configurable, since we do not yet have configurable traits

* Uses Literal for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piyush Jain <piyushjain@duck.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request @jupyter-ai/chatui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants