branch: externals/minuet commit aa6857667bc216c75c514038f09df6f946cc880a Author: Milan Glacier <d...@milanglacier.com> Commit: Milan Glacier <d...@milanglacier.com>
doc: update few shot example. --- prompt.md | 90 ++++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 27 deletions(-) diff --git a/prompt.md b/prompt.md index 4db715ceed..1917f5c127 100644 --- a/prompt.md +++ b/prompt.md @@ -72,26 +72,32 @@ The counterpart variables are: **Prefix First Style**: -You are an AI code completion engine. Provide contextually appropriate completions: +You are an AI code completion engine. Provide contextually appropriate +completions: + - Code completions in code context - Comment/documentation text in comments - String content in string literals - Prose in markdown/documentation files Input markers: + - `<contextAfterCursor>`: Context after cursor - `<cursorPosition>`: Current cursor location - `<contextBeforeCursor>`: Context before cursor **Suffix First Style**: -You are an AI code completion engine. Provide contextually appropriate completions: +You are an AI code completion engine. Provide contextually appropriate +completions: + - Code completions in code context - Comment/documentation text in comments - String content in string literals - Prose in markdown/documentation files Input markers: + - `<contextAfterCursor>`: Context after cursor - `<cursorPosition>`: Current cursor location - `<contextBeforeCursor>`: Context before cursor @@ -127,40 +133,63 @@ Guidelines: ;; suffix-first style (defvar minuet-default-fewshots `((:role "user" - :content "# language: python + :content "# language: javascript <contextAfterCursor> + return result; +} -fib(5) +const processedData = transformData(rawData, { + uppercase: true, + removeSpaces: false +}); <contextBeforeCursor> -def fibonacci(n): - <cursorPosition>") +function transformData(data, options) { + const result = []; + for (let item of data) { + <cursorPosition>") (:role "assistant" - :content " ''' - Recursive Fibonacci implementation - ''' - if n < 2: - return n - return fib(n - 1) + fib(n - 2) + :content "let processed = item; + if (options.uppercase) { + processed = processed.toUpperCase(); + } + if (options.removeSpaces) { + processed = processed.replace(/\s+/g, ''); + } + result.push(processed); + } <endCompletion> - ''' - Iterative Fibonacci implementation - ''' - a, b = 0, 1 - for _ in range(n): - a, b = b, a + b - return a +if (typeof item === 'string') { + let processed = item; + if (options.uppercase) { + processed = processed.toUpperCase(); + } + if (options.removeSpaces) { + processed = processed.replace(/\s+/g, ''); + } + result.push(processed); + } else { + result.push(item); + } + } <endCompletion> "))) (defvar minuet-default-fewshots-prefix-first `((:role "user" - :content "# language: python + :content "# language: javascript <contextBeforeCursor> -def fibonacci(n): - <cursorPosition> +function transformData(data, options) { + const result = []; + for (let item of data) { + <cursorPosition> <contextAfterCursor> + return result; +} -fib(5)") +const processedData = transformData(rawData, { + uppercase: true, + removeSpaces: false +});") ,(cadr minuet-default-fewshots))) ``` @@ -312,13 +341,20 @@ enclosed in markers: (defvar mg-minuet-gemini-fewshots `((:role "user" - :content "# language: python + :content "# language: javascript <contextBeforeCursor> -def fibonacci(n): - <cursorPosition> +function transformData(data, options) { + const result = []; + for (let item of data) { + <cursorPosition> <contextAfterCursor> + return result; +} -fib(5)") +const processedData = transformData(rawData, { + uppercase: true, + removeSpaces: false +});") ,(cadr minuet-default-fewshots))) (minuet-set-optional-options minuet-gemini-options