made this up as a test with some test data not sure if this is what you are looking for:
from openai import OpenAI
import pandas as pd
from dotenv import load_dotenv
import os
load_dotenv()
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
file_path = "test.xlsx"
df = pd.read_excel(file_path)
responses = []
def analyze_milestone(milestone, vendor_dates):
prompt = f"""
You are a construction schedule comparing GPT.
You assist the user by writing a narrative explaining the time differences between multiple vendors.
The user provides you with a milestone schedule, and your job is to compare the dates of completion and highlight the differences between each vendor.
Make sure to cover the milestone '{milestone}' and compare all vendors.
Here is the data:
{milestone} – {vendor_dates}
Write in a professional tone that is acceptable to C level executives.
"""
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": "You are a helpful assistant for comparing construction schedules."},
{"role": "user", "content": prompt}
],
max_tokens=150,
temperature=0.2
)
return response.choices[0].message.content.strip()
for index, row in df.iterrows():
milestone = row["Milestone"]
vendor_dates = ", ".join([f"Vendor {i+1}: {row[i+1]}" for i in range(len(row) - 1) if pd.notnull(row[i+1])])
result = analyze_milestone(milestone, vendor_dates)
responses.append(f"{milestone}:\n{result}\n")
narrative = "\n".join(responses)
output_file = "construction_schedule_comparison.txt"
with open(output_file, "w") as file:
file.write(narrative)
print(f"Narrative saved to {output_file}")
test data:
Milestone |
Vendor 1 |
Vendor 2 |
Vendor 3 |
Construction Start |
2025-05-01 |
2025-04-01 |
2025-05-01 |
Foundations Complete |
2025-08-20 |
2025-06-19 |
2025-08-08 |
Dry-In or Weather Tight |
2026-01-22 |
2025-11-05 |
2026-02-26 |
Part 1 |
2026-06-05 |
2026-08-30 |
2026-04-10 |
Part 2 |
2026-07-17 |
2026-09-19 |
2026-04-22 |
Part 3 |
2026-08-28 |
2026-09-29 |
2026-06-18 |
Part 4 |
2026-08-07 |
2026-10-27 |
2026-08-31 |
Part 5 |
2026-09-18 |
2026-11-17 |
2026-10-12 |
Part 6 |
2026-10-30 |
2026-11-29 |
2026-10-30 |
Substantial Completion |
2026-08-30 |
|
|
Certificate of Occupancy |
2026-11-02 |
2026-11-29 |
|
Final Completion |
2026-10-30 |
2026-10-30 |
2026-10-30 |
output:
Construction Start:
In reviewing the construction schedules provided by the three vendors, we observe notable differences in the proposed start dates for the project.
**Vendor 1** and **Vendor 3** have aligned their schedules with a construction start date of **May 1, 2025**. This synchronization suggests a similar approach to project mobilization and resource allocation, potentially indicating a shared understanding of the project requirements and timelines.
In contrast, **Vendor 2** proposes an earlier construction start date of **April 1, 2025**. This one-month head start could provide Vendor 2 with a competitive advantage, allowing for an extended construction period that may facilitate a more thorough execution of the project. The earlier commencement may also enable Vendor 2 to mitigate
Foundations Complete:
In reviewing the milestone schedule for the completion of the foundations across the three vendors, we observe notable differences in their projected timelines.
Vendor 1 is scheduled to complete the foundations on August 20, 2025. This timeline positions Vendor 1 as the latest among the three, indicating a potential delay in their overall project execution.
In contrast, Vendor 2 demonstrates a more aggressive timeline, with the foundations slated for completion on June 19, 2025. This earlier completion date not only suggests a more efficient approach but also allows for subsequent phases of the project to commence sooner, potentially leading to overall time savings.
Vendor 3 falls in between the two, with a completion date of August 8, 2025. While this date
Dry-In or Weather Tight:
In reviewing the milestone schedule for the 'Dry-In or Weather Tight' phase across the three vendors, we observe notable differences in their projected completion dates, which could significantly impact the overall project timeline.
**Vendor 1** has scheduled the completion of the 'Dry-In or Weather Tight' phase for **January 22, 2026**. This timeline positions Vendor 1 as the latest among the three, suggesting a longer duration before the project reaches this critical milestone.
**Vendor 2**, on the other hand, has set a more aggressive timeline, with a completion date of **November 5, 2025**. This places Vendor 2 ahead of both Vendor 1 and Vendor 3, indicating a potential for earlier project advancement and
Part 1:
In reviewing the milestone completion dates for Part 1 across the three vendors, we observe notable differences that could impact project timelines and overall strategic planning.
**Vendor 1** is scheduled to complete Part 1 on **June 5, 2026**. This timeline positions Vendor 1 as the second earliest among the three, indicating a commitment to timely delivery.
**Vendor 2**, on the other hand, has a completion date set for **August 30, 2026**. This date is significantly later than Vendor 1's, resulting in a delay of approximately **2 months and 25 days**. Such a timeline could pose challenges in maintaining project momentum and aligning subsequent phases of construction.
**Vendor 3** presents the earliest
Part 2:
In reviewing the completion dates for Milestone 'Part 2' across the three vendors, we observe notable differences that warrant attention for strategic planning and resource allocation.
- **Vendor 1** is scheduled to complete Part 2 on **July 17, 2026**. This timeline positions them in the middle range among the vendors, suggesting a moderate pace of progress.
- **Vendor 2** has a later completion date of **September 19, 2026**. This places them approximately two months behind Vendor 1 and nearly five months behind Vendor 3. The extended timeline may indicate potential challenges in their workflow or resource management that could impact overall project timelines.
- **Vendor 3** stands out with the earliest completion date of
Part 3:
In reviewing the milestone schedule for Part 3 of our project, we observe notable differences in the completion dates proposed by the three vendors.
Vendor 1 has projected a completion date of August 28, 2026. This timeline positions Vendor 1 as the second latest in terms of delivery, indicating a potential delay compared to Vendor 3.
Vendor 2, on the other hand, has set a completion date of September 29, 2026. This date is the latest among the three vendors, suggesting that Vendor 2 may require additional time to meet the project requirements, which could impact the overall project timeline.
In contrast, Vendor 3 stands out with a significantly earlier completion date of June 18, 2026. This
Part 4:
In reviewing the completion dates for Part 4 of the project across the three vendors, we observe notable differences that may impact our overall timeline and resource allocation.
**Vendor 1** is scheduled to complete Part 4 on **August 7, 2026**. This date positions Vendor 1 as the earliest among the three, allowing for potential advantages in subsequent phases of the project, such as early integration of deliverables and reduced risk of delays in later milestones.
**Vendor 3** follows closely with a completion date of **August 31, 2026**. While this date is only a few weeks later than Vendor 1, it still represents a significant gap in terms of project scheduling. The difference of 24 days could have
Part 5:
In reviewing the milestone schedule for Part 5 across the three vendors, we observe notable differences in their projected completion dates, which may impact overall project timelines and resource allocation.
**Vendor 1** has set a completion date of **September 18, 2026**. This timeline positions Vendor 1 as the earliest to reach this milestone, allowing for potential advantages in subsequent phases of the project. Early completion could facilitate earlier integration of subsequent tasks, potentially leading to cost savings and improved project flow.
**Vendor 3** is scheduled to complete Part 5 on **October 12, 2026**. This date is approximately three weeks later than Vendor 1's completion date. While still relatively prompt, this delay could affect the scheduling of
Part 6:
In reviewing the milestone schedule for Part 6 of our project, we observe notable differences in the completion dates proposed by the three vendors under consideration.
Vendor 1 and Vendor 3 have aligned their timelines, both committing to a completion date of October 30, 2026. This synchronization suggests a consistent approach to project execution between these two vendors, potentially indicating similar methodologies or resource allocations that may enhance reliability in meeting project timelines.
In contrast, Vendor 2 presents a later completion date of November 29, 2026. This one-month delay relative to Vendors 1 and 3 could be indicative of a variety of factors, such as differing project management strategies, resource availability, or the scope of work anticipated by Vendor 2. It is
Substantial Completion:
Subject: Comparative Analysis of Substantial Completion Dates Across Vendors
Dear [Recipient's Name],
I hope this message finds you well. As part of our ongoing evaluation of vendor timelines for the upcoming project, I have conducted a thorough comparison of the substantial completion dates provided by our selected vendors. This analysis aims to highlight the differences in their schedules, particularly focusing on Vendor 1.
**Vendor Completion Dates:**
- **Vendor 1:** Substantial Completion is scheduled for **August 30, 2026**.
As we assess the timelines, it is crucial to consider how these dates align with our project goals and overall strategic objectives. Vendor 1's completion date of August 30, 2026, serves as a benchmark for evaluating the efficiency
Certificate of Occupancy:
In reviewing the milestone schedule for the Certificate of Occupancy, we observe notable differences between the completion dates proposed by the two vendors under consideration.
Vendor 1 has projected the completion date for the Certificate of Occupancy as November 2, 2026. This timeline suggests a proactive approach, allowing for an earlier transition into the operational phase of the project. By achieving this milestone ahead of schedule, Vendor 1 may provide us with additional flexibility for subsequent phases, including tenant improvements and occupancy planning.
In contrast, Vendor 2 has indicated a completion date of November 29, 2026, which is 27 days later than Vendor 1's timeline. This extended timeframe could potentially impact our overall project schedule, delaying the commencement of occupancy and any
Final Completion:
In reviewing the milestone schedules for the final completion of the project, it is noteworthy that all three vendors Vendor 1, Vendor 2, and Vendor 3 have aligned their timelines to achieve final completion on the same date: October 30, 2026.
This uniformity in the completion date suggests a strong level of coordination and consistency among the vendors, which can be advantageous for project management and overall execution. It indicates that each vendor has likely assessed their respective capabilities and resource allocations to ensure they can meet this critical milestone within the same timeframe.
While the final completion date is identical across all vendors, it is essential to consider other factors that may influence the overall project delivery, such as the quality of work, adherence to interim milestones
you may want to review all the outcomes to see how correct it is. on a brief skim looked good to me.
just need to build something like this to meet your specific output format.
this is as simple as I could make it 