Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert - Add http error instruction for t2ppl task #518

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- remove redundant error toast([#515](https://github.com/opensearch-project/dashboards-assistant/pull/515))
- Add auto suggested aggregation for text2Viz ([#514](https://github.com/opensearch-project/dashboards-assistant/pull/514))
- Remove experimental badge for natural language vis ([#516](https://github.com/opensearch-project/dashboards-assistant/pull/516))
- Revert - Add http error instruction for t2ppl task ([#518](https://github.com/opensearch-project/dashboards-assistant/pull/518))
Copy link
Member

@SuZhou-Joe SuZhou-Joe Mar 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we just revert commit? The changelog entry should be reverted as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

original pr's changelog already be moved to releaseNote and I reverted that. Adding this new changelog to bypass the test for this pr.


### Bug Fixes

Expand Down
24 changes: 0 additions & 24 deletions public/utils/pipeline/text_to_ppl_task.test.ts

This file was deleted.

10 changes: 1 addition & 9 deletions public/utils/pipeline/text_to_ppl_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ import { HttpSetup } from '../../../../../src/core/public';
import { Task } from './task';
import { TEXT2VIZ_API } from '../../../common/constants/llm';

export const processInputQuestion = (inputQuestion: string) => {
const httpErrorInstructionAppendRegExp = new RegExp(`(?:${['error', 'fail'].join('|')})`, 'i');
if (httpErrorInstructionAppendRegExp.test(inputQuestion)) {
return `${inputQuestion}. If you're dealing logs with http response code, then error usually refers to http response code like 4xx, 5xx`;
}
return inputQuestion;
};

interface Input {
inputQuestion: string;
index: string;
Expand All @@ -33,7 +25,7 @@ export class Text2PPLTask extends Task<Input, Input & { ppl: string }> {
async execute<T extends Input>(v: T) {
let ppl = '';
try {
ppl = await this.text2ppl(processInputQuestion(v.inputQuestion), v.index, v.dataSourceId);
ppl = await this.text2ppl(v.inputQuestion, v.index, v.dataSourceId);
} catch (e) {
throw new Error(
`Error while generating PPL query with input: ${v.inputQuestion}. Please try rephrasing your question.`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Compatible with OpenSearch and OpenSearch Dashboards version 3.0.0-alpha1
- Optimize source selector width in t2v page ([#497](https://github.com/opensearch-project/dashboards-assistant/pull/497))
- Show error message if PPL query does not contain aggregation ([#499](https://github.com/opensearch-project/dashboards-assistant/pull/499))
- Adjust the overall style of alert summary popover ([#501](https://github.com/opensearch-project/dashboards-assistant/pull/501))
- Add http error instruction for t2ppl task ([#502](https://github.com/opensearch-project/dashboards-assistant/pull/502))
- Change the background color, button position and text for alert summary popover ([#506](https://github.com/opensearch-project/dashboards-assistant/pull/506))
- collect metrics for when t2viz triggered([#510](https://github.com/opensearch-project/dashboards-assistant/pull/510))
- chatbot dock bottom border top([#511](https://github.com/opensearch-project/dashboards-assistant/pull/511))
Expand Down
Loading