This plugin identifies the presence of predefined legal keywords or phrases within a provided text and provides their meaning according the latest revisions.
Author: pragnyan_ramtha
Version: 0.0.1
Type: tool
This guide provides instructions on how to set up and effectively use the Legal Clause Identifier Dify Plugin within your Dify applications (Chatflows, Workflows, or Agents).
Key Features:
Analyze legal text for predefined or commonly identified clauses.
Get insights into the presence of clauses like Confidentiality, Force Majeure, Indemnification, Termination, etc.
Seamless integration into Dify workflows and conversational AI for legal document review.
2.1. Obtain Thomson Reuters API Credentials
Thomson Reuters Account: You will need an account with Thomson Reuters that grants access to their relevant Legal API services.
API Key: Obtain your API Key from your Thomson Reuters developer dashboard or through their provided API access method.
API Endpoint: Identify the base URL for the Thomson Reuters Legal API that you intend to use for clause identification. This is typically provided in their API documentation (e.g., https://api.tr.com/legal/v1/clause-detection).
2.2. Configure Credentials in Dify
Navigate to your Dify application's "Plugins" or "Tools" section.
Locate the "Legal Clause Identifier" plugin.
Go to its "Credentials" or "Settings" area.
Enter your thomsonreuters_api_key in the designated "Thomson Reuters API Key" field.
Enter your thomsonreuters_api_endpoint (the base URL for clause identification) in the "Thomson Reuters Legal API Base URL" field.
Save the configurations.
3.1. Tool Parameters
The legal_clause_identifier tool accepts the following parameters:
text (string, required):
Description: The full legal document, contract clause, or any text segment you wish to analyze for the presence of legal clauses.
Example: "This agreement shall be governed by and construed in accordance with the laws of the State of New York. Neither party shall be liable for any failure or delay in performance due to circumstances beyond its reasonable control, including, without limitation, acts of God, war, riot, embargoes, acts of civil or military authorities, fire, floods, accidents, or strikes."
keywords (list of strings, optional):
Description: (Optional) A list of specific legal clause types you want the API to focus on. If left empty, the Thomson Reuters API will typically perform a broader analysis based on its default capabilities.
Example: ["Confidentiality", "Termination", "Governing Law"]
3.2. Invoking the Tool
In a Chatflow/Agent:
Your Dify Agent, when prompted by a user, can identify the intent to perform legal text analysis and call the tool.
User Input Example: "Can you identify any force majeure or indemnification clauses in this contract text: '...[paste contract text here]...'?"
Agent Action: The LLM would extract the text and the specific keywords, then trigger the legal_clause_identifier tool.
In a Workflow:
You can add a "Tool" node in your workflow, select "Legal Clause Identifier," and map an input variable (e.g., from a "Text Input" node) to the text parameter. You can also map a "Multi-line Text Input" or a "List of Text" variable to the keywords parameter.
Example Output (JSON):
The Dify interface will typically display this information in a readable format, often as a card or directly in the chat, highlighting which clauses were found and which were not.
Due Diligence: Automate preliminary review of legal documents during mergers, acquisitions, or compliance checks.
Legal Research: Identify specific legal provisions across large volumes of text.
Document Standardization: Ensure consistent clause inclusion in drafted documents.
Educational Tool: Help legal students understand and identify different types of legal clauses.
Important Disclaimer: NOT LEGAL ADVICE
THIS PLUGIN IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY AND DOES NOT CONSTITUTE LEGAL ADVICE. IT IS NOT INTENDED TO BE A SUBSTITUTE FOR PROFESSIONAL LEGAL COUNSEL. ALWAYS CONSULT WITH A QUALIFIED LEGAL PROFESSIONAL FOR ADVICE REGARDING YOUR SPECIFIC LEGAL SITUATION. NEVER DISREGARD PROFESSIONAL LEGAL ADVICE OR DELAY IN SEEKING IT BECAUSE OF INFORMATION OBTAINED THROUGH THIS PLUGIN.
Troubleshooting
"Thomson Reuters API key is not configured" / "Thomson Reuters API endpoint is not configured":
Solution: Go to the plugin's credentials in Dify and ensure both the API key and the base URL are correctly entered and saved.
"Error from Thomson Reuters API: 4xx/5xx":
Solution: This indicates an issue with the API call itself.
Check your Thomson Reuters API key for correctness and ensure it has the necessary permissions for the clause identification service.
Verify the thomsonreuters_api_endpoint URL is exact and accessible.
Consult Thomson Reuters' API documentation for specific error codes and rate limits.
The Thomson Reuters service might be temporarily unavailable.
"No identified legal clauses...":
Solution: The provided text might not contain the phrases or structures the Thomson Reuters API recognizes as legal clauses, or your access level to the API might limit the types of clauses it can detect.
"Error parsing Thomson Reuters API response...":
Solution: This suggests the Thomson Reuters API's response format might have changed, or it returned an unexpected structure. You may need to review the plugin's Python code to adapt to the new response format based on Thomson Reuters' latest documentation.
Network Error:
Solution: Check your internet connection and ensure Dify's environment has outgoing network access to the Thomson Reuters API endpoint.