Coder Social home page Coder Social logo

0ut0flin3 / talk2gpt Goto Github PK

View Code? Open in Web Editor NEW
95.0 4.0 8.0 430 KB

GPT-3 client for Windows and Unix with memories management that supports both text and speech in any language. Includes a free text2image

License: Apache License 2.0

Python 100.00%
ai gpt gpt3 openai speech-recognition speech-to-text tts

talk2gpt's Introduction

GPTalk 0.0.4.5 (text + speech)

Fast GPT-3 client for Windows and Unix that supports both text and speech in any language.

Mar 26, 2023 Use of DALL-E is now FREE-TO-USE

Here is a video tutorial if you have troubles using Python or GPTalk: https://www.youtube.com/watch?v=jXBpMUv5QB0&t=320s

Jan 24,2023: Integrated DALL-E support - Instant generation and preview of images using both text and speech

JOIN DISCORD | TWITTER | DONATE

REQUIREMENTS

INSTALLATION

USAGE

LIST OF SUPPORTED LANGUAGES

REQUIREMENTS

-In order to use GPTalk you need :

1) Install the following libraries only if you are on Linux\MAC:

LINUX: apt install mpg321 python3-dev portaudio19-dev

MAC: brew install mpg321 portaudio Join Discord and ask if you have issues....

2) Have an OpenAI's Api Key ( you can set it in app or put it inside the OPENAI_API_KEY environment variable.)

Should be enough, but if you already have problems in voice detection even after several attempts try these POSSIBLE SOLUTIONS:

on linux: sudo apt-get python-dev build-essential swig libpulse-dev ..... then : sudo pip install pocketsphinx .... then uninstall and reinstall gptalk

on mac: brew install swig pulseaudio ..... then : sudo pip install pocketsphinx .... then uninstall and reinstall gptalk

INSTALLATION

Install GPTalk using PIP: pip install gptalk==0.0.4.5

Upgrade gptalk from time to time with pip install -U so that you always use the updated and bugfixed version.

USAGE

In addition to interact with GPT-3 using the text or speech, it is also possible to define some aspects of its behavior and personal details, as well as yours.

BASIC USAGE EXAMPLE:

import gptalk.gptalk as gpt3

app = gpt3.CONFIGURE(<YOUR_API_KEY>)  # OR: app = gpt3.CONFIGURE(os.getenv('OPENAI_API_KEY'))

app.language=<LANGUAGE_TICKER> # only needed for speech mode really, because text mode automatically will translate if you start chatting in a specific lang

app.input_mode = "speech" # OR 'text'

app.AI_NAME = "Alice"

app.HUMAN_NAME = "Bob"

app.AI_GENRE = "female"

app.AI_AGE = "32"

app.AI_MOOD = "happy"

app.AI_SPECIES = "human"

then, save:

app.save() #will create a memories.json file in the same folder that will store the informations you set in the previous step. will also store and remember conversations with gpt3.Every time you run save(),already existent memories.json will be replaced with new. You can just run directly run() in the next step to use already existent. Don't matter if you do directly run() without save() ,in that case no memories will be used. You can also create your own empty memories.json that must contains at least two brackets {} , (must NOT be fully empty)

and,then, run the app:

app.run()

Start talking ( or typing, depending by the mode you choose) ... As for 'speech mode', gpt-3 should respond in seconds, but several factors can influence (try more times if you fail, move closer to the microphone)

Say goodbye or go to sleep to quit.

AVAILABLE PARAMETERS : AI_NAME, AI_AGE, AI_HOBBIES, AI_GENRE, AI_MOOD, AI_SPECIES , HUMAN_NAME, HUMAN_AGE, HUMAN_HOBBIES, HUMAN_GENRE, HUMAN_MOOD, HUMAN_SPECIES

If you want change speech language (en-US is default) use app.language=<LANGUAGE_TICKER> (before run)

Give a feedback, positive or negative,it's very apprecciated >> https://discord.gg/mettNtATzW

Generate images

DALL-E image generation is now active using both voice and text and it is FREE-TO-USE. you can use it unlimitedly without spending tokens

To activate image mode ask GPT-3 to activate it, e.g. please, activate image mode , it will be active immediately. From that moment the inputs will generate an image that will be immediately displayed in a pop-up.

To exit image mode, tell GPT-3 to disable it and you'll be back to normal use.

LANGUAGES

af-ZA   Afrikaans (South Africa)
ar-AE   Arabic (U.A.E.)
ar-BH   Arabic (Bahrain)
ar-DZ   Arabic (Algeria)
ar-EG   Arabic (Egypt)
ar-IQ   Arabic (Iraq)
ar-JO   Arabic (Jordan)
ar-KW   Arabic (Kuwait)
ar-LB   Arabic (Lebanon)
ar-LY   Arabic (Libya)
ar-MA   Arabic (Morocco)
ar-OM   Arabic (Oman)
ar-QA   Arabic (Qatar)
ar-SA   Arabic (Saudi Arabia)
ar-SY   Arabic (Syria)
ar-TN   Arabic (Tunisia)
ar-YE   Arabic (Yemen)
az-AZ   Azeri (Latin) (Azerbaijan)
az-AZ   Azeri (Cyrillic) (Azerbaijan)
be-BY   Belarusian (Belarus)
bg-BG   Bulgarian (Bulgaria)
bs-BA   Bosnian (Bosnia and Herzegovina)
ca-ES   Catalan (Spain)
cs-CZ   Czech (Czech Republic)
cy-GB   Welsh (United Kingdom)
da-DK   Danish (Denmark)
de-AT   German (Austria)
de-CH   German (Switzerland)
de-DE   German (Germany)
de-LI   German (Liechtenstein)
de-LU   German (Luxembourg)
dv-MV   Divehi (Maldives)
el-GR   Greek (Greece)
en-AU   English (Australia)
en-BZ   English (Belize)
en-CA   English (Canada)
en-CB   English (Caribbean)
en-GB   English (United Kingdom)
en-IE   English (Ireland)
en-JM   English (Jamaica)
en-NZ   English (New Zealand)
en-PH   English (Republic of the Philippines)
en-TT   English (Trinidad and Tobago)
en-US   English (United States)
en-ZA   English (South Africa)
en-ZW   English (Zimbabwe)
es-AR   Spanish (Argentina)
es-BO   Spanish (Bolivia)
es-CL   Spanish (Chile)
es-CO   Spanish (Colombia)
es-CR   Spanish (Costa Rica)
es-DO   Spanish (Dominican Republic)
es-EC   Spanish (Ecuador)
es-ES   Spanish (Castilian)
es-ES   Spanish (Spain)
es-GT   Spanish (Guatemala)
es-HN   Spanish (Honduras)
es-MX   Spanish (Mexico)
es-NI   Spanish (Nicaragua)
es-PA   Spanish (Panama)
es-PE   Spanish (Peru)
es-PR   Spanish (Puerto Rico)
es-PY   Spanish (Paraguay)
es-SV   Spanish (El Salvador)
es-UY   Spanish (Uruguay)
es-VE   Spanish (Venezuela)
et-EE   Estonian (Estonia)
eu-ES   Basque (Spain)
fa-IR   Farsi (Iran)
fi-FI   Finnish (Finland)
fo-FO   Faroese (Faroe Islands)
fr-BE   French (Belgium)
fr-CA   French (Canada)
fr-CH   French (Switzerland)
fr-FR   French (France)
fr-LU   French (Luxembourg)
fr-MC   French (Principality of Monaco)
gl-ES   Galician (Spain)
gu-IN   Gujarati (India)
he-IL   Hebrew (Israel)
hi-IN   Hindi (India)
hr-BA   Croatian (Bosnia and Herzegovina)
hr-HR   Croatian (Croatia)
hu-HU   Hungarian (Hungary)
hy-AM   Armenian (Armenia)
id-ID   Indonesian (Indonesia)
is-IS   Icelandic (Iceland)
it-CH   Italian (Switzerland)
it-IT   Italian (Italy)
ja-JP   Japanese (Japan)
ka-GE   Georgian (Georgia)
kk-KZ   Kazakh (Kazakhstan)
kn-IN   Kannada (India)
ko-KR   Korean (Korea)
kok-IN  Konkani (India)
ky-KG   Kyrgyz (Kyrgyzstan)
lt-LT   Lithuanian (Lithuania)
lv-LV   Latvian (Latvia)
mi-NZ   Maori (New Zealand)
mk-MK   FYRO Macedonian (Former Yugoslav Republic of Macedonia)
mn-MN   Mongolian (Mongolia)
mr-IN   Marathi (India)
ms-BN   Malay (Brunei Darussalam)
ms-MY   Malay (Malaysia)
mt-MT   Maltese (Malta)
nb-NO   Norwegian (Bokm?l) (Norway)
nl-BE   Dutch (Belgium)
nl-NL   Dutch (Netherlands)
nn-NO   Norwegian (Nynorsk) (Norway)
ns-ZA   Northern Sotho (South Africa)
pa-IN   Punjabi (India)
pl-PL   Polish (Poland)
ps-AR   Pashto (Afghanistan)
pt-BR   Portuguese (Brazil)
pt-PT   Portuguese (Portugal)
qu-BO   Quechua (Bolivia)
qu-EC   Quechua (Ecuador)
qu-PE   Quechua (Peru)
ro-RO   Romanian (Romania)
ru-RU   Russian (Russia)
sa-IN   Sanskrit (India)
se-FI   Sami (Northern) (Finland)
se-FI   Sami (Skolt) (Finland)
se-FI   Sami (Inari) (Finland)
se-NO   Sami (Northern) (Norway)
se-NO   Sami (Lule) (Norway)
se-NO   Sami (Southern) (Norway)
se-SE   Sami (Northern) (Sweden)
se-SE   Sami (Lule) (Sweden)
se-SE   Sami (Southern) (Sweden)
sk-SK   Slovak (Slovakia)
sl-SI   Slovenian (Slovenia)
sq-AL   Albanian (Albania)
sr-BA   Serbian (Latin) (Bosnia and Herzegovina)
sr-BA   Serbian (Cyrillic) (Bosnia and Herzegovina)
sr-SP   Serbian (Latin) (Serbia and Montenegro)
sr-SP   Serbian (Cyrillic) (Serbia and Montenegro)
sv-FI   Swedish (Finland)
sv-SE   Swedish (Sweden)
sw-KE   Swahili (Kenya)
syr-SY  Syriac (Syria)
ta-IN   Tamil (India)
te-IN   Telugu (India)
th-TH   Thai (Thailand)
tl-PH   Tagalog (Philippines)
tn-ZA   Tswana (South Africa)
tr-TR   Turkish (Turkey)
tt-RU   Tatar (Russia)
uk-UA   Ukrainian (Ukraine)
ur-PK   Urdu (Islamic Republic of Pakistan)
uz-UZ   Uzbek (Latin) (Uzbekistan)
uz-UZ   Uzbek (Cyrillic) (Uzbekistan)
vi-VN   Vietnamese (Viet Nam)
xh-ZA   Xhosa (South Africa)
zh-CN   Chinese (S)
zh-HK   Chinese (Hong Kong)
zh-MO   Chinese (Macau)
zh-SG   Chinese (Singapore)
zh-TW   Chinese (T)
zu-ZA   Zulu (South Africa)

DONATE

If you found this software useful please consider a donation:

Bitcoin: 17AnP1zuvLV9cQrGQi6H6qMLeWeujHzAYX

Monero: 82qjYLZj6XeTGjeUNm9AQVB78hVGStZd8YU1UKuvWz8QKAzFWZpBpEQFho3jrvUCNQPSqC9nYeEN3b7FQ5REPffNSA2WSDH

Solana: 6RX2ADdcNWZfaUfuGeHg86AYAoMuLF45Lbgfu3oNGh9i

Litecoin: ltc1q4ft4ltjnyt8auqq4m5u7raatftu6mt5snst493

Ethereum: 0xF3A0246690947669A0bf68147Ba82AC8de576a56

Polygon / MYST : 0x45320b5B2a8f6073f4a92FFDF149861aBade4B4b

Thank you :-)

talk2gpt's People

Contributors

0ut0flin3 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

talk2gpt's Issues

The previous request variable pr isn't updating during a single session.

There is a logic flow problem with the memories file: It loads fine, and dumps fine at the end, but each successive request only sends the original request, stored in the variable pr, plus the latest human request.

You can test this out by asking the AI something, then asking it what its previous answer was. It has no clue.

If you update pr as you go, this is solved and the AI will be fully conversational. I assigned the response to a variable a, then update pr it with:

pr = pr+"Human: "+q+"\nAI: "+a+"\n"

No API key provided- error in windows when try ask using mic

please help , i do what your requirements in windows , i do command python app.py , i got this error when try ask something in microphone .

Human: what is Raspberry Pi

Traceback (most recent call last):
File "C:\Users\Lenovo\Desktop\GPTalk-main\GPTalk-main\app.py", line 237, in
main()
File "C:\Users\Lenovo\Desktop\GPTalk-main\GPTalk-main\app.py", line 184, in main
response = openai.Completion.create(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\openai\api_resources\completion.py", line 25, in create
return super().create(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 107, in create
requestor = api_requestor.APIRequestor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\openai\api_requestor.py", line 85, in init
self.api_key = key or util.default_api_key()
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\openai\util.py", line 186, in default_api_key
raise openai.error.AuthenticationError(
openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface. See https://onboard.openai.com for details, or email [email protected] if you have any questions.

doesnt' react

I have an env file inside the folder with the session API token copied straight from the website dashboard (it has about 50 characters). I run in my terminal: python3 app.py 2>/dev/null

The app starts and says

OPENAI's text-davinci-003

AI Memories loaded

-- and then... nothing happens. Something is missing in the way I set it up.

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.