An (unofficial) python native client for easy interaction with MiniMax Open Platform
Project description
MiniMax Python Client
An (unofficial) python native client for easy interaction with MiniMax Open Platform
The current implementation includes the following official API from MiniMax:
- ChatCompletion v2
Prerequisites
- Python >= 3.8
- pip
- An API KEY acquired from MiniMax Open Platform
Quick Start
Install the package
pip install minimax-client
Import the package and invoke the client
Sync call
from minimax_client import MiniMax
client = MiniMax(api_key="<YOUR_API_KEY>")
response = client.chat.completions.create(
messages=[
{
"role": "user",
"content": "1 + 1 equals: ",
}
]
)
print(response.choices[0].message.content)
Async call
import asyncio
from minimax_client import AsyncMiniMax
async def demo():
client = AsyncMiniMax(api_key="<YOUR_API_KEY>")
response = await client.chat.completions.create(
messages=[
{
"role": "user",
"content": "1 + 1 equals: ",
}
]
)
print(response.choices[0].message.content)
asyncio.run(demo())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for minimax_client-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 968ea145b2a37396951d51a42b337b9ba42c16f165a2a865521a5b0bcf3f294b |
|
MD5 | 08c62cc554ce99d339f2f08cd213b84d |
|
BLAKE2b-256 | 30c2017a7511561089ca30d1a6f186a7f20829da23cd4aeb588b66f89f8c3c02 |