Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,27 +10,10 @@ client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
|
| 10 |
#=====
|
| 11 |
#Payment type
|
| 12 |
manual_payment_type="""
|
| 13 |
-
1.
|
| 14 |
-
2.
|
| 15 |
-
3.
|
| 16 |
-
|
| 17 |
-
5. Payments made promptly as per contract terms without avoidable delay.
|
| 18 |
-
6. Statutory certificates for TDS provided to supplier before tax return submission.
|
| 19 |
-
7. Detailed payment advice issued showing calculations and deductions.
|
| 20 |
-
8. Invoice cross-checked with actual receipt before payment.
|
| 21 |
-
9. Contractor certifies payment claimed is within contract terms.
|
| 22 |
-
10. FOR Dispatching Station: 60-100% on dispatch proof, balance on receipt/acceptance.
|
| 23 |
-
11. FOR Destination: 100% on receipt and acceptance by consignee.
|
| 24 |
-
12. Goods with installation: 60% dispatch/90% receipt + 10% post-installation.
|
| 25 |
-
13. Payments via NEFT/RTGS or Advice to Bank for domestic goods.
|
| 26 |
-
14. Documents required: Invoice, Packing list, RR, E-Waybill, Inspection cert.
|
| 27 |
-
15. Imported goods: 100% FOB/CIF if no installation; 80-90% + balance post-installation.
|
| 28 |
-
16. Agency commission paid 100% in INR after other payments.
|
| 29 |
-
17. Imports conform to FEMA, EXIM policy, RBI directions.
|
| 30 |
-
18. Payments through LC or direct bank transfer as per contract.
|
| 31 |
-
19. Advance payments discouraged; require CA approval if given.
|
| 32 |
-
20. Ad-hoc advances adjusted in next bill; approved by CA per DOA.
|
| 33 |
-
21. No payments outside contract terms or excess of contract rates."""
|
| 34 |
|
| 35 |
#=================
|
| 36 |
#BasisOfEstimate
|
|
@@ -39,18 +22,10 @@ manual_basis_of_estimate="""
|
|
| 39 |
1. Estimated cost should be worked out realistically using market survey, budgetary quotations, or published catalogues/MRP when no historical data is available.
|
| 40 |
2. For custom-built equipment, obtain budgetary quotes from potential parties. Ideally three quotes, but if less than three, use available quotes with average if multiple.
|
| 41 |
3. Minimum three offer is required for estimate calculation. If less than three offers, then reason is to be written.
|
| 42 |
-
4.
|
| 43 |
-
5.
|
| 44 |
-
6.
|
| 45 |
-
7.
|
| 46 |
-
8. Foreign currency rates should be converted to Indian Rupees using TT selling rates published by RBI authorized bankers.
|
| 47 |
-
9. Estimates should consider inflation, technology changes, profit margins etc.
|
| 48 |
-
10. If estimates cannot be made meaningfully, full reason should be recorded.
|
| 49 |
-
11. For procurements up to Rs.1,00,000, detailed estimates are not required.
|
| 50 |
-
12. Price indices can be obtained from eaindustry.nic.in for indigenous items.
|
| 51 |
-
13. Estimates should be based on latest indent rates which had not been converted to order.
|
| 52 |
-
14. Last purchase price of similar items can be used for estimation.
|
| 53 |
-
15. Costing analysis based on costs of various components/raw materials should be done."""
|
| 54 |
|
| 55 |
#=======================
|
| 56 |
PQC_rules="""
|
|
@@ -108,7 +83,7 @@ def generate_response(manual, proposal):
|
|
| 108 |
"""
|
| 109 |
|
| 110 |
response = client.chat.completions.create( # FIXED: correct method
|
| 111 |
-
model="gpt-
|
| 112 |
messages=[{"role": "user", "content": prompt}],
|
| 113 |
temperature=0.1
|
| 114 |
)
|
|
@@ -144,7 +119,7 @@ def loop_function(df): # now properly yields
|
|
| 144 |
i = 1
|
| 145 |
elif key == "Basis of estimate": # FIXED: elif
|
| 146 |
manual_rules = manual_basis_of_estimate
|
| 147 |
-
proposal_details = f"The basis of estimate of the proposal is under: {value}."
|
| 148 |
i = 1
|
| 149 |
elif key == "Payment Terms":
|
| 150 |
manual_rules = manual_payment_type
|
|
|
|
| 10 |
#=====
|
| 11 |
#Payment type
|
| 12 |
manual_payment_type="""
|
| 13 |
+
1. Management discouraged the payment thorugh bank.
|
| 14 |
+
2. Advance payment without bank gurantee is not allowed. Require CA approval if given.
|
| 15 |
+
3. If payment term is milestone payment, then requirement of bank guarantee against each milestone payment release is to be written.
|
| 16 |
+
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
#=================
|
| 19 |
#BasisOfEstimate
|
|
|
|
| 22 |
1. Estimated cost should be worked out realistically using market survey, budgetary quotations, or published catalogues/MRP when no historical data is available.
|
| 23 |
2. For custom-built equipment, obtain budgetary quotes from potential parties. Ideally three quotes, but if less than three, use available quotes with average if multiple.
|
| 24 |
3. Minimum three offer is required for estimate calculation. If less than three offers, then reason is to be written.
|
| 25 |
+
4. Estimates should consider inflation, technology changes, profit margins etc.
|
| 26 |
+
5. If estimates cannot be made meaningfully, full reason should be recorded.
|
| 27 |
+
6. For procurements up to Rs.1,00,000, detailed estimates are not required.
|
| 28 |
+
7. If the Tender Type of the proposal is OEM then the basis of estimate shall be firm offer collected from vendor"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
#=======================
|
| 31 |
PQC_rules="""
|
|
|
|
| 83 |
"""
|
| 84 |
|
| 85 |
response = client.chat.completions.create( # FIXED: correct method
|
| 86 |
+
model="gpt-5-nano", # FIXED: use existing model (gpt-5-mini may not exist)
|
| 87 |
messages=[{"role": "user", "content": prompt}],
|
| 88 |
temperature=0.1
|
| 89 |
)
|
|
|
|
| 119 |
i = 1
|
| 120 |
elif key == "Basis of estimate": # FIXED: elif
|
| 121 |
manual_rules = manual_basis_of_estimate
|
| 122 |
+
proposal_details = f"The basis of estimate of the proposal is under: {value}.{Tender_Type_of_proposal}"
|
| 123 |
i = 1
|
| 124 |
elif key == "Payment Terms":
|
| 125 |
manual_rules = manual_payment_type
|