diff --git a/layouts/partials/gordon-chat.html b/layouts/partials/gordon-chat.html index 4117c2bdad..f44dd86e2f 100644 --- a/layouts/partials/gordon-chat.html +++ b/layouts/partials/gordon-chat.html @@ -8,13 +8,15 @@ 'https://ai-backend-service-stage.docker.com' {{- end }}; -
m.role === 'user').length + }, + + getRemainingTurns() { + return this.maxTurnsPerThread - this.getTurnCount() + }, + + isThreadLimitReached() { + return this.getTurnCount() >= this.maxTurnsPerThread + }, + + shouldShowCountdown() { + const remaining = this.getRemainingTurns() + return remaining > 0 && remaining <= 3 + }, + async askQuestion() { const question = this.currentQuestion.trim() - if (!question || this.isLoading) { + if (!question || this.isLoading || this.isThreadLimitReached()) { return } @@ -287,281 +306,393 @@ console.error('Failed to copy:', err) } } - }" x-cloak @keydown.escape.window="$store.gordon.close()"> - -
+ }" + x-cloak + @keydown.escape.window="$store.gordon.close()" +> + +
- -
- -
-
- {{ partial "utils/svg.html" "images/ask-ai-logo.svg" }} -
-
- - -
-
+ +
+ +
+
+ {{ partial "utils/svg.html" "images/ask-ai-logo.svg" }} +
+
+ + +
+
- -
- - + +
+ + - - +
+
+ - - -
+ + - -
-
-
-
- -
- -
-
-
-
+ + +
+ +
+
+ +
+ +
+
+
+ - - -
-
- -
+ class="cursor-pointer rounded-md px-2 py-1 text-xs font-medium transition-colors hover:opacity-80" + > + + + + Context + + + + +
+
+ +
- -
- This is a custom LLM for answering questions about Docker. Answers are - based on the documentation. -
-
+ +
+ This is a custom LLM for answering questions about Docker. Answers are + based on the documentation. +
+