uranuspy


Nameuranuspy JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/ManaAI/uranuspy
Summaryuranuspy is the python SDK in Tianmu client
upload_time2024-03-12 13:41:25
maintainer
docs_urlNone
authorStrange AI
requires_python
licenseGPL-3.0
keywords ai bot llm chatbot chatting
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # F.R.I.D.A.Y

the next generation artificial intelligence bot after Jarvis. in this vision, some improvements were made:

- More robust;
- Connect to _uranus_;
- Mission support, I can add missions to Friday;
- Learnable, Friday supports learning new things with mental;
- More..

Friday based on `uranuspy`.

You can register a robot account on `http://g.manaai.cn`, then you can use the bot user name and password to connect uranuspy:

```py
from uranuspy.im.models import ChatMessage, ContactChat, User
from uranuspy.im.client import ChatClient


client = ChatClient("bot", "xxx")


def hanlde_txt_msg(
    msg: ChatMessage, contact: ContactChat, myself: User, client: ChatClient
):
    """
    Main logic to process the received message
    """
    print(f"Received chat message: {msg} {myself}")
    talk_to = msg.fromId
    from_talk = msg.text

    print(myself.user_nick_name, from_talk, msg.text)
    if from_talk != None:
        if contact.isGroup:
            if f"@{myself.user_nick_name}" in from_talk:
                return "我在呢~", myself
        else:
            return "测试消息,这是echo测试", myself


@client.on_txt_msg
def on_txt_msg(
    msg: ChatMessage, contact: ContactChat, myself: User, client: ChatClient
):
    return hanlde_txt_msg(msg, contact, myself, client)


if __name__ == "__main__":
    client.run_forever()


```

## Updates

- **2021.11.14**: Add new Siren client support, it now can be connected with Siren client;

## Requirements

For ubuntu setup simply:

```
pip install -r requirements.txt
```

If on windows, for some package might not easy to install, like PyAduio, it can be installed via `pipwin`:

```
pip install pipwin
pipwin install pyaudio
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ManaAI/uranuspy",
    "name": "uranuspy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "AI Bot,LLM,chatbot,chatting",
    "author": "Strange AI",
    "author_email": "strangeai2019@163.com",
    "download_url": "https://files.pythonhosted.org/packages/91/20/9a8441edcc7176fd5939e2f637874465cc1057994f25e79acf39e0733cce/uranuspy-0.0.4.tar.gz",
    "platform": "any",
    "description": "# F.R.I.D.A.Y\n\nthe next generation artificial intelligence bot after Jarvis. in this vision, some improvements were made:\n\n- More robust;\n- Connect to _uranus_;\n- Mission support, I can add missions to Friday;\n- Learnable, Friday supports learning new things with mental;\n- More..\n\nFriday based on `uranuspy`.\n\nYou can register a robot account on `http://g.manaai.cn`, then you can use the bot user name and password to connect uranuspy:\n\n```py\nfrom uranuspy.im.models import ChatMessage, ContactChat, User\nfrom uranuspy.im.client import ChatClient\n\n\nclient = ChatClient(\"bot\", \"xxx\")\n\n\ndef hanlde_txt_msg(\n    msg: ChatMessage, contact: ContactChat, myself: User, client: ChatClient\n):\n    \"\"\"\n    Main logic to process the received message\n    \"\"\"\n    print(f\"Received chat message: {msg} {myself}\")\n    talk_to = msg.fromId\n    from_talk = msg.text\n\n    print(myself.user_nick_name, from_talk, msg.text)\n    if from_talk != None:\n        if contact.isGroup:\n            if f\"@{myself.user_nick_name}\" in from_talk:\n                return \"\u6211\u5728\u5462\uff5e\", myself\n        else:\n            return \"\u6d4b\u8bd5\u6d88\u606f\uff0c\u8fd9\u662fecho\u6d4b\u8bd5\", myself\n\n\n@client.on_txt_msg\ndef on_txt_msg(\n    msg: ChatMessage, contact: ContactChat, myself: User, client: ChatClient\n):\n    return hanlde_txt_msg(msg, contact, myself, client)\n\n\nif __name__ == \"__main__\":\n    client.run_forever()\n\n\n```\n\n## Updates\n\n- **2021.11.14**: Add new Siren client support, it now can be connected with Siren client;\n\n## Requirements\n\nFor ubuntu setup simply:\n\n```\npip install -r requirements.txt\n```\n\nIf on windows, for some package might not easy to install, like PyAduio, it can be installed via `pipwin`:\n\n```\npip install pipwin\npipwin install pyaudio\n```\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "uranuspy is the python SDK in Tianmu client",
    "version": "0.0.4",
    "project_urls": {
        "Homepage": "https://github.com/ManaAI/uranuspy"
    },
    "split_keywords": [
        "ai bot",
        "llm",
        "chatbot",
        "chatting"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91209a8441edcc7176fd5939e2f637874465cc1057994f25e79acf39e0733cce",
                "md5": "c206b1fbf69e58593453bb77f284bc53",
                "sha256": "7e4a6ff10c9a547877826077fe69cb1a3083dab9a646792c2df92683e54903d3"
            },
            "downloads": -1,
            "filename": "uranuspy-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "c206b1fbf69e58593453bb77f284bc53",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 29699,
            "upload_time": "2024-03-12T13:41:25",
            "upload_time_iso_8601": "2024-03-12T13:41:25.831245Z",
            "url": "https://files.pythonhosted.org/packages/91/20/9a8441edcc7176fd5939e2f637874465cc1057994f25e79acf39e0733cce/uranuspy-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-12 13:41:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ManaAI",
    "github_project": "uranuspy",
    "github_not_found": true,
    "lcname": "uranuspy"
}
        
Elapsed time: 0.28891s