Files
F6--/张阳脚本/minimax调用.ipynb
T
2026-04-09 10:19:09 +08:00

57 lines
1.2 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "initial_id",
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import anthropic\n",
"\n",
"client = anthropic.Anthropic()\n",
"\n",
"message = client.messages.create(\n",
" model=\"MiniMax-M2.5\", # 切换为其他模型,如 MiniMax-M2.1\n",
" max_tokens=1000,\n",
" system=\"You are a helpful assistant.\",\n",
" messages=[\n",
" {\n",
" \"role\": \"user\",\n",
" \"content\": [\n",
" {\n",
" \"type\": \"text\",\n",
" \"text\": \"Hi, how are you?\"\n",
" }\n",
" ]\n",
" }\n",
" ]\n",
")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}