-
Notifications
You must be signed in to change notification settings - Fork 76
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When making changes to the errors file whilst the proxy is running, exceptions are thrown in the proxy output and the file is not reloaded.
Expected behaviour
Proxy reloads the content of the errors file automatically.
Actual behaviour
An error is thrown on the first change but the file is reloaded.
An error is thrown on the second change but the file is not reloaded.
An error is thrown on the third change, the file is locked and cannot be overridden.
Environment
OS: Windows 11
Shell: PowerShell
MGDP: 0.6.0
Steps to reproduce
- Add a file called
openai.json
to thepresets
folder.
{
"plugins": [
{
"name": "GenericRandomErrorPlugin",
"enabled": true,
"pluginPath": "GraphProxyPlugins\\msgraph-developer-proxy-plugins.dll",
"configSection": "openAI",
"urlsToWatch": [
"https://api.openai.com/*"
]
}
],
"urlsToWatch": [
],
"openAI": {
"rate": 95,
"errorsFile": "errors-openai.json"
},
"labelMode": "text",
"logLevel": "info"
}
- Create a file called
errors-openai.json
in the project root.
{
"responses": [
{
"statusCode": 500,
"headers": {
"content-type": "application/json; charset=utf-8"
},
"body": {
"error": {
"message": "The server had an error while processing your request",
"type": "requests",
"param": null,
"code": null
}
}
},
{
"statusCode": 429,
"addDynamicRetryAfter": true,
"headers": {
"content-type": "application/json; charset=utf-8"
},
"body": {
"error": {
"message": "The engine is currently overloaded, please try again later.",
"type": "requests",
"param": null,
"code": null
}
}
},
{
"statusCode": 429,
"headers": {
"content-type": "application/json; charset=utf-8"
},
"body": {
"error": {
"message": "Rate limit reached for default-text-davinci-003 in organization org-K7hT684bLccDbBRnySOoK9f2 on tokens per min. Limit: 150000.000000 / min. Current: 160000.000000 / min. Contact support@openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://beta.openai.com/account/billing to add a payment method.",
"type": "tokens",
"param": null,
"code": null
}
}
},
{
"statusCode": 429,
"headers": {
"content-type": "application/json; charset=utf-8"
},
"body": {
"error": {
"message": "Rate limit reached for default-text-davinci-003 in organization org-K7hT684bLccDbBRnySOoK9f2 on requests per min. Limit: 60.000000 / min. Current: 70.000000 / min. Contact support@openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://beta.openai.com/account/billing to add a payment method.",
"type": "requests",
"param": null,
"code": null
}
}
}
]
}
- Start the proxy from the project root folder using the preset configuration file.
mgdp -c /path/to/presets/openai.json
- Remove an object from the responses array in the
errors-openai.json
file. Save the file. - Remove an object from the responses array in the
errors-openai.json
file. Save the file. - Remove an object from the responses array in the
errors-openai.json
file. Save the file.
waldekmastykarz
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working