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

Assistant Plus #1091

Draft
wants to merge 24 commits into
base: dev
Choose a base branch
from
Draft

Assistant Plus #1091

wants to merge 24 commits into from

Conversation

disconcision
Copy link
Member

@disconcision disconcision commented Aug 25, 2023

LLM completions Instructions:

  • Code Completions are activated by typing "??".
  • You'll need to add a gpt4 API key. To do this, enter (StoreKey "OpenAI" "<your-openai-key") OR (StoreKey "AZURE4" "<your-azure-key") in any editor, select it, then press Cmd/Ctrl-E, which will parse and execute the selection as an UpdateAction. Azure keys can be added similarly; see code.

Partially complete features

  • Internal: to_string for terms and types
  • List library: In-Hazel implementation of ~30 OCaml list functions
  • Budget Command Palette: (write an internal command as an s-expression, select it, and press Ctrl-E. check console for errors)
  • GPT4-driven code completions
  • MVU framework
  • AUTO: A scripting harness for testing

Planning:

  • ChatGPT based repair
  • Chat UI for refactors
  • Action Calculus generation

Rough Notes on syntax issues

from Form.re:
TODO(andrew): weird examples
insert '=' in 'let a><|!true' (get bad op '=!')
insert '-' in 1+|1 (get bad op '+-')
should we allow '=>' or '->' or '|' inside operators? currently implictly yes

from Molds.re
Maybe more advanced token allow logic:
Goal: Try to preserve the prefix-validity of tokens as much as possible
when inserting/deleting characters, but allow the creation of prefix-
invalid tokens as a fallthrough. Always be willing to split on insert
to maintain prefix-validity, but allow the creation of prefix-invalid
tokens for deletes which would otherwise be no-ops.
Or: if insert/delete results in a thing which is no longer a prefix
of a valid token, then we split it into the largest prefix of
a valid token and up to two more tokens; if there are two, one is
a single character (doesn't quite work for delete; we can't guarantee
the existence of such a split eg if lang consists of single "yo", deleting
the "y" leaves no possible prefixes)
for this to be nice if we could establish that the split
must always occur at the caret; otherwise it might be confusing.
precondition: caret is either inside a token, or between two tokens
any tokens are prefix-valid
insert between case: attempt to append to left, then the right, otherwise new
(so everything always prefix-valid)
insert inside case: attempt to insert. otherwise go to between case
(so everything always prefix-valid)
delete from right: can't effect prefix-validity
delete from left/inside: ??? allow create prefix-invalid ???
delete-merge (when delete an intervening seg, pushing two tokens together):
if the result is a valid token, great; otherwise ??? allow create prefix-invalid ???

from Select: (smart select)
Maybe a better logic for this: Next
reasonable enclosure. Define 'enclosures' of a token to
be terms and tiles that include that token. Then for a
given token, itsenclosures are totally ordered by inclusion.
Doubleclicking gives the minimum enclosure, triple-clicking
gives the second-most minimum enclosure, which will be
(check) either the current term, the parent tile, or the
parent term. But would need to be careful to force that
the original tile is included; e.g. in an Ap the parent
tile doesn't include the funpos.

@disconcision disconcision changed the title Assistant Plus Assistant Future Aug 25, 2023
@disconcision disconcision added assistant Part of the Hazel Assistant project in-development for PRs that remain in development labels Aug 26, 2023
@disconcision disconcision changed the title Assistant Future Assistant Plus Aug 29, 2023
Base automatically changed from llmass to dev December 5, 2023 01:42
@cyrus- cyrus- added the needs-merge for PRs that need a merge from dev label Dec 20, 2023
@cyrus- cyrus- mentioned this pull request Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assistant Part of the Hazel Assistant project in-development for PRs that remain in development needs-merge for PRs that need a merge from dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants