Coder Social home page Coder Social logo

nvda-chatgpt's Introduction

nvda-chatGPT

About

This add-on provides an access to chatGPT. through key bindings, so you can ask meanings of any words, or ask anyquestions.
Especially useful for asking difficult words that you don't know, or asking simple programming questions.
You need api key (it is free), but I think it's worth time.
You can read readme in, Japanese.

Download

nvda-chatGPT

Setup (YOU NEED TO DO THIS)

You need chatGPT api key to use this add-on, You get free credits, but it expires in several monthes.
So, after it expires, you need to pay your actual money to keep using this add-on, it should be less than $5 a month for normal usage.
Below is how to get api key and set up.

  1. go to https://platform.openai.com/account/api-keys
  2. login (make an account, if you don't have one)
  3. press the button "Create new secret key‍"
  4. go to nvda - preference - settings - askChatGPT, and put the api key.

Key bindings

  • NVDA+shift+W Ask the meaning of selected word, or open a dialog, if none is selected.

  • NVDA+shift+L Open a dialog to ask a question.

Press ctrl + enter to send a request in the dialog. You can get responses in 3 ~ 30 seconds, depends on difficulty of the questions.
You can browse your conversation in the list above text box, pressing enter will open a dialog of a selected message.

For people this add-on is not working

Assuming you correctly put your api key, most likely your chatGPT account is too old, so your free credits you got when you created your account expired.
Now, you need to set up your payment method.
Go to here

I need your supports!

Due to my visual impairment, my capability for jobs is pretty limited.
I'd really appreciate donations if anyone find my add-on useful.
Here is the link: paypal.me

contributor

  • wrapper to access chatGPT revChatGPT

  • Figured out how to correctly import modules @sarnex

nvda-chatgpt's People

Contributors

cyrilleb79 avatar mo29cg avatar vovamobile avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nvda-chatgpt's Issues

Implement conversation feature

  • Add a list above text box, where I can browse chat logs. This is only for "ask sentence" dialog.
  • make each message be able to open with ui.browsableMessage.
  • switching conversation feature.
  • Probably there should be a limit for a conversation to be chained, because it'll be expensive.

user should be able to choose whether to keep the chat window open".

Hello,
I'd like to have the capability to maintain my NVDAChatGpt opened, so I can review messages.
I envision a window where I can use the tab key to switch between the editing field where I write and a read-only field where all the messages are displayed. Ctrl-enter sends the messages. This way, some history can be maintained!"

Encoding errors

There are various text encoding errors in this add-on.

Issue 1:

I send: "Bonjour, parles-tu français?" as first request.
In the dialog list, I get the following text:
You : Bonjour, parles-tu français?

Issue 2

After a while in the conversation, there are also encoding issues in the ui.browseableMessage, e.g.:
Je suis désolé
The encoding errors are always worse when the conversation becomes longer.

Note: I do not know if it is related to some encoding config in my system; I think that it should be cp1252.

Issue 3:

Looking at the code, I can see that you use a markdown module. However, this seem to create issues as follows.
If I ask:
"Could you give me an example on how to write markdown titles"
In the `ui.browsableMessage, I get the titles detected by NVDA rather than the markdown source code to create them, e.g.:

# Title 1
## Title 2

I do not know why you use markdown, but maybe some sort of escaping is missing somewhere.

Thanks.

Doesn't work if braille display is connected

seems like ui.message doesn't work with braille display?

I put the secret key, but when I press nvda-shift-l for example, I obtain this from the log:

ERROR - stderr (14:14:44.895) - Thread-12 (13368):
Exception in thread Thread-12:
Traceback (most recent call last):
  File "threading.pyc", line 926, in _bootstrap_inner
  File "threading.pyc", line 870, in run
  File "D:\Users\MI09424\Desktop\xnvda\userConfig\addons\nvdaChatGPT\globalPlugins\nvdaChatGPT\__init__.py", line 110, in askChatGPT
    ui.message(functionStartMessage)
  File "ui.pyc", line 133, in message
  File "braille.pyc", line 2307, in message
  File "braille.pyc", line 2321, in _resetMessageTimer
  File "wx\core.pyc", line 3451, in __init__
  File "wx\core.pyc", line 3472, in Start
wx._core.wxAssertionError: C++ assertion "wxThread::IsMain()" failed at ..\..\src\common\timerimpl.cpp(57) in wxTimerImpl::Start(): timer can only be started from the main thread

Make it translatable

2. You may want to make translatable the following sentence:
"What is the meaning of " + word + "? Respond in english"
and use a formatted string,
i.e.:
_(f"What is the meaning of {word}? Respond in english")
Then you can ask translators to translate your add-on. And translators will have to translate this request to ChatGPT. This may allow ChatGPT to answer in the language of NVDA interface if any translation exists, else in English. Then you can also develop explicit definition of the expected language of the answer and pick the correct request sentence in the existing translations.
This would allow to avoid being limited to English and Japanese or to have various translation requests hard-coded for many languages in the code.

Version 0.9 cannot initialize due to a hardcoded path

I have just installed the latest version. The following traceback is displayed in the log:

Error importing global plugin nvdaChatGPT
Traceback (most recent call last):
  File "globalPluginHandler.pyc", line 23, in listPlugins
  File "importlib\__init__.pyc", line 127, in import_module
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\jmdaweb\AppData\Roaming\nvda\addons\nvdaChatGPT\globalPlugins\nvdaChatGPT\__init__.py", line 6, in <module>
    from . import asker as asker
  File "C:\Users\jmdaweb\AppData\Roaming\nvda\addons\nvdaChatGPT\globalPlugins\nvdaChatGPT\asker.py", line 2, in <module>
    from . import (
  File "C:\Users\jmdaweb\AppData\Roaming\nvda\addons\nvdaChatGPT\globalPlugins\nvdaChatGPT\messenger.py", line 4, in <module>
    from .myLog import mylog
  File "C:\Users\jmdaweb\AppData\Roaming\nvda\addons\nvdaChatGPT\globalPlugins\nvdaChatGPT\myLog.py", line 8, in <module>
    f = open(LOG_FILE_NAME, "w")
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\suzuki\\TerminalOutputs\\firstLog.json'

Regards.

Feature Request: Ability to set the text sent to GPT to Describe a Word

I am learning Japanese. Every time I need a translation, I like to tell GPT, "Translate this into English, then break it down word by word." This way insures that GPT will give me the meaning of each word, as well as the full sentence. It would be great if the Ask a Word feature allowed you to set custom text so I wouldn't have to type this sentence every time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.