momaabna / QGPTAgent

The QGPT Agent is a powerful plugin for QGIS that utilizes the advanced natural language processing capabilities of the OpenAI GPT model to automate various processes in QGIS. With this plugin, users can interact with the QGIS software using natural language commands, significantly reducing the time and effort required to complete various tasks.
77 stars 7 forks source link

Python error #2

Closed ulfboge closed 1 year ago

ulfboge commented 1 year ago

Dear momaabna, Python error - QGPT Agent.txt

When I try to run the QGIS plugin I get a Python error. Please see the message in the attached file. How should I fix this?

Thank you!

Kind regards, Johan

fuzsin commented 1 year ago

Same here. Win10Pro (64), QGIS 3.30.2-'s-Hertogenbosch, Python-Version 3.9.5:

WARNING    Traceback (most recent call last):
File "C:\Users/<user>/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgpt_agent_release\qgpt_agent_dockwidget.py", line 187, in send
self.worker.run()

File "C:\Users/<user>/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgpt_agent_release\qgpt_agent_dockwidget.py", line 106, in run
completion =get_completion(self.prompt, self.api_key,self.temprature)

File "C:\Users/<user>/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgpt_agent_release\qgpt_agent_dockwidget.py", line 90, in get_completion
completion = response.json()['choices'][0]['text']
KeyError: 'choices'

Greetings fuzsin

momaabna commented 1 year ago

Check

fuzsin commented 1 year ago
  • your balance in openai

Do I need a pro account for the plugin to work?

momaabna commented 1 year ago

Actually, openai plan is pay-as-you-go. You can use a free trial or pay for it.