Skip to content

Commit b336e93

Browse files
committed
legal contract disclaimer and team configuration
1 parent d7db91a commit b336e93

File tree

11 files changed

+68
-21
lines changed

11 files changed

+68
-21
lines changed

data/agent_teams/legal_contract_team.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"status": "visible",
66
"created": "",
77
"created_by": "",
8+
"deployment_name": "gpt-4.1-mini",
89
"description": "A multi-agent legal review team that summarizes NDAs, identifies risks, checks compliance, and recommends improvements using advanced legal reasoning and retrieval-augmented analysis.",
910
"logo": "",
1011
"plan": "",
@@ -21,9 +22,7 @@
2122
"use_mcp": false,
2223
"use_bing": false,
2324
"use_reasoning": false,
24-
"index_name": "macae-legal-index",
25-
"index_foundry_name": "",
26-
"index_endpoint": "",
25+
"index_name": "sample-dataset-index",
2726
"coding_tools": false
2827
},
2928
{
@@ -38,9 +37,7 @@
3837
"use_mcp": false,
3938
"use_bing": false,
4039
"use_reasoning": false,
41-
"index_name": "macae-legal-index",
42-
"index_foundry_name": "",
43-
"index_endpoint": "",
40+
"index_name": "sample-dataset-index",
4441
"coding_tools": false
4542
},
4643
{
@@ -55,9 +52,7 @@
5552
"use_mcp": false,
5653
"use_bing": false,
5754
"use_reasoning": false,
58-
"index_name": "macae-legal-index",
59-
"index_foundry_name": "",
60-
"index_endpoint": "",
55+
"index_name": "sample-dataset-index",
6156
"coding_tools": false
6257
}
6358
],
@@ -66,7 +61,7 @@
6661
{
6762
"id": "task-1",
6863
"name": "NDA Contract Review",
69-
"prompt": "Please review the following NDA contract for summary, risks, and compliance issues.",
64+
"prompt": "Review Contoso's NDA. Provide a summary (parties, date, term, governing law), assess risks (High/Medium/Low with clause references), audit compliance against company policy, and suggest edits for any issues.",
7065
"created": "",
7166
"creator": "",
7267
"logo": ""

data/agent_teams/rfp_analysis_team.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"use_mcp": false,
2222
"use_bing": false,
2323
"use_reasoning": false,
24-
"index_name": "macae-rfp-index",
24+
"index_name": "sample-dataset-index",
2525
"index_foundry_name": "",
2626
"index_endpoint": "",
2727
"coding_tools": false
@@ -38,7 +38,7 @@
3838
"use_mcp": false,
3939
"use_bing": false,
4040
"use_reasoning": false,
41-
"index_name": "macae-rfp-index",
41+
"index_name": "sample-dataset-index",
4242
"coding_tools": false
4343
},
4444
{
@@ -53,7 +53,7 @@
5353
"use_mcp": false,
5454
"use_bing": false,
5555
"use_reasoning": false,
56-
"index_name": "macae-rfp-index",
56+
"index_name": "sample-dataset-index",
5757
"coding_tools": false
5858
}
5959
],
-143 KB
Binary file not shown.
16.5 KB
Binary file not shown.
-139 KB
Binary file not shown.
16.9 KB
Binary file not shown.
-143 KB
Binary file not shown.
16.7 KB
Binary file not shown.

index_datasets.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
try:
1313
from docx import Document
1414
from docx.opc.exceptions import PackageNotFoundError
15-
except Exception:
15+
except ImportError:
1616
Document = None
1717
PackageNotFoundError = None
1818

@@ -36,6 +36,7 @@
3636
sys.exit(1)
3737

3838
def extract_text_from_docx(file_path):
39+
"""Extract text from a DOCX file."""
3940
file_path = str(file_path)
4041
if not os.path.exists(file_path):
4142
raise FileNotFoundError(file_path)
@@ -45,27 +46,34 @@ def extract_text_from_docx(file_path):
4546
return "\n".join(paragraphs)
4647
except PackageNotFoundError:
4748
# Not a valid .docx archive (possibly a renamed file) — treat as skip
49+
print(f"Error: {file_path} is not a valid DOCX file.")
4850
raise
49-
except Exception:
51+
except Exception as e:
52+
print(f"Error processing {file_path}: {e}")
5053
raise
5154

55+
# --------------------------
5256
# Collect documents
5357
documents = []
5458
skipped = []
5559

5660
for entry in sorted(os.listdir(LOCAL_DOCX_FOLDER)):
61+
print(f"Checking file: {entry}") # Log the file being checked
5762
if not entry.lower().endswith(".docx"):
63+
print(f"Skipping non-DOCX file: {entry}") # Log skipped file
5864
continue
5965
if entry.startswith("~$"):
60-
# skip Word temp files
66+
print(f"Skipping temp file: {entry}") # Log temp files being skipped
6167
continue
6268

6369
path = LOCAL_DOCX_FOLDER / entry
6470
if not path.is_file():
71+
print(f"Skipping non-file: {entry}") # Log non-file entries
6572
continue
6673

6774
try:
6875
text = extract_text_from_docx(path)
76+
print(f"Extracted text from {entry}") # Log successful extraction
6977
except PackageNotFoundError:
7078
print(f"Skipping (invalid .docx): {entry}")
7179
skipped.append(entry)
@@ -76,7 +84,7 @@ def extract_text_from_docx(file_path):
7684
continue
7785

7886
if not text or not text.strip():
79-
print(f"Skipping (no text): {entry}")
87+
print(f"Skipping (empty text): {entry}, Text length: {len(text)}")
8088
skipped.append(entry)
8189
continue
8290

@@ -116,7 +124,7 @@ def extract_text_from_docx(file_path):
116124
print("Azure Search index created/updated.")
117125

118126
# --------------------------
119-
# Upload documents
127+
# Upload documents to Azure Search
120128
search_client = SearchClient(
121129
endpoint=f"https://{AZURE_SEARCH_SERVICE}.search.windows.net",
122130
index_name=AZURE_SEARCH_INDEX_NAME,
@@ -127,7 +135,8 @@ def extract_text_from_docx(file_path):
127135
succeeded = sum(1 for r in upload_results if getattr(r, "succeeded", False) is True)
128136
print(f"Uploaded {succeeded}/{len(documents)} documents to Azure Search.")
129137

130-
# Optional quick search
138+
# --------------------------
139+
# Optional: Quick search query to test the upload
131140
query = "Compliance"
132141
try:
133142
results = search_client.search(query, top=5)
@@ -137,4 +146,4 @@ def extract_text_from_docx(file_path):
137146
snippet = (r.get("content") or "")[:150].replace("\n", " ")
138147
print(f" - {title}: {snippet}...")
139148
except Exception as e:
140-
print("Search query failed:", e)
149+
print("Search query failed:", e)

src/frontend/package-lock.json

Lines changed: 24 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)