Package: blin
BlinBlin helps to build a lucid interface between users and your system. It empowers the system with intelligence to recognize user intentions, provide information or control functionality via commands!Key FeaturesPrompt to commands: understands user intentions from a text prompt and returns the best fitting commandsMulti-request: returns multiple commands if user's intention is to perform several tasks simultaneously (e.g., increase temperature and decrease volume)Valid command guarantee: always returns a valid command with valid parametersAdditional knowledge: ability to add texts that are used to provide additional context or guidance for the userInfinite memory (almost): as long as there's space in cloud, there's room for learningUsage is simplemy_ai=blin.open_project('MyAI',key=blin_key)response=my_ai.request("I'm hot")>>> response
{
    'commands': {'decrease_temperature': {'parameters': {'delta': 5}}}, 
    'text': "I've decreased the temperature by 5 degrees Fahrenheit."
}response=my_ai.request("My ears are bleeding from this music")>>> response
{
    'commands': {'audio_adjust_volume': {'parameters': {'delta': -10}}}, 
    'text': "I'm sorry to hear that. I've adjusted the volume for you."
}Getting startedInstall blin:pip install blinCreate your AI:blin_key="<blin_key>"# contact us: support@lemeni.com to get onesettings={"openai_key":"<openai_key>",# get your key @ https://openai.com/"pinecone_key":"<pinecone_key>",# get your key @ https://www.pinecone.io/"pinecone_index":"<pinecone_index>"}# create your index @ https://www.pinecone.io/blin.create_project('MyAI',settings=settings,key=blin_key)Define commands to control the system:commands={"increase_temperature":{"brief":"Increases temperature per user's request or when it's too low","parameters":{"delta":"integer value from interval [1, 10] that represents temperature increase in Fahrenheit"}},"decrease_temperature":{"brief":"Decreases temperature per user's request or when it's too high","parameters":{"delta":"integer value from interval [1, 10] that represents temperature decrease in Fahrenheit"}},"adjust_volume":{"brief":"Makes volume adjustment","parameters":{"delta":"integer value from interval [-10, 10] that represents volume adjustment in %"}},}Train your AI:my_ai=blin.open_project('MyAI',blin_key)my_ai.learn_commands(commands)Use it:my_ai=blin.open_project('MyAI',blin_key)command=my_ai.request("I'm hot")call(command)# your function to execute commandsAPI DocumentationCreate projectCreate project. All learned commands/texts will be stored in itblin.create_project(project_id,settings,key)project_id (str) : name of the projectsettings (dict)  : project settings dict in the format:
{
"openai_key"    : "...",
"pinecone_key"  : "...",
"pinecone_index": "...",
}key (str) : blin authorization keyreturns:str: result. Raises exception if the project was already created.Open projectOpen created project for learning or usageproject=blin.open_project(project_id,key)project_id (str)  : project identifierkey (str)         : blin authorization keyreturns:Project objectDelete ProjectRemove project. Warning: all knowledge (commands and texts) associated will be removed, and cannot be restored!blin.delete_project(project_id,key)project_id (str)    : project identifierkey (str)      : blin authorization keyreturns:str: result. Raises exception if the project was not deleted.Learn CommandsAdd commands to the projectproject.learn_commands(commands)commands (dict) : commands dict to learn, in the format belowreturns:None# Commands dict formatcommands={"command_name_1":{"brief":"string description of command purpose","parameters":{"parameter_name":"string description of parameter purpose, type, range",...},"command_name_2":...}Learn TextsAdd texts to the project. This information is used by AI as additional context or to provide guidance for the userproject.learn_texts(texts):texts (dict)   : texts to learn in the format: { "text_name"  : "text", ... }returns:NoneRecall Command NamesReturn a list of names of all learned commandsproject.recall_command_names()returns:list: names of all learned commandsRecall Text NamesReturn a list of names of all learned textsproject.recall_text_names()returns:list: names of all learned textsRecall Command or TextReturn learned command or text for given nameproject.recall(name)name (str) : command or text namereturns:dict: learned command or text (seeLearn Commands,Learn Texts)Forget Command or TextDelete the knowledge (command of text)project.forget(name)name (str) : command or text namereturns:str: result. Raises exception if the knowledge was not deleted.Request AI AnswerReturn command to execute or/and text response based on user request and project knowledgeproject.request(request)request (str)  : user requestreturns:dict: commands to execute (can be {}) and text response (can be "") in the format below{"commands":<commands_dict>,"text":"text response"}ContactsFor any questions or feedback, you can reach us atsupport@lemeni.com.