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/examples/utils/litellm_connect_issue.py

11 lines
282 B

from swarms.utils import LiteLLM, NetworkConnectionError
model = LiteLLM(model_name="gpt-4o-mini")
try:
response = model.run(task="Your task here")
print(response)
except NetworkConnectionError as e:
print(f"Network issue: {e}")
print("Trying to use local model")