Repository navigation
v2.0.0
genai @ 2.0.0
Generative AI Tooling for IPythonic Platforms.
Install genai in your notebook environment now!
π¦Ύ Get GPT help with code, SQL queries, DataFrames, Exceptions, and more in IPython.
π Supports all Jupyter environments, including IPython, JupyterLab, Jupyter Notebook, and Noteable.
%pip install genai
%load_ext genai
Enhancements:
Added
- π Keep conversations flowing with
%%assist(#66) - πΌοΈ Emit suggestions as
Markdowninstead of creating new cells (#66) - π Model selection made easy with the
--modelflag for%%assist(#65) - π‘ Introducing
GenaiMarkdownβ a dynamic Markdown display (#61) - π Create a
%%promptmagic for setting the default prompts for assistance and exceptions (#71, #69)
Changed
-
π§ͺ Craft a more ipythonic context manager (#62, #66)
- Meet the new
Contextclass: capture IPython history and make it ChatCompletion-friendly - Farewell
get_historical_context, hellobuild_context: context construction using the new Context class - Reduce messages sent to GPT models by trimming based on estimated number of tokens (#57)
- Meet the new
-
π― Type annotations step in! (#59)
Improved
- π Token length checks now available in %%assist (#57)
- π§Ή Code refactoring: introducing
craft_message,repr_genai_pandas, andrepr_genaifor more organized and readable code - π Enhanced pandas support: optimized DataFrame and Series representation for Large Language Model consumption using Markdown format
- π° Token management: a new module
tokens.pyfeaturingnum_tokens_from_messagesandtrim_messages_to_fit_token_limitto help you stay within model limitations and budget - π Update assist magic documentation (#70)
Removed
- π«
%%assistno longer generates new code cells. It now creates Markdown output instead (#66)- Relatedly,
in-placeis no longer an option since we do not change the cells
- Relatedly,
Changes:
craft_user_messagenow relies on the newcraft_messagefunctioncraft_output_messagehas been upgraded to use the newrepr_genaifunctionget_historical_contextnow sports an additionalmodelparameter and utilizestokens.trim_messages_to_fit_token_limit- For clarity, the
ignore_tokenslist now uses the term "first line" instead of "start" - GPT-4 token counting and message trimming now supported in
tokens.py