Authentication failure with prompty for serverless AI models
When using the prompty extension with a serverless AI model (custom endpoint), an authentication error occurs with the following message:
{
"statusCode": 401,
"message": "Auth token validation failed. Please provide a valid key or a valid AAD token"
}
The issue does not occur when using GitHub-provided AI model endpoints.
By looking at the prompty output(verbose) I noticed that the api_key used in the API request does not match the one explicitly specified in the .prompty configuration file.
I temporarily resolved the issue by modifying the executor.py file of the prompty library. I added the following lines:
However, this fix only works when running a Python script with prompty.execute. Running the .prompty file directly still results in the same authentication error.
Makes sense - I will take a look at maxing the fix in the extension.
OK - I think I fixed this error in the latest release - it was a silly error on my part.
@sethjuarez What was the mistake?
I take it back... I think I fixed the issue in the lib but not the extension