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

Trying to find timeout when calling REST command endpoint. #311

Open
richardklafter opened this issue Oct 13, 2023 · 4 comments
Open

Trying to find timeout when calling REST command endpoint. #311

richardklafter opened this issue Oct 13, 2023 · 4 comments

Comments

@richardklafter
Copy link
Collaborator

I am using the REST endpoint to run an LLM and respond with TTS. Everything works great except when the LLM is slow to respond. It seems there is a 5 second timeout somewhere in the stack? I checked the app server's python and didn't see the issue there so perhaps it is in the ESP32? Any help would be appreciated. Happy to pipe it through as a setting in the UI or whatever if I can find the source.

Simple python REST endpoint which demonstrates the issue.

from flask import Flask, jsonify
import time

app = Flask(__name__)

@app.route('/test', methods=['POST'])
def test():
    #time.sleep(4.5) #works
    time.sleep(5) #does not work
    return jsonify("good as gold")

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=3000)
@nikito
Copy link
Contributor

nikito commented Oct 14, 2023

I'm admittedly not super well versed in the C code, but I looked through the endpoint code in Willow and I couldn't find any explicit timeout defined in the code for awaiting the post reply, so I wonder if this may be something inside the espressif libraries..? I'll let one of the other devs chime in here 🙂

@kristiankielhofner
Copy link
Contributor

@richardklafter is using WAS Command Endpoint support. We're using python requests with the default timeouts. I'm working through a way to handle this and will have it available shortly.

@richardklafter
Copy link
Collaborator Author

Thanks @kristiankielhofner!

@stintel
Copy link
Collaborator

stintel commented Dec 20, 2023

Timeout in WAS REST Command Endpoint should be 30s as per toverainc/willow-application-server@ff86dd97. Does this answer your question? If yes, please close the ticket. Thanks!

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

No branches or pull requests

4 participants