blob: 79cd5bdca3e63370631d496532d54520453f2d66 [file] [log] [blame]
import hamilton_anthropic
from hamilton import driver
anthropic_driver = (
driver.Builder().with_modules(hamilton_anthropic).with_config({"provider": "anthropic"}).build()
)
openai_driver = (
driver.Builder().with_modules(hamilton_anthropic).with_config({"provider": "openai"}).build()
)
try:
print(anthropic_driver.execute(["joke_response"], inputs={"topic": "ice cream"}))
except Exception:
# this is the current way to do fall backs
print(openai_driver.execute(["joke_response"], inputs={"topic": "ice cream"}))