Create multion.py

pull/291/head
pliny 1 year ago committed by GitHub
parent 58c0ee1986
commit 9bd37af706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,37 @@
try:
import multion
except ImportError:
raise ImportError(
"Cannot import multion, please install 'pip install'"
)
from swarms.models.base_llm import AbstractLLM
class MultiOn(AbstractLLM):
"""
MultiOn is a wrapper for the Multion API.
Args:
**kwargs:
Methods:
run(self, task: str, url: str, *args, **kwargs)
Example:
>>> from swarms.models.multion import MultiOn
>>> multion = MultiOn()
>>> multion.run("Order chicken tendies", "https://www.google.com/")
"Order chicken tendies. https://www.google.com/"
"""
def __init__(self, **kwargs):
super(MultiOn, self).__init__(**kwargs)
def run(self, task: str, url: str, *args, **kwargs) -> str:
response = multion.new_session({"input": task, "url": url})
return response
def generate_summary(self, task: str, url: str, *args, **kwargs) -> str:
response = multion.new_session({"input": task, "url": url})
return response
Loading…
Cancel
Save