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

allow conversations to continue with %%assist #66

Merged
merged 9 commits into from
Mar 22, 2023

Conversation

rgbkrk
Copy link
Owner

@rgbkrk rgbkrk commented Mar 19, 2023

This captures past assistance as well as errors so that ChatGPT has access to the full context of:

  • code (user)
  • errors (system)
  • suggestions (assistant)
  • outputs (system)

This PR closes #63 since now the %%assist magic uses Markdown output instead of set_next_input. It also closes #56 since the progress display is no more.

Bonus: hot swapping the models

image

  • Update tests
  • Think a little more on how best to capture past assistant messages (does it belong in GenaiMarkdown?) Created a separate PastAssistant singleton

This relies on previous `GenaiMarkdown` displays to form the basis of
past assistant communication.
@rgbkrk
Copy link
Owner Author

rgbkrk commented Mar 21, 2023

Interesting little prompt response I just got:

%%assist

What is your level of understanding of the messages between what comes from me (`role: user`) versus the runtime (`role: system`)?

As a coding assistant, I am programmed to understand the messages that start with %%assist as user input. All other messages are interpreted as output from the system.

genai/display.py Outdated
self._message: str = message
self._display_id: str = hexlify(os.urandom(8)).decode('ascii')
self._stage: Optional[Stage] = stage

if execution_count:
self.assists[execution_count] = self
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of including this in GenaiMarkdown as a side effect, there should be a separate execution_count -> assist singleton for lookup.

@rgbkrk
Copy link
Owner Author

rgbkrk commented Mar 22, 2023

This is so rad for educational usage.

image

@rgbkrk rgbkrk marked this pull request as ready for review March 22, 2023 02:54
@rgbkrk rgbkrk merged commit 8a72cfe into main Mar 22, 2023
@rgbkrk rgbkrk deleted the rgbkrk/experimental-magics branch March 22, 2023 03:48
@rgbkrk rgbkrk mentioned this pull request Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[?][Design] Should %%assist return Markdown output? [Updates] Switch to progress bar for %%assist
1 participant