-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
Adds %ai list, %ai help magic commands #100
Conversation
We have enough, maybe two columns or a table to better utilize the width? |
@ellisonbg Markdown doesn't really allow multi-column layouts; how about this layout to include all models in the right column of a 2-column table? (The text output is unchanged.) |
Updates the Markdown view with a new column, emoji for environment variables being set/not set, and tooltips to describe what these mean. |
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.
Two high-level suggestions in addition to the ones below:
-
I believe we can leverage an open source solution to generate a plaintext-formatted MD table declaratively rather than constructing it imperatively (row-by-row, column-by-column) like the current implementation. For example,
py-markdown-table
offers this functionality. Perhaps this can even be used in the IPython view and let you remove theTextAndMarkdown
object you're using throughout? 👀 This will also allow you to greatly reduce the number of private methods you're adding onto theAiMagics
class 😁 -
Rather than calling utility functions manually, could you perhaps create a new display object by subclassing
IPython.display.DisplayObject
, that accepts a 2D array and returns the table as a string? Perhaps this point (2) is a stretch goal; feel free to track this in a separate issue to address later.
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.
* Initial help command support * Adds help command * Matches error message * Styles model ID in error * Introduces TextWithMarkdown class * Removes incorrect comment * Alphabetizes classes * List of models * Adds model list * Documents %ai list * Optional parameter * Updates example notebook * Documents parameter * In Markdown, displays a table of models * Adds column for env vars * Uses emoji in its own column * Renames class to TextOrMarkdown * Removes dictionary of env vars
* Initial help command support * Adds help command * Matches error message * Styles model ID in error * Introduces TextWithMarkdown class * Removes incorrect comment * Alphabetizes classes * List of models * Adds model list * Documents %ai list * Optional parameter * Updates example notebook * Documents parameter * In Markdown, displays a table of models * Adds column for env vars * Uses emoji in its own column * Renames class to TextOrMarkdown * Removes dictionary of env vars
Fixes #28.
Defines
%ai help
and%ai list
magic commands. The latter displays all model providers and, if possible, individual models in a format suitable for copying into a code cell.%ai list
takes an optional parameter of a model provider ID.This feature works in both IPython terminals:
… and in JupyterLab:
Adds a sample notebook and updates the user docs with information about
%ai list
.