refactor(ask-ai): change version format to 'My version: <product name>'
Use human-readable product names instead of URL paths for better UX. Example: 'My version: InfluxDB 3 Core' instead of '[version: /influxdb3/core/]'jts-askai-group-filters
parent
db06cd769c
commit
813f83fb49
|
|
@ -16,7 +16,7 @@ declare global {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
type KapaFunction = (command: string, options?: unknown) => void;
|
type KapaFunction = (command: string, options?: unknown) => void;
|
||||||
|
|
||||||
interface ChatAttributes extends Record<string, string | undefined> {
|
interface ChatAttributes extends Record<string, string | undefined> {
|
||||||
|
|
@ -162,16 +162,11 @@ function getProductExampleQuestions(): string {
|
||||||
return questions.join(',');
|
return questions.join(',');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract version subpath for hint
|
const productName = productData?.product?.name || 'InfluxDB';
|
||||||
const pathParts = window.location.pathname.split('/').filter(Boolean);
|
|
||||||
const versionPath =
|
|
||||||
pathParts.length >= 2
|
|
||||||
? `/${pathParts[0]}/${pathParts[1]}/`
|
|
||||||
: window.location.pathname;
|
|
||||||
|
|
||||||
// Append version hint to each question
|
// Append version hint to each question
|
||||||
const questionsWithHint = questions.map((question) => {
|
const questionsWithHint = questions.map((question) => {
|
||||||
return `${question} (Version: ${versionPath})`;
|
return `${question} (My version: ${productName})`;
|
||||||
});
|
});
|
||||||
|
|
||||||
return questionsWithHint.join(',');
|
return questionsWithHint.join(',');
|
||||||
|
|
@ -196,14 +191,9 @@ function getVersionContext(): string {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract version subpath for context
|
const productName = productData?.product?.name || 'InfluxDB';
|
||||||
const pathParts = window.location.pathname.split('/').filter(Boolean);
|
|
||||||
const versionPath =
|
|
||||||
pathParts.length >= 2
|
|
||||||
? `/${pathParts[0]}/${pathParts[1]}/`
|
|
||||||
: window.location.pathname;
|
|
||||||
|
|
||||||
return `(Version: ${versionPath})`;
|
return `My version: ${productName}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupVersionPrefill(): void {
|
function setupVersionPrefill(): void {
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,7 @@ telegraf:
|
||||||
latest_patches:
|
latest_patches:
|
||||||
v1: 1.36.3
|
v1: 1.36.3
|
||||||
ai_sample_questions:
|
ai_sample_questions:
|
||||||
- How do I install and configure Telegraf?
|
- How do I configure Telegraf for InfluxDB 3?
|
||||||
- How do I write a custom Telegraf plugin?
|
- How do I write a custom Telegraf plugin?
|
||||||
- How do I use Telegraf for MQTT?
|
- How do I use Telegraf for MQTT?
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue