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

AI Completions #5910

Merged
merged 18 commits into from
Jun 18, 2023
Merged

AI Completions #5910

merged 18 commits into from
Jun 18, 2023

Conversation

kustosz
Copy link
Contributor

@kustosz kustosz commented Mar 13, 2023

Pull Request Description

Added a special escape hatch in the searcher to run AI completions. Screencast was posted previously on discord. You'll need to export OPENAI_API_KEY to use the feature, otherwise it's a no-op. Currently only works with tables, more prompts need to be written. Also a few new issues opened to enable nicer prompts in the future.

Important Notes

The whole searcher-side of things is a mess and it's only a PoC, so don't spend too much time reviewing it, think about how to make it a feature instead :P

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

Copy link
Member

@wdanilo wdanilo left a comment

Choose a reason for hiding this comment

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

QA needed. After QA is done, lets merge it and lets make some hype about it in our promo videos :D

Comment on lines 291 to 303
// If there isn't any expression part, the pattern is the whole input.
// If there isn't any expression part, the pattern is the whole input.
Copy link
Member

Choose a reason for hiding this comment

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

I believe this is an accidental change :)

const AI_STOP_SEQUENCE: &'static str = "`";
const AI_GOAL_PLACEHOLDER: &'static str = "__$$GOAL$$__";

async fn accept_ai_query(
Copy link
Member

Choose a reason for hiding this comment

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

I know this is PoC, but docs are needed here for future refactoring/development. Please describe shortly what this function does and why.

Ok(())
}

fn handle_ai_query(&self, query: String) -> FallibleResult {
Copy link
Member

Choose a reason for hiding this comment

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

I know this is PoC, but docs are needed here for future refactoring/development. Please describe shortly what this function does and why.

Copy link
Collaborator

@hubertp hubertp left a comment

Choose a reason for hiding this comment

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

The engine part looks OK, but I'm guessing you might need to adapt it given recent changes

kustosz added 4 commits April 7, 2023 15:58
# Conflicts:
#	CHANGELOG.md
#	app/gui/src/controller/searcher.rs
#	engine/language-server/src/main/scala/org/enso/languageserver/boot/MainModule.scala
#	engine/language-server/src/main/scala/org/enso/languageserver/data/Config.scala
#	engine/language-server/src/test/scala/org/enso/languageserver/boot/resource/RepoInitializationSpec.scala
#	engine/language-server/src/test/scala/org/enso/languageserver/filemanager/ContentRootManagerSpec.scala
#	engine/language-server/src/test/scala/org/enso/languageserver/runtime/ContextEventsListenerSpec.scala
#	engine/language-server/src/test/scala/org/enso/languageserver/search/SuggestionsHandlerSpec.scala
#	engine/language-server/src/test/scala/org/enso/languageserver/websocket/binary/BaseBinaryServerTest.scala
#	engine/language-server/src/test/scala/org/enso/languageserver/websocket/json/BaseServerTest.scala
#	engine/language-server/src/test/scala/org/enso/languageserver/websocket/json/FileManagerTest.scala
#	engine/language-server/src/test/scala/org/enso/languageserver/websocket/json/VcsManagerTest.scala
@wdanilo
Copy link
Member

wdanilo commented Apr 10, 2023

@kustosz could you look at the @hubertp comment please and give us a green light when it will be fixed, please? :)

@xvcgreg
Copy link

xvcgreg commented May 15, 2023

@kustosz please take a look at this PR

@xvcgreg xvcgreg marked this pull request as draft June 13, 2023 11:47
@kustosz kustosz marked this pull request as ready for review June 14, 2023 16:45
@wdanilo
Copy link
Member

wdanilo commented Jun 14, 2023

Ok @xvcgreg @sylwiabr this is ready for QA according to Marcin :) To test it, you need OPENAI_API_KEY=<THE_KEY> ./run ide start. @vitvakatu do you think you'd be able to Q/A it ?

@vitvakatu
Copy link
Contributor

vitvakatu commented Jun 18, 2023

QA: passed 🍏 :

@wdanilo wdanilo merged commit 90e413c into develop Jun 18, 2023
@wdanilo wdanilo deleted the wip/mk/ai-stuff branch June 18, 2023 21:54
@wdanilo
Copy link
Member

wdanilo commented Jun 18, 2023

Perfect! It has landed <3

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.

5 participants