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] Your request contained invalid JSON: 'utf-8' codec can't decode byte 0xeb (OpenAI connector) #1666

Closed
acha5066 opened this issue Nov 21, 2023 · 1 comment · Fixed by #1691
Labels
bug Something isn't working

Comments

@acha5066
Copy link

acha5066 commented Nov 21, 2023

What is the bug?
When attempting to return an embedding for a string containing the character ë I get the error "Your request contained invalid JSON: 'utf-8' codec can't decode byte 0xeb in position 443". When I remove the character it works. I am retrieving the embedding from the _predict endpoint:

POST http://localhost:9200/_plugins/_ml/models/{model_id/_predict
{
    "parameters": {
        "input": ["This is a string containing Moët Hennessy"]
    }
}

Removing the special character and replacing it with e works. If I request the embedding directly from open AI (with special character) it works fine.

POST https://api.openai.com/v1/embeddings

{
    "input": "This is a string containing Moët Hennessy",
    "model": "text-embedding-ada-002",
    "encoding_format": "float"
}

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Setup Open AI connector described here:
  2. Retrieve embedding for string described above.

What is the expected behavior?
Embedding should be returned for strings containing special characters.

What is your host/environment?

  • Ubunutu
  • Opensearch 2.11 running in a local docker setup.

Do you have any screenshots?
N/A

Do you have any additional context?
N/A

@acha5066 acha5066 added bug Something isn't working untriaged labels Nov 21, 2023
@ylwu-amzn
Copy link
Collaborator

Thanks for reporting this issue. Will fix this in PR #1691

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.

2 participants