Hassassistant / OpenMindsAI

62 stars 4 forks source link

No response value? #2

Closed nilsoo closed 1 year ago

nilsoo commented 1 year ago

I’m not getting a response value. Have set up acording to readme. Getting the following error in the log: result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/openmindsai/sensor.py", line 31, in ask response_message = response_json[0]["response"] KeyError: 0 2023-04-29 00:11:50.393 ERROR (MainThread) [frontend.js.latest.202304111] :0:0 Script error.

Hassassistant commented 1 year ago

just added another update. made an error. on the SQL query in MindsDB, the model_name needed to be gpt-4 and not gpt4.

hopefully this helps you.

CREATE MODEL mindsdb.gpt4 PREDICT response USING engine = 'openai', max_tokens = 2000, model_name = 'gpt-4', prompt_template = '{{text}}';

nilsoo commented 1 year ago

Still getting the same error log:File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/openmindsai/sensor.py", line 31, in ask response_message = response_json[0]["response"]KeyError: 0

nilsoo commented 1 year ago

Ok, changed the Model name in configuration.yaml to gpt4, and now it works! Thank you.