mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-17 10:13:29 +00:00
Improve MultiOn client toolkit prompts (#9222)
- Updated prompts for the MultiOn toolkit for better functionality - Non-blocking but good to have it merged to improve the overall performance for the toolkit @hinthornw @hwchase17 --------- Co-authored-by: Naman Garg <ngarg3@binghamton.edu>
This commit is contained in:
parent
969e1683de
commit
9529483c2a
@ -40,9 +40,14 @@ class MultionCreateSession(BaseTool):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
name: str = "create_multion_session"
|
name: str = "create_multion_session"
|
||||||
description: str = """Use this tool to create a new Multion Browser Window \
|
description: str = """
|
||||||
with provided fields.Always the first step to run \
|
Create a new web browsing session based on a user's command or request. \
|
||||||
any activities that can be done using browser."""
|
The command should include the full info required for the session. \
|
||||||
|
Also include an url (defaults to google.com if no better option) \
|
||||||
|
to start the session. \
|
||||||
|
Use this tool to create a new Browser Window with provided fields. \
|
||||||
|
Always the first step to run any activities that can be done using browser.
|
||||||
|
"""
|
||||||
args_schema: Type[CreateSessionSchema] = CreateSessionSchema
|
args_schema: Type[CreateSessionSchema] = CreateSessionSchema
|
||||||
|
|
||||||
def _run(
|
def _run(
|
||||||
|
@ -44,10 +44,10 @@ class MultionUpdateSession(BaseTool):
|
|||||||
|
|
||||||
name: str = "update_multion_session"
|
name: str = "update_multion_session"
|
||||||
description: str = """Use this tool to update \
|
description: str = """Use this tool to update \
|
||||||
a existing corresponding \
|
an existing corresponding Multion Browser Window with provided fields. \
|
||||||
Multion Browser Window with provided fields. \
|
Note: TabId must be received from previous Browser window creation."""
|
||||||
Note:TabId is got from one of the previous Browser window creation."""
|
|
||||||
args_schema: Type[UpdateSessionSchema] = UpdateSessionSchema
|
args_schema: Type[UpdateSessionSchema] = UpdateSessionSchema
|
||||||
|
tabId: str = ""
|
||||||
|
|
||||||
def _run(
|
def _run(
|
||||||
self,
|
self,
|
||||||
@ -63,9 +63,10 @@ class MultionUpdateSession(BaseTool):
|
|||||||
self.tabId = tabId
|
self.tabId = tabId
|
||||||
return content
|
return content
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"{e}, creating a new session")
|
print(f"{e}, retrying...")
|
||||||
response = multion.new_session({"input": query, "url": url})
|
return {"error": f"{e}", "Response": "retrying..."}
|
||||||
self.tabID = response["tabId"]
|
# response = multion.new_session({"input": query, "url": url})
|
||||||
return {"tabId": response["tabId"], "Response": response["message"]}
|
# self.tabID = response["tabId"]
|
||||||
|
# return {"tabId": response["tabId"], "Response": response["message"]}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception(f"An error occurred: {e}")
|
raise Exception(f"An error occurred: {e}")
|
||||||
|
Loading…
Reference in New Issue
Block a user