mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-17 02:03:44 +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"
|
||||
description: str = """Use this tool to create a new Multion Browser Window \
|
||||
with provided fields.Always the first step to run \
|
||||
any activities that can be done using browser."""
|
||||
description: str = """
|
||||
Create a new web browsing session based on a user's command or request. \
|
||||
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
|
||||
|
||||
def _run(
|
||||
|
@ -44,10 +44,10 @@ class MultionUpdateSession(BaseTool):
|
||||
|
||||
name: str = "update_multion_session"
|
||||
description: str = """Use this tool to update \
|
||||
a existing corresponding \
|
||||
Multion Browser Window with provided fields. \
|
||||
Note:TabId is got from one of the previous Browser window creation."""
|
||||
an existing corresponding Multion Browser Window with provided fields. \
|
||||
Note: TabId must be received from previous Browser window creation."""
|
||||
args_schema: Type[UpdateSessionSchema] = UpdateSessionSchema
|
||||
tabId: str = ""
|
||||
|
||||
def _run(
|
||||
self,
|
||||
@ -63,9 +63,10 @@ class MultionUpdateSession(BaseTool):
|
||||
self.tabId = tabId
|
||||
return content
|
||||
except Exception as e:
|
||||
print(f"{e}, creating a new session")
|
||||
response = multion.new_session({"input": query, "url": url})
|
||||
self.tabID = response["tabId"]
|
||||
return {"tabId": response["tabId"], "Response": response["message"]}
|
||||
print(f"{e}, retrying...")
|
||||
return {"error": f"{e}", "Response": "retrying..."}
|
||||
# response = multion.new_session({"input": query, "url": url})
|
||||
# self.tabID = response["tabId"]
|
||||
# return {"tabId": response["tabId"], "Response": response["message"]}
|
||||
except Exception as e:
|
||||
raise Exception(f"An error occurred: {e}")
|
||||
|
Loading…
Reference in New Issue
Block a user