mattsegura / fastGPT

An api utilizing fast api onto the reverse engineered chatGPT
4 stars 0 forks source link

Error in /ask/ post method #2

Open Gabxred opened 1 year ago

Gabxred commented 1 year ago

INFO: 127.0.0.1:50855 - "POST /ask/?prompt=puede%20un%20auto%20bailar%3F HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 407, in run_asgi result = await app( # type: ignore[func-returns-value] File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in __call__ return await self.app(scope, receive, send) File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\fastapi\applications.py", line 271, in __call__ await super().__call__(scope, receive, send) File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\applications.py", line 118, in __call__ await self.middleware_stack(scope, receive, send) File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__ raise exc File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__ await self.app(scope, receive, _send) File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__ raise exc File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__ await self.app(scope, receive, sender) File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__ raise e File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\routing.py", line 706, in __call__ await route.handle(scope, receive, send) File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\routing.py", line 276, in handle await self.app(scope, receive, send) File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\routing.py", line 66, in app response = await func(request) File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\fastapi\routing.py", line 237, in app raw_response = await run_endpoint_function( File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\fastapi\routing.py", line 163, in run_endpoint_function return await dependant.call(**values) File "E:\GPT Investigation\fastGPT\.\main.py", line 56, in ask response_list = list(response) File "C:\Users\usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\revChatGPT\V1.py", line 482, in ask raise Error(source="ask", message="Field missing", code=1) revChatGPT.V1.Error image

mattsegura commented 1 year ago

Just checked everything and it works fine, I'm currently using Swagger not postman to make the requests. Whenever you're using postman check to make sure everything is formatted correctly.

Sample post request with curl curl -X 'POST' \ 'http://127.0.0.1:8000/ask/?prompt=hello' \ -H 'accept: application/json' \ -d ''

Also, before making a post request you need to log in first using some sort of credentials through the post /login/ before making one to the /ask/ so check that also.

Gabxred commented 1 year ago

imagen I also tried with the swagger tool but it responds the same

mattsegura commented 1 year ago

imagen I also tried with the swagger tool but it responds the same

dd you make sure to login first