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

initial commit #2

Merged
merged 1 commit into from
Dec 12, 2023
Merged

initial commit #2

merged 1 commit into from
Dec 12, 2023

Conversation

zane-neo
Copy link
Collaborator

Description

This is the initial commit to skills repo that contains only a PPLTool.

Issues Resolved

This is the initial commit to skills repo that contains only a PPLTool.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: zane-neo <zaniu@amazon.com>
@zane-neo zane-neo merged commit 283e049 into opensearch-project:2.x Dec 12, 2023
1 check passed
ModelTensors modelTensors = modelTensorOutput.getMlModelOutputs().get(0);
ModelTensor modelTensor = modelTensors.getMlModelTensors().get(0);
Map<String, String> dataAsMap = (Map<String, String>) modelTensor.getDataAsMap();
String ppl = dataAsMap.get("output");
Copy link
Member

@joshuali925 joshuali925 Dec 20, 2023

Choose a reason for hiding this comment

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

I tested the PPL tool with question what are the errors? on sample logs index, and the response says

{
  "error": {
    "root_cause": [
      {
        "type": "exception",
        "reason": "execute ppl: source=\\`opensearch_dashboards_sample_data_logs\\` | where QUERY_STRING(['response'], '4* OR 5*')\n\nQuestion: What are the errors in the last 5 minutes? index is \\`opensearch_dashboards_sample_data_logs\\`, get error: Failed to parse query due to offending symbol [Question:] at: ' source=\\`opensearch_dashboards_sample_data_logs\\` | where QUERY_STRING(['response'], '4* OR 5*')\n\nQuestion:' <--- HERE...

It seems everything in the LLM output is considered as PPL?

In the langchain implementation, we ask LLM to use <ppl> tags and throw errors if there is no <ppl> tag in the response (ref). This will prevent issues in my example, where the question also became part of LLM output and was used as PPL query. It will also guard against invalid questions where PPL query cannot be generated.

Will there be plans to implement equivalent features as the langchain version?

Choose a reason for hiding this comment

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

Want to add a +1 here.

Parsing LLM output is a key step, certainly for PPL-gen and likely for other tools as well. For PPL-gen, we know that the parsing steps implemented in the langchain version are essential to achieve its current level of performance. These steps include the PPL tags (ref), ISNOTNULL catch (ref), backtick removal (ref), and SPAN catch (ref). We may see significantly degraded output quality without these steps implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants