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

[BUG] errors in sample templates #955

Closed
yuye-aws opened this issue Nov 12, 2024 · 5 comments · Fixed by #958
Closed

[BUG] errors in sample templates #955

yuye-aws opened this issue Nov 12, 2024 · 5 comments · Fixed by #958
Assignees
Labels
bug Something isn't working

Comments

@yuye-aws
Copy link
Member

What is the bug?

I've found the sample samples in file https://github.com/opensearch-project/flow-framework/blob/main/sample-templates/alert-summary-agent-claude-tested.json is wrong.

How can one reproduce the bug?

Provision resources with this template. Then, I call predict on the created claude model. I will then meet with the following error:

{
  "error": {
    "root_cause": [
      {
        "type": "status_exception",
        "reason": "Error from remote service: {\"message\":\"prompt must start with \\\"\\n\\nHuman:\\\" turn after an optional system prompt\"}"
      }
    ],
    "type": "status_exception",
    "reason": "Error from remote service: {\"message\":\"prompt must start with \\\"\\n\\nHuman:\\\" turn after an optional system prompt\"}"
  },
  "status": 400
}

What is the expected behavior?

Both the created agent and claude model should work

What is your host/environment?

Linux. OpenSearch 2.18.

Do you have any screenshots?

image

Do you have any additional context?

Need to check other templates to see whether there are any errors.

@yuye-aws yuye-aws added bug Something isn't working untriaged labels Nov 12, 2024
@yuye-aws
Copy link
Member Author

May also need to check other dashboard assistant agents.

@dbwiddis
Copy link
Member

#873

@qianheng-aws can you please investigate?

@qianheng-aws
Copy link
Contributor

#873

@qianheng-aws can you please investigate?

We need to add \n\nHuman: at the beginning of the prompt for model claude v1. Fixed by this PR: #958

@yuye-aws
Copy link
Member Author

yuye-aws commented Nov 14, 2024

Find out that anomaly-detector-suggestion-agent-claude.json and query-assist-data-summary-agent-claude-tested.json also has the same error. @gaobinlong and @chishui can you update the prompt as the following?

"request_body": "{\"prompt\":\"\\n\\nHuman: ${parameters.prompt}\\n\\nAssistant:\", \"max_tokens_to_sample\":${parameters.max_tokens_to_sample}, \"temperature\":${parameters.temperature}, \"anthropic_version\":\"${parameters.anthropic_version}\" }",

@yuye-aws
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants