如何用智增增API使用Claude官方SDK

使用Claude官方SDK

from anthropic import Anthropic

if __name__ == '__main__':
    client = Anthropic(
      base_url='https://api.zhizengzeng.com/anthropic',
      api_key='sk-xxxxxxxxxx',
    )

    message = client.messages.create(
        max_tokens=1024,
        messages=[
            {
                "role": "user",
                "content": "Hello, Claude",
            }
        ],
        model="claude-3-7-sonnet-20250219",
    )
    print(message.content)
© 版权声明

相关文章

暂无评论

暂无评论...