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

Getting the code to execute #3

Open
svilupp opened this issue Mar 10, 2023 · 2 comments
Open

Getting the code to execute #3

svilupp opened this issue Mar 10, 2023 · 2 comments

Comments

@svilupp
Copy link

svilupp commented Mar 10, 2023

This is an awesome idea! Thank you.

How would you grab the last answer and execute it (ideally just the code)?
I had a look at the chat history, but that's already marked up for displaying.

@anandijain
Copy link
Owner

codeblocks(OpenAIReplMode.OPENAI_CHAT_HIST[end])

that gives you the strings of code. you could then eval(Meta.parse(...)) them

@anandijain
Copy link
Owner

anandijain commented Mar 10, 2023

you might need to change the prefix kwarg of codeblocks or add to your prompt that chatgpt should annotate all Julia code with julia ... end triple backticks

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

No branches or pull requests

2 participants