python-tgpt
python-tgpt copied to clipboard
BlackboxAI not giving response despite a 200 response from server?
Hi, so I was trying to make a simple ai chatbot script for testing, and it seems that despite the 200 response, it still throws an exception? Phind works. Here's my code:
def main():
bot = blackbox.BLACKBOXAI()
while True:
user_input = input("You: ")
if user_input.lower() == 'exit':
print("Ending the conversation. Goodbye!")
break
response = bot.chat(user_input)
print(f"Bot: {response}")
if __name__ == "__main__":
main()```
...and here's the output:
```You: Hi!
Traceback (most recent call last):
File "c:\Users\Saneboorai\Desktop\SaneJS\bbapiSANE.py", line 16, in <module>
main()
File "c:\Users\Saneboorai\Desktop\SaneJS\bbapiSANE.py", line 12, in main
response = bot.chat(user_input)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Saneboorai\AppData\Roaming\Python\Python312\site-packages\pytgpt\blackboxai\main.py", line 216, in chat
return for_stream() if stream else for_non_stream()
^^^^^^^^^^^^^^^^
File "C:\Users\Saneboorai\AppData\Roaming\Python\Python312\site-packages\pytgpt\blackboxai\main.py", line 208, in for_non_stream
self.ask(
File "C:\Users\Saneboorai\AppData\Roaming\Python\Python312\site-packages\pytgpt\blackboxai\main.py", line 181, in ask
return for_stream() if stream else for_non_stream()
^^^^^^^^^^^^^^^^
File "C:\Users\Saneboorai\AppData\Roaming\Python\Python312\site-packages\pytgpt\blackboxai\main.py", line 177, in for_non_stream
for _ in for_stream():
^^^^^^^^^^^^
File "C:\Users\Saneboorai\AppData\Roaming\Python\Python312\site-packages\pytgpt\blackboxai\main.py", line 149, in for_stream
raise exceptions.FailedToGenerateResponseError(
pytgpt.exceptions.FailedToGenerateResponseError: Failed to generate response - (200, OK)
also, does blackbox or any other models have web access? when i asked phind about something from today it said that it doesn't know.
Looks like there are some changes on the provider's side. Intervention is underway.
Okay, looking forward to it getting fixed!
The provider was deprecated a while ago.