Skip to content

Commit

Permalink
Add llm prompt to generated code (#4981)
Browse files Browse the repository at this point in the history
  • Loading branch information
asylves1 committed Sep 30, 2024
1 parent bf99671 commit 486d751
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ const hideAutoComplete = ref(false);
const contextLanguageOptions = ref<string[]>(['python3', 'julia-1.10']);
const addQuestionToCode = (question, code) => `\n# Prompt: ${question}\n\n${code}\n# End: =================`;
const submitQuestion = () => {
const message = props.kernelManager.sendMessage('llm_request', {
request: questionString.value
Expand All @@ -103,6 +105,7 @@ const submitQuestion = () => {
kernelStatus.value = data.content.execution_state;
});
message.register('code_cell', (data) => {
data.content.code = addQuestionToCode(questionString.value, data.content.code);
emit('llm-output', data);
});
message.register('llm_thought', (data) => {
Expand Down

0 comments on commit 486d751

Please sign in to comment.