You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/playground/examples/example_anthropic.py

16 lines
408 B

# Import necessary modules and classes
from swarms.models import Anthropic
# Initialize an instance of the Anthropic class
model = Anthropic(anthropic_api_key="")
# Using the run method
# completion_1 = model.run("What is the capital of France?")
# print(completion_1)
# Using the __call__ method
completion_2 = model(
"How far is the moon from the earth?", stop=["miles", "km"]
)
print(completion_2)