agi-open-network-cn


Nameagi-open-network-cn JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/agiopennetwork/agi-open-network-cn
SummaryAGI Open Network China Models - A Simple and Powerful Framework for Chinese AI Models
upload_time2025-02-02 11:28:57
maintainerNone
docs_urlNone
authorAGI Open Network Team
requires_python>=3.7
licenseMIT License Copyright (c) 2024 AGI Open Network Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords agi ai machine learning deep learning nlp computer vision speech chinese models
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AGI Open Network China Models

A simple yet powerful framework for accessing Chinese AI models. Currently supports the full range of SiliconFlow models, with plans to support more Chinese AI service providers in the future.

## Features

- 🚀 Simple and intuitive API interface
- 🎯 Support for multiple model types (Chat, Text, Image, Audio, Video)
- 🔧 Flexible configuration options
- 📚 Comprehensive documentation and examples
- 🛠 Complete type hints

## Installation

```bash
pip install agi-open-network-cn
```

## Quick Start

### SiliconFlow Models

```python
from agi_open_network_cn import (
    SiliconFlowClient,
    SiliconFlowChatModel,
    SiliconFlowImageModel,
    SiliconFlowAudioModel,
)

# Initialize client
client = SiliconFlowClient(api_key="your-api-key")

# Use ChatGLM
chat_model = SiliconFlowChatModel(client, model_name="chatglm-turbo")
response = chat_model.simple_chat("Tell me about ChatGLM")
print(response)

# Use Stable Diffusion to generate images
image_model = SiliconFlowImageModel(client)
image_url = image_model.simple_generate("A cute Chinese dragon")
print(image_url)

# Speech to text
audio_model = SiliconFlowAudioModel(client)
text = audio_model.simple_transcribe("speech.mp3")
print(text)
```

## Supported Models and Features

### SiliconFlow

#### Chat Models
- ChatGLM Series
  - chatglm-turbo: General-purpose model with balanced performance
  - chatglm-pro: Professional version with enhanced capabilities
  - chatglm-std: Standard version with good cost-performance ratio
  - chatglm-lite: Lightweight version for faster responses
- Qwen Series
  - qwen-turbo: Qwen general version
  - qwen-plus: Qwen enhanced version
- GPT Series
  - gpt-3.5-turbo
  - gpt-4

#### Image Models
- Stable Diffusion Series
  - stable-diffusion-3-5-large-turbo: Latest version, faster generation
  - stable-diffusion-xl: Large model for higher quality
- FLUX Series
  - FLUX.1-schnell: High-performance image generation
  - Pro/black-forest-labs/FLUX.1-schnell: Professional version

#### Audio Features
- Speech to Text: Supports multiple languages and scenarios
- Text to Speech: High naturalness with emotional expression
- Custom Voice: Support for voice cloning

#### Video Features
- Text to Video: Supports various styles and scenarios
- Async Generation: Support for long video generation
- Auto Status Query: Convenient progress tracking

## Advanced Usage

### Custom Model Parameters

```python
# Using advanced parameters
response = chat_model.chat(
    messages=[
        {"role": "system", "content": "You are a professional Python teacher"},
        {"role": "user", "content": "Explain decorators"},
    ],
    temperature=0.7,
    max_tokens=2000,
    top_p=0.9,
)
```

### Batch Processing

```python
# Batch image generation
prompts = [
    "Chinese ink painting: Mountains and waters",
    "Chinese ink painting: Plum blossoms",
    "Chinese ink painting: Bamboo",
]

for prompt in prompts:
    image_url = image_model.simple_generate(prompt)
    print(f"{prompt}: {image_url}")
```

### Async Video Generation

```python
from agi_open_network_cn import SiliconFlowVideoModel

video_model = SiliconFlowVideoModel(client)
response = video_model.generate("A video showcasing Chinese traditional culture")
request_id = response["request_id"]

# Poll for results
while True:
    status = video_model.get_status(request_id)
    if status["status"] == "completed":
        print(f"Video URL: {status['url']}")
        break
    time.sleep(10)
```

## Error Handling

```python
from agi_open_network_cn.exceptions import AGIOpenNetworkError

try:
    response = chat_model.simple_chat("Hello")
except AGIOpenNetworkError as e:
    print(f"Error occurred: {e}")
```

## Contributing

We welcome all forms of contributions, including but not limited to:

- Submitting issues and suggestions
- Improving documentation
- Adding new features
- Fixing bugs
- Adding new model providers

## License

MIT License

## Contact Us

- Website: https://www.agiopen.network
- GitHub: https://github.com/agiopennetwork/agi-open-network-cn
- Email: info@agiopen.network 

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/agiopennetwork/agi-open-network-cn",
    "name": "agi-open-network-cn",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "agi, ai, machine learning, deep learning, nlp, computer vision, speech, chinese models",
    "author": "AGI Open Network Team",
    "author_email": "AGI Open Network Team <info@agiopen.network>",
    "download_url": "https://files.pythonhosted.org/packages/54/98/1dbc6ee9a06a9ba67ab03ce63e6016e120bdd3896c48d0f04a631936cb95/agi_open_network_cn-0.1.0.tar.gz",
    "platform": null,
    "description": "# AGI Open Network China Models\n\nA simple yet powerful framework for accessing Chinese AI models. Currently supports the full range of SiliconFlow models, with plans to support more Chinese AI service providers in the future.\n\n## Features\n\n- \ud83d\ude80 Simple and intuitive API interface\n- \ud83c\udfaf Support for multiple model types (Chat, Text, Image, Audio, Video)\n- \ud83d\udd27 Flexible configuration options\n- \ud83d\udcda Comprehensive documentation and examples\n- \ud83d\udee0 Complete type hints\n\n## Installation\n\n```bash\npip install agi-open-network-cn\n```\n\n## Quick Start\n\n### SiliconFlow Models\n\n```python\nfrom agi_open_network_cn import (\n    SiliconFlowClient,\n    SiliconFlowChatModel,\n    SiliconFlowImageModel,\n    SiliconFlowAudioModel,\n)\n\n# Initialize client\nclient = SiliconFlowClient(api_key=\"your-api-key\")\n\n# Use ChatGLM\nchat_model = SiliconFlowChatModel(client, model_name=\"chatglm-turbo\")\nresponse = chat_model.simple_chat(\"Tell me about ChatGLM\")\nprint(response)\n\n# Use Stable Diffusion to generate images\nimage_model = SiliconFlowImageModel(client)\nimage_url = image_model.simple_generate(\"A cute Chinese dragon\")\nprint(image_url)\n\n# Speech to text\naudio_model = SiliconFlowAudioModel(client)\ntext = audio_model.simple_transcribe(\"speech.mp3\")\nprint(text)\n```\n\n## Supported Models and Features\n\n### SiliconFlow\n\n#### Chat Models\n- ChatGLM Series\n  - chatglm-turbo: General-purpose model with balanced performance\n  - chatglm-pro: Professional version with enhanced capabilities\n  - chatglm-std: Standard version with good cost-performance ratio\n  - chatglm-lite: Lightweight version for faster responses\n- Qwen Series\n  - qwen-turbo: Qwen general version\n  - qwen-plus: Qwen enhanced version\n- GPT Series\n  - gpt-3.5-turbo\n  - gpt-4\n\n#### Image Models\n- Stable Diffusion Series\n  - stable-diffusion-3-5-large-turbo: Latest version, faster generation\n  - stable-diffusion-xl: Large model for higher quality\n- FLUX Series\n  - FLUX.1-schnell: High-performance image generation\n  - Pro/black-forest-labs/FLUX.1-schnell: Professional version\n\n#### Audio Features\n- Speech to Text: Supports multiple languages and scenarios\n- Text to Speech: High naturalness with emotional expression\n- Custom Voice: Support for voice cloning\n\n#### Video Features\n- Text to Video: Supports various styles and scenarios\n- Async Generation: Support for long video generation\n- Auto Status Query: Convenient progress tracking\n\n## Advanced Usage\n\n### Custom Model Parameters\n\n```python\n# Using advanced parameters\nresponse = chat_model.chat(\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are a professional Python teacher\"},\n        {\"role\": \"user\", \"content\": \"Explain decorators\"},\n    ],\n    temperature=0.7,\n    max_tokens=2000,\n    top_p=0.9,\n)\n```\n\n### Batch Processing\n\n```python\n# Batch image generation\nprompts = [\n    \"Chinese ink painting: Mountains and waters\",\n    \"Chinese ink painting: Plum blossoms\",\n    \"Chinese ink painting: Bamboo\",\n]\n\nfor prompt in prompts:\n    image_url = image_model.simple_generate(prompt)\n    print(f\"{prompt}: {image_url}\")\n```\n\n### Async Video Generation\n\n```python\nfrom agi_open_network_cn import SiliconFlowVideoModel\n\nvideo_model = SiliconFlowVideoModel(client)\nresponse = video_model.generate(\"A video showcasing Chinese traditional culture\")\nrequest_id = response[\"request_id\"]\n\n# Poll for results\nwhile True:\n    status = video_model.get_status(request_id)\n    if status[\"status\"] == \"completed\":\n        print(f\"Video URL: {status['url']}\")\n        break\n    time.sleep(10)\n```\n\n## Error Handling\n\n```python\nfrom agi_open_network_cn.exceptions import AGIOpenNetworkError\n\ntry:\n    response = chat_model.simple_chat(\"Hello\")\nexcept AGIOpenNetworkError as e:\n    print(f\"Error occurred: {e}\")\n```\n\n## Contributing\n\nWe welcome all forms of contributions, including but not limited to:\n\n- Submitting issues and suggestions\n- Improving documentation\n- Adding new features\n- Fixing bugs\n- Adding new model providers\n\n## License\n\nMIT License\n\n## Contact Us\n\n- Website: https://www.agiopen.network\n- GitHub: https://github.com/agiopennetwork/agi-open-network-cn\n- Email: info@agiopen.network \n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024 AGI Open Network Team\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE. ",
    "summary": "AGI Open Network China Models - A Simple and Powerful Framework for Chinese AI Models",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://www.agiopen.network",
        "Repository": "https://github.com/agiopennetwork/agi-open-network-cn"
    },
    "split_keywords": [
        "agi",
        " ai",
        " machine learning",
        " deep learning",
        " nlp",
        " computer vision",
        " speech",
        " chinese models"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6a633abb7d4d232f02849f1894d6796d93eef99659fcbb210d4a78f53ac4fe11",
                "md5": "deb6bd5c05307cfc0b147eedea8541b1",
                "sha256": "5ac1137f6ef65650e8e6426750141b35d5523bbc5957b1cf73f2816a6bb79902"
            },
            "downloads": -1,
            "filename": "agi_open_network_cn-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "deb6bd5c05307cfc0b147eedea8541b1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8380,
            "upload_time": "2025-02-02T11:28:55",
            "upload_time_iso_8601": "2025-02-02T11:28:55.527227Z",
            "url": "https://files.pythonhosted.org/packages/6a/63/3abb7d4d232f02849f1894d6796d93eef99659fcbb210d4a78f53ac4fe11/agi_open_network_cn-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "54981dbc6ee9a06a9ba67ab03ce63e6016e120bdd3896c48d0f04a631936cb95",
                "md5": "2198dd77a8dc18691b4818456f37723a",
                "sha256": "60cd61ebe23b402d533098c903fc466bb37c2d346c8cbb4f37ce887f85683a83"
            },
            "downloads": -1,
            "filename": "agi_open_network_cn-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2198dd77a8dc18691b4818456f37723a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6885,
            "upload_time": "2025-02-02T11:28:57",
            "upload_time_iso_8601": "2025-02-02T11:28:57.577405Z",
            "url": "https://files.pythonhosted.org/packages/54/98/1dbc6ee9a06a9ba67ab03ce63e6016e120bdd3896c48d0f04a631936cb95/agi_open_network_cn-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-02 11:28:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "agiopennetwork",
    "github_project": "agi-open-network-cn",
    "github_not_found": true,
    "lcname": "agi-open-network-cn"
}
        
Elapsed time: 0.37549s