{ "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 }