Skip to content

Commit 2acd9a4

Browse files
committed
revert-Add http error instruction for t2ppl task
Signed-off-by: yyfamazon <[email protected]>
1 parent c7d1c37 commit 2acd9a4

File tree

3 files changed

+1
-34
lines changed

3 files changed

+1
-34
lines changed

public/utils/pipeline/text_to_ppl_task.test.ts

-24
This file was deleted.

public/utils/pipeline/text_to_ppl_task.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ import { HttpSetup } from '../../../../../src/core/public';
77
import { Task } from './task';
88
import { TEXT2VIZ_API } from '../../../common/constants/llm';
99

10-
export const processInputQuestion = (inputQuestion: string) => {
11-
const httpErrorInstructionAppendRegExp = new RegExp(`(?:${['error', 'fail'].join('|')})`, 'i');
12-
if (httpErrorInstructionAppendRegExp.test(inputQuestion)) {
13-
return `${inputQuestion}. If you're dealing logs with http response code, then error usually refers to http response code like 4xx, 5xx`;
14-
}
15-
return inputQuestion;
16-
};
17-
1810
interface Input {
1911
inputQuestion: string;
2012
index: string;
@@ -32,7 +24,7 @@ export class Text2PPLTask extends Task<Input, Input & { ppl: string }> {
3224
async execute<T extends Input>(v: T) {
3325
let ppl = '';
3426
try {
35-
ppl = await this.text2ppl(processInputQuestion(v.inputQuestion), v.index, v.dataSourceId);
27+
ppl = await this.text2ppl(v.inputQuestion, v.index, v.dataSourceId);
3628
} catch (e) {
3729
throw new Error(
3830
`Error while generating PPL query with input: ${v.inputQuestion}. Please try rephrasing your question.`

release-notes/dashboards-assistant.release-notes-3.0.0.0-alpha1.md

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Compatible with OpenSearch and OpenSearch Dashboards version 3.0.0-alpha1
2525
- Optimize source selector width in t2v page ([#497](https://github.com/opensearch-project/dashboards-assistant/pull/497))
2626
- Show error message if PPL query does not contain aggregation ([#499](https://github.com/opensearch-project/dashboards-assistant/pull/499))
2727
- Adjust the overall style of alert summary popover ([#501](https://github.com/opensearch-project/dashboards-assistant/pull/501))
28-
- Add http error instruction for t2ppl task ([#502](https://github.com/opensearch-project/dashboards-assistant/pull/502))
2928
- Change the background color, button position and text for alert summary popover ([#506](https://github.com/opensearch-project/dashboards-assistant/pull/506))
3029
- collect metrics for when t2viz triggered([#510](https://github.com/opensearch-project/dashboards-assistant/pull/510))
3130
- chatbot dock bottom border top([#511](https://github.com/opensearch-project/dashboards-assistant/pull/511))

0 commit comments

Comments
 (0)