增加本地 call llm

This commit is contained in:
jack
2026-04-20 11:14:19 +08:00
parent 8cb1e50539
commit 2293700959
2 changed files with 169 additions and 9 deletions
+20
View File
@@ -0,0 +1,20 @@
import anthropic
client = anthropic.Anthropic(
api_key="sk-cp-l_as8mjqPhsOIny9IFKZ8jzA92z1c0eRwchldhEf4KzQjs9cjVknV2o7VNCcvYUXsXFq7uF4aSgp2RxxmUHLXwPGKgIvzedM70_XUIXiBB3gu_UmLDQLfh4",
base_url="https://api.minimaxi.com/anthropic"
)
message = client.messages.create(
model="MiniMax-M2.7",
max_tokens=1000,
system="You are a helpful assistant.",
messages=[{"role": "user", "content": [{"type": "text", "text": "Hi, how are you?"}]}]
)
for block in message.content:
if block.type == "thinking":
print(f"Thinking:\n{block.thinking}\n")
elif block.type == "text":
print(f"Text:\n{block.text}\n")