rgbkrk / genai

What if GPT could help you notebook?
BSD 3-Clause "New" or "Revised" License
351 stars 36 forks source link

create a more ipythonic context manager #62

Closed rgbkrk closed 1 year ago

rgbkrk commented 1 year ago
  1. Introduced a Context class to capture IPython history as ChatCompletion compatible messages while retaining execution count
  2. Replaced the get_historical_context function with the build_context function, which constructs the context using the new Context class.
  3. Updated %%assist to use build_context and trim down the messages based on estimated token size