Package: anysolve
anysolveis a library for executingAnySolve.aitasks. It needs anAPI-Keythat can be
created in the settings of an anysolve.ai account. The settings can be
found athttps://www.anysolve.ai/settings.Pleasenotethat the execution of anAnySolve.aitask may be chargeable.InstallationYou can install this library by using pip. The library is designed to
use only requests as dependency.Supported Python VersionsPython >= 3.6Mac/Linuxpip3 install anysolveWindowspip.exe install anysolveCreate an access tokenYou can create an access token athttps://www.anysolve.ai/settings/personal-access-tokensExample UsageTranslation of a text (free)The following code uses the translation API for text (free):fromanysolveimportAnySolveclient=AnySolve("your_api_key")result=client.run("intern-translation-free","1.0.0",{"source_language":"de","text":"Das ist ein rotes Haus.","target_language":"en",},)print(result)https://www.anysolve.ai/tasks/u-ba835df8268fc301-translates-a-textIntroduction from TextThe following code creates an introduction from a text:importosfromanysolveimportAnySolveanysolve_token=os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN')# Resolve your personal access token hereclient=AnySolve(anysolve_token)res=client.run('create-introduction','1.0.1',{'text':'As a swan person I like to go to lakes','context':'You are a creative writer.'})print(res)https://www.anysolve.ai/tasks/create-introductionCreate Newspaper Headline from TextThe following creates a newspaper headline by a text:importosfromanysolveimportAnySolveanysolve_token=os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN')# Resolve your personal access token hereclient=AnySolve(anysolve_token)res=client.run('create-newspaper-headline','1.0.0',{'text':'A group of police...','lang':'English','context':'You are a boulevard journalist.'})print(res)https://www.anysolve.ai/tasks/create-newspaper-headlineExplain CodeThe following code explains a code:importosfromanysolveimportAnySolveanysolve_token=os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN')# Resolve your personal access token hereclient=AnySolve(anysolve_token)res=client.run('explain-code','1.0.0',{'code':'print(\'hello world\')'})print(res)https://www.anysolve.ai/tasks/explain-codeGoogle SearchThe following code does a google search:importosfromanysolveimportAnySolveanysolve_token=os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN')# Resolve your personal access token hereclient=AnySolve(anysolve_token)res=client.run('intern-web-google-search','1.0.0',{'search_query':'AnySolve.ai','location':'us','language':'lang_en','max_results':'5'})print(res)https://www.anysolve.ai/tasks/intern-web-google-searchGenerate SEO KeywordsThe following code generates SEO keywords:importosfromanysolveimportAnySolveanysolve_token=os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN')# Resolve your personal access token hereclient=AnySolve(anysolve_token)res=client.run('u-ba835df8268fc301-seo-keyword','1.0.0',{'topic':'A plattform saas platform targeted to AI tasks'})print(res)https://www.anysolve.ai/tasks/u-ba835df8268fc301-seo-keywordRewrite Text Tone to Be PoliteThe following code creates rewrites the text to be polite:importosfromanysolveimportAnySolveanysolve_token=os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN')# Resolve your personal access token hereclient=AnySolve(anysolve_token)res=client.run('u-ba835df8268fc301-rewrite-text-tone-to-be-polite','1.0.0',{'text':'I want you to quit an join my business'})print(res)https://www.anysolve.ai/tasks/u-ba835df8268fc301-rewrite-text-tone-to-be-politeGenerate Alternative TitlesThe following code generates alternatives to a title:importosfromanysolveimportAnySolveanysolve_token=os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN')# Resolve your personal access token hereclient=AnySolve(anysolve_token)res=client.run('u-ba835df8268fc301-generate-alternative-titles','1.0.0',{'title':'AnySolve.ai - An AI community hub','field_of_use':'Blog post'})print(res)https://www.anysolve.ai/tasks/u-ba835df8268fc301-generate-alternative-titlesCreate Regex by DescriptionThe following code creates a regex by a description:importosfromanysolveimportAnySolveanysolve_token=os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN')# Resolve your personal access token hereclient=AnySolve(anysolve_token)res=client.run('u-ba835df8268fc301-create-regex-by-description','1.0.0',{'requirement':'allow up to 3 chars and numbers and then *','type':'PCRE'})print(res)https://www.anysolve.ai/tasks/u-ba835df8268fc301-create-regex-by-descriptionAnswer Yes/No Question about TextThe following code answers a yes / no question:importosfromanysolveimportAnySolveanysolve_token=os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN')# Resolve your personal access token hereclient=AnySolve(anysolve_token)res=client.run('u-ba835df8268fc301-answer-yesno-question-about-text','1.0.0',{'text':'It is a hot day. Maria is on her way to the lake. She will meet her friends there.','question':'Is the main character of the text female?'})print(res)https://www.anysolve.ai/tasks/u-ba835df8268fc301-answer-yesno-question-about-textAnswer Question about TextThe following code answers a question about a text:importosfromanysolveimportAnySolveanysolve_token=os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN')# Resolve your personal access token hereclient=AnySolve(anysolve_token)res=client.run('u-ba835df8268fc301-answer-question-about-text','1.0.0',{'question':'What is the name of the main character?','text':'It is a hot day. Maria is on her way to the lake. She will meet her friends there.'})print(res)https://www.anysolve.ai/tasks/u-ba835df8268fc301-answer-question-about-textTransform Style & ToneThe following code changes the style & tone of a text:importosfromanysolveimportAnySolveanysolve_token=os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN')# Resolve your personal access token hereclient=AnySolve(anysolve_token)res=client.run('u-806494eb1fbfb39f-transform-style--tone','1.0.0',{'style':'Persuasive','tone':'Formal','text':'I want you to quit an join my business'})print(res)https://www.anysolve.ai/tasks/u-806494eb1fbfb39f-transform-style–toneText CompressionThe following code makes a text smaller without loosing too much
information:importosfromanysolveimportAnySolveanysolve_token=os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN')# Resolve your personal access token hereclient=AnySolve(anysolve_token)res=client.run('u-806494eb1fbfb39f-text-compression','1.0.0',{'text':'Enter text to compress'})print(res)https://www.anysolve.ai/tasks/u-806494eb1fbfb39f-text-compressionPricingPlease go tohttps://www.anysolve.ai/pricingand study the specific
tasks for prices. You may get free credits on registration and some
tasks are free.