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

Upgrades openai to version 1, removes openai history in magics #551

Merged
merged 12 commits into from
Jan 5, 2024

Conversation

JasonWeill
Copy link
Collaborator

@JasonWeill JasonWeill commented Dec 28, 2023

Upgrades openai package to version 1. Fixes #543.

Merges "new" OpenAI provider for magic commands in with the previous "chat" provider.

Removes the history associated uniquely with the openai-chat provider in magic commands. Removes the "reset" command to delete said history. Updates the docs to remove mention of the history and the reset command.

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.

Thanks for working on this! I left some minor comments for you to address. I think it's perfectly reasonable to drop the transcript/history support for the old OpenAI provider, given that it's no longer maintained, and that it was specific to that provider (violating our design principles). If we want to implement history support in magics again, we should do so in some way irrespective of the model or provider being used.

Let's also make sure to comb through the user documentation and remove any references of our old OpenAI provider supporting history, if any.

packages/jupyter-ai/pyproject.toml Outdated Show resolved Hide resolved
@JasonWeill JasonWeill changed the title WIP: Upgrades openai to version 1 Upgrades openai to version 1, removes openai history in magics Jan 4, 2024
@JasonWeill JasonWeill marked this pull request as ready for review January 4, 2024 22:51
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.

One more small thing I noticed, but then this should be good to go!

packages/jupyter-ai-magics/jupyter_ai_magics/providers.py 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.

TYSM! 🎉

@JasonWeill JasonWeill enabled auto-merge (squash) January 5, 2024 00:59
@JasonWeill JasonWeill merged commit a1c9da8 into jupyterlab:main Jan 5, 2024
8 checks passed
@JasonWeill
Copy link
Collaborator Author

@meeseeksdev please backport to 1.x

Copy link

lumberbot-app bot commented Jan 5, 2024

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 a1c9da8ad37daada3033228a109118df4c6a07cf
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #551: Upgrades openai to version 1, removes openai history in magics'
  1. Push to a named branch:
git push YOURFORK 1.x:auto-backport-of-pr-551-on-1.x
  1. Create a PR against branch 1.x, I would have named this PR:

"Backport PR #551 on branch 1.x (Upgrades openai to version 1, removes openai history in magics)"

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 Jan 5, 2024
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
@simonff
Copy link

simonff commented Jan 5, 2024

Thank you, Jason! What is the release schedule for jupyter-ai? When would the new code be available in 'pip install'?

@JasonWeill
Copy link
Collaborator Author

@simonff Version 2.9.0 is now available in PyPI, so you should be able to upgrade using pip. There is an issue adding this version to conda-forge, so it's not currently available to install via conda.

dbelgrod pushed a commit to dbelgrod/jupyter-ai that referenced this pull request Jun 10, 2024
…erlab#551)

* Upgrades openai versions

* Migration per openai migrate

* WIP: Upgrades openai, merges in "new" provider

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

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

* No longer suppress openai-chat

* Removes "new" openai-chat provider from commands.ipynb

* Suppress warning re custom exception handler

* Changes param name to prefix_messages

* Renames openai-chat-new model in tests

* Removes hard dependency from jupyter-ai on openai, updates magics TOML

* Removes "reset" option, copy edits in docs, updates sample file

* Removes append_exchange function

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

openai version in the pip distribution?
3 participants