qichang


Nameqichang JSON
Version 0.0.37 PyPI version JSON
download
home_pagehttps://github.com/QichangZheng/qichang.git
SummaryA Python library for interacting with various language model APIs
upload_time2024-03-30 07:03:51
maintainerNone
docs_urlNone
authorQichang Zheng
requires_python>=3.7
licenseApache License 2.0
keywords language models api client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # This is a personal library developed by Qichang Zheng.
## Installation
```bash
pip install qichang
```

## LLM Conversation
### For single conversation
```python
import qichang
llm = qichang.LLM_API()
llm.chat('GPT3.5', 'Hello, how are you?')
llm.chat('GPT4', 'Hello, how are you?')
```

### For multi-turn conversation
#### We currently have two servers in Virginia and Singapore. This function will automatically choose the server with the lowest latency, but you can also manually set the server.
```python
import qichang
llm = qichang.LLM_API()
# Manually set the server
# llm.server = 'Virginia'
# llm.server = 'Singapore'
# Here we need to specify the chatID (string) to distinguish different conversations
llm.chat('GPT3.5', 'Hello, how are you?', 'ChatID')
llm.chat('GPT4', 'What did I just asked?', 'ChatID')
```

## Model Downloader
#### This is a tool to download the huggingface models in China. Note that this function only works for some models, the author is working on further improvement.
```python
import qichang
downloader = qichang.Model_Downloader()
downloader.download('Qwen/Qwen-7B-Chat', 'test') # Download the model to the folder 'test'
```

## Davinci Embedding
### This is a tool to get the embedding of the text from the Davinci model.
```python
import os
import qichang

os.environ["OPENAI_API_KEY"] = "your_api_key"

Embedder = qichang.Embedder()
Embedder.embedding('Hello, how are you?')
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/QichangZheng/qichang.git",
    "name": "qichang",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "language models API client",
    "author": "Qichang Zheng",
    "author_email": "qichangzheng@uchicago.edu",
    "download_url": "https://files.pythonhosted.org/packages/0a/66/8926d1112f031e3ea8820f2f729519e6d20a1ce6da9eec0f5f551b2c469d/qichang-0.0.37.tar.gz",
    "platform": null,
    "description": "# This is a personal library developed by Qichang Zheng.\r\n## Installation\r\n```bash\r\npip install qichang\r\n```\r\n\r\n## LLM Conversation\r\n### For single conversation\r\n```python\r\nimport qichang\r\nllm = qichang.LLM_API()\r\nllm.chat('GPT3.5', 'Hello, how are you?')\r\nllm.chat('GPT4', 'Hello, how are you?')\r\n```\r\n\r\n### For multi-turn conversation\r\n#### We currently have two servers in Virginia and Singapore. This function will automatically choose the server with the lowest latency, but you can also manually set the server.\r\n```python\r\nimport qichang\r\nllm = qichang.LLM_API()\r\n# Manually set the server\r\n# llm.server = 'Virginia'\r\n# llm.server = 'Singapore'\r\n# Here we need to specify the chatID (string) to distinguish different conversations\r\nllm.chat('GPT3.5', 'Hello, how are you?', 'ChatID')\r\nllm.chat('GPT4', 'What did I just asked?', 'ChatID')\r\n```\r\n\r\n## Model Downloader\r\n#### This is a tool to download the huggingface models in China. Note that this function only works for some models, the author is working on further improvement.\r\n```python\r\nimport qichang\r\ndownloader = qichang.Model_Downloader()\r\ndownloader.download('Qwen/Qwen-7B-Chat', 'test') # Download the model to the folder 'test'\r\n```\r\n\r\n## Davinci Embedding\r\n### This is a tool to get the embedding of the text from the Davinci model.\r\n```python\r\nimport os\r\nimport qichang\r\n\r\nos.environ[\"OPENAI_API_KEY\"] = \"your_api_key\"\r\n\r\nEmbedder = qichang.Embedder()\r\nEmbedder.embedding('Hello, how are you?')\r\n```\r\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "A Python library for interacting with various language model APIs",
    "version": "0.0.37",
    "project_urls": {
        "Homepage": "https://github.com/QichangZheng/qichang.git"
    },
    "split_keywords": [
        "language",
        "models",
        "api",
        "client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6e0a4d9ae44dfbc1b010ca08b90b648725a21b7789b3954bc7b68eae304ecf57",
                "md5": "a49f4a9fef2274b390994ecb1e9bfc10",
                "sha256": "50084d1225d726d1716a45d3ae9c8e99ea73f5c950d91af5127cc3da3b20fb16"
            },
            "downloads": -1,
            "filename": "qichang-0.0.37-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a49f4a9fef2274b390994ecb1e9bfc10",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 9623,
            "upload_time": "2024-03-30T07:03:49",
            "upload_time_iso_8601": "2024-03-30T07:03:49.835674Z",
            "url": "https://files.pythonhosted.org/packages/6e/0a/4d9ae44dfbc1b010ca08b90b648725a21b7789b3954bc7b68eae304ecf57/qichang-0.0.37-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0a668926d1112f031e3ea8820f2f729519e6d20a1ce6da9eec0f5f551b2c469d",
                "md5": "c6e08110e7794c9cf9996de0bb6712ad",
                "sha256": "2a3521de7aa3916c65d849ede5e1c1b08b7c9ea5a56bc4d3649290f22c2cf2ef"
            },
            "downloads": -1,
            "filename": "qichang-0.0.37.tar.gz",
            "has_sig": false,
            "md5_digest": "c6e08110e7794c9cf9996de0bb6712ad",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 9006,
            "upload_time": "2024-03-30T07:03:51",
            "upload_time_iso_8601": "2024-03-30T07:03:51.755104Z",
            "url": "https://files.pythonhosted.org/packages/0a/66/8926d1112f031e3ea8820f2f729519e6d20a1ce6da9eec0f5f551b2c469d/qichang-0.0.37.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-30 07:03:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "QichangZheng",
    "github_project": "qichang",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "qichang"
}
        
Elapsed time: 0.21286s