From 9bd37af7060368519a6331ed307b93af9a5ffab5 Mon Sep 17 00:00:00 2001 From: pliny <133052465+elder-plinius@users.noreply.github.com> Date: Mon, 11 Dec 2023 11:05:30 -0800 Subject: [PATCH] Create multion.py --- swarms/models/multion.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 swarms/models/multion.py diff --git a/swarms/models/multion.py b/swarms/models/multion.py new file mode 100644 index 00000000..93184961 --- /dev/null +++ b/swarms/models/multion.py @@ -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