uranuspy


Nameuranuspy JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://github.com/ManaAI/uranuspy
Summaryuranuspy is the python SDK in Tianmu client
upload_time2024-09-22 01:55:01
maintainerNone
docs_urlNone
authorStrange AI
requires_pythonNone
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": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "AI Bot, LLM, chatbot, chatting",
    "author": "Strange AI",
    "author_email": "strangeai2019@163.com",
    "download_url": "https://files.pythonhosted.org/packages/26/d6/bb66315d74614db42580ac3e569b43f82905da8c93b8198da2febfc13e31/uranuspy-0.0.7.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.7",
    "project_urls": {
        "Homepage": "https://github.com/ManaAI/uranuspy"
    },
    "split_keywords": [
        "ai bot",
        " llm",
        " chatbot",
        " chatting"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "26d6bb66315d74614db42580ac3e569b43f82905da8c93b8198da2febfc13e31",
                "md5": "8d21d73f96303001a1b090a28b279dbf",
                "sha256": "a7b05721cd80c58e6bbfd81a759ad133ff31753034c27da3b4f47a1987826c01"
            },
            "downloads": -1,
            "filename": "uranuspy-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "8d21d73f96303001a1b090a28b279dbf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 29886,
            "upload_time": "2024-09-22T01:55:01",
            "upload_time_iso_8601": "2024-09-22T01:55:01.162012Z",
            "url": "https://files.pythonhosted.org/packages/26/d6/bb66315d74614db42580ac3e569b43f82905da8c93b8198da2febfc13e31/uranuspy-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-22 01:55:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ManaAI",
    "github_project": "uranuspy",
    "github_not_found": true,
    "lcname": "uranuspy"
}
        
Elapsed time: 0.78485s