Package: dict-tiny
Dict-tinyA command-line tool that integrates Youdao Dict, Google Translate,DeepL Translator, Gemini and OpenAI.Just for fun :)InstallationYou can installdict-tinyvia pip. (>=Python 3.9)$pipinstalldict-tinyUpgrading$pipinstall--upgradedict-tinyUsageYoudao DictAdd-y/--youdaoto use Youdao Dict:$dict-tiny-ybook>>>YoudaoDict<<<book======英[bʊk]美[bʊk]n.书，书籍；本子，簿册；（长篇作品的）篇，卷，部；装订成册之物；赌局，打赌；账册，账簿v.预订，预约；（警方）将……记录在案；（裁判）记名警告【名】（Book）（英）布克，（瑞典）博克，（朝）北（人名）$dict-tiny-y书>>>YoudaoDict<<<书===[shū]n.book;letter;scriptvt.writeUse-m/--moreto get more detail translation for the word:$dict-tiny-y曾经-m>>>YoudaoDict<<<曾经====[céngjīng]adv.once;evermoredetail:========副词========1:（表示有过某些行为或情况）once:HeoncelivedinShanghai.他曾经在上海住过。Shehastakenpartinamajorbattleforoil.她曾经参加过石油大会战。$dict-tiny-ydictionary-m>>>YoudaoDict<<<dictionary============英[ˈdɪkʃən(ə)ri]美[ˈdɪkʃəneri]n.字典，词典；专业词典，术语大全；电子词典；双语词典moredetail(collins):========N-COUNT可数名词========·词典Adictionaryisabookinwhichthewordsandphrasesofalanguagearelistedalphabetically,togetherwiththeirmeaningsortheirtranslationsinanotherlanguage.例:...aSpanish-Englishdictionary.…一本西班牙语—英语词典。Note:Some words have a lot of translation that may occupy the entire screen.Only supports English or Chinese words currently.Google TranslateAdd-g/--googleto use Google Translate:$dict-tiny-gbook>>>GoogleTranslate<<<book======output:书detectedlanguage:enAdd--target-languageto specify the language to translate results into：$dict-tiny-goperationsystem--target-languageja>>>GoogleTranslate<<<operationsystem==================output:オペレーションシステムdetectedlanguage:enAdd--source-languageto specify the language of the text to be translated, but in most cases you don't need to do this because the google translate api automatically detects the source language type.And if you give a wrong source language, the translation result may not be what you expect.So, of course, you can add--detect-languageto detect the language type:$dict-tiny-g--detect-languageespañol>>>GoogleTranslate<<<español=========confidence:0.49805447459220886input:españollanguage:esname:SpanishNote:Make sure Google services are available in your network environment.The source and target languages for Google Translate are identified using theiso-639-1codes.$dict-tiny-gbook--target-languagezh--source-languageen>>>GoogleTranslate<<<book======output:书sourcelanguage:enYou can also enter the ISO language name:$dict-tiny-gbook--target-languageGerman--source-languageEnglish>>>GoogleTranslate<<<book======output:Buchsourcelanguage:EnglishSet the environment variable$DICT_TINY_TARGET_LANso that you do not have to manually specify the target language each time. if you specify the target language parameter on the command line with--target-language, the setting in the environment variable will be overwritten.The defaulttarget-languagefor Goole Translate areEnglish.DeepL TranslateFor some reason I am no longer allowed to use deepl pro, so deepl is no longer supported.GeminiAdd--geminito use Gemini.Use--gemini-modelto specify the model used by Gemini. You can also set the environment variable$DICT_TINY_GEMINI_MODEL. The default model isgemini-pro.Use--gemini-keyto specify the Gemini api key, or set the environment variable$DICT_TINY_GEMINI_API_KEY.Note:If you usegemini-pro-visionmodel, you need to use--img-pathto specify the path of image.Use--max-output-tokensto specify the maximum output token.Use--temperatureto specify the temperature.OpenAIAdd--openaito use OpenAI.Use--openai-modelto specify the model used by OpenAI. You can also set the environment variable$DICT_TINY_OPENAI_MODEL. The default model isgpt-3.5-turbo.Use--openai-keyto specify the OpenAI api key, or set the environment variable$DICT_TINY_OPENAI_API_KEY.$dict-tiny--openaiwhoareyou?>>>OpenAI-gpt-3.5-turbo<<<IamanAIlanguagemodelcreatedbyOpenAI.Icanassistyouwithvarioustasks,answerquestions,andengageinconversationsonawiderangeoftopics.HowmayIassistyoutoday?Note:Currently only text generation models are supported.Use--max-output-tokensto specify the maximum output token.Use--temperatureto specify the temperature.Interactive modeEach of the above functions can be entered into its interactive mode by adding the-i.Control + dto exit interactive mode.In interactive mode you can:Use above features in a continuous interactive manner.PressTabkey for word auto-completion (using Youdao's auto-completion function, currently only supports Chinese, English, French, Korean, Japanese)For Gemini and OpenAI, the dialog context is maintained in interactive mode, use--dialog-turnsto specify the number of dialog turns to maintain, the default is 10.All settings cannot be changed after entering interactive mode, such as target-language, model, img-path, temperature, etc., unless you exit to change the settings and re-enter.OtherDefault behaviorYoudao Dict is the default translator, which means Youdao Dict will be used when no translator is specified.$dict-tiny机器学习>>>YoudaoDict<<<机器学习======machinelearningYou can use the environment variable$DICT_TINY_DEFAULT_TRANSto set the default translator. There are four options described above:YoudaoDict,GoogleTranslate,Gemini,OpenAI.  Case insensitive.For Youdao Dict and Google translate, if the target language is not specified, Chinese and English will be used as the target language for each other.In non-interactive mode, multiple translators can be specified at the same time, for example, YoudaoDict and GoogleTranslate can be used at the same time.$dict-tinyformulation-y-g>>>YoudaoDict<<<formulation=============英[ˌfɔːmjuˈleɪʃ(ə)n]美[ˌfɔːrmjuˈleɪʃ(ə)n]n.（政策、计划等的）制定，构想；（想法的）阐述方式，表达方法；（药品或化妆品的）配方，配方产品>>>GoogleTranslate<<<formulation=============output:公式detectedlanguage:enUse clipboard contentUse-c/--clipboardto use the contents of the clipboard:$dict-tiny-c-y>>>YoudaoDict<<<encounter===========英[ɪnˈkaʊntə(r)]美[ɪnˈkaʊntər]v.遭遇；偶遇，邂逅n.偶遇，邂逅；经历，体验；冲突；比赛，交锋Note:-c/--clipboardhas low priority. If you add-cand a word at the same time, the switch-cwill be ignored.LicenseMIT