增加本地 call llm
This commit is contained in:
@@ -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")
|
||||
Reference in New Issue
Block a user