@wolf71 said in Tiny OpenAI ChatGPT and Whisper API for Pythonista:
tinyOpenAI for Pythonista Github
Features OpenAI ChatGPT and Whisper API library written in pure Python, so it can run in Python environment on M1/M2 Mac, iPad/iPhone(e.g. Pythonista, Juno, CODE, Pyto, ...), Android. Supports methods that conform to the ChatGPT API JSON format for API calls. Provides an easy-to-use quick dialog method, support for contextual associations; and easy language translation method. Support for Whisper interface calls to recognize and parse uploaded audio files as text messages or translate them into English. Install method 1: pip open StaSh, and then pip install tinyOpenAI method 2: Copy code open tinyOpenAI Github ,and found tinyOpenAI.py, select all code, and copy to pythonista, run it. example for ChatGPT import tinyOpenAI g = tinyOpenAI.ChatGPT('your OpenAI API_Key') # g = tinyOpenAI.ChatGPT('your OpenAI API_Key','http://192.168.3.2:3128', Model='gpt-3.5-turbo-0301',Debug=True) # Conversation print( g.query('Write a rhyming poem with the sea as the title', system='You are a master of art, answer questions with emoji icons') ) # Continuous dialogue print('======== continuous dialogue ============') print(g.query('charles has $500, tom has $300, how much money do they have in total', True, 6)) print(g.query('charles and Tom who has more money', True, 6)) print(g.query('Sort them in order of money', True, 6)) # print history print(g.Hinfo) # clear Histroy g.cHinfo() # Statistics print('Call cnt: %d, Total using tokens: %d' % (g.Call_cnt, g.Total_tokens) ) example for Whisper import tinyOpenAI w = tinyOpenAI.Whisper('your OpenAI API_Key', Debug=True) print(w.call('test1.m4a')) # or mp3/mp4 file print(w.call('test2.m4a', 1)) # or mp3/mp4 file print('Call cnt: %d, Total Texts: %d' % (w.Call_cnt, w.Total_tokens) )
I tried doing that and I found that with superior intelligence ChatGPT is doing much better, this is my personal opinion