Skip to content

Conversation

@srdas
Copy link
Collaborator

@srdas srdas commented Sep 2, 2025

In PR #1471 we added the option to pass the API url and key name in the code cell when using %%ai magics. After the model or alias, we pass either or both --api-base and --api-key-name as needed.

Here, we add the ability to include the api-base and/or api-key-name in the alias, which streamlines the use of the alias in magics. Users no longer have to pass the API url and key-name in each magics call. The following examples illustrate the usage:

Use an alias with no API options:
image

Use the alias with base API url options:
image

Use the alias with base API url and key-name options:
image

Updated the tests in test_magics.py for the new arguments and also re-tested all other magics features.

@srdas srdas added the enhancement New feature or request label Sep 2, 2025
@dlqqq dlqqq changed the title [magics] Enhances the alias option to include the base API url and key [magics] Add options to include the API url & key with alias Sep 3, 2025
Copy link
Member

@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.

This is awesome, thank you! Code changes look good.

@dlqqq dlqqq merged commit c4859ae into jupyterlab:main Sep 3, 2025
9 checks passed
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.

2 participants