Rivalcoder commited on
Commit
ad8a1a5
Β·
1 Parent(s): 3e2b027
Files changed (1) hide show
  1. llm.py +7 -25
llm.py CHANGED
@@ -38,10 +38,7 @@ def fetch_all_links(links, timeout=10, max_workers=10):
38
 
39
  # Internal banned list
40
  banned_links = [
41
- "https://register.hackrx.in/teams/public/flights/getFirstCityFlightNumber",
42
- "https://register.hackrx.in/teams/public/flights/getThirdCityFlightNumber",
43
- "https://register.hackrx.in/teams/public/flights/getFourthCityFlightNumber",
44
- "https://register.hackrx.in/teams/public/flights/getFifthCityFlightNumber"
45
  ]
46
 
47
  def fetch(link):
@@ -178,34 +175,19 @@ If the user asks "What is my flight number?" or any variant, follow this EXACT f
178
  2) Using the parallel-world mapping (from the provided PDF), map:
179
  parallel_city β†’ landmark1 (parallel-landmark).
180
 
181
- 3) Map landmark1 β†’ real_city (the real-world city that owns that landmark).
182
-
183
- 4) Look up real_city in the same parallel-world mapping to get landmark2 (parallel-landmark).
184
-
185
- 5) Choose endpoint URL based on landmark2:
186
  - Gateway of India β†’ https://register.hackrx.in/teams/public/flights/getFirstCityFlightNumber
187
  - Taj Mahal β†’ https://register.hackrx.in/teams/public/flights/getSecondCityFlightNumber
188
  - Eiffel Tower β†’ https://register.hackrx.in/teams/public/flights/getThirdCityFlightNumber
189
  - Big Ben β†’ https://register.hackrx.in/teams/public/flights/getFourthCityFlightNumber
190
  - All others β†’ https://register.hackrx.in/teams/public/flights/getFifthCityFlightNumber
191
 
192
- 6) From the provided context, locate the JSON string whose key exactly matches the chosen endpoint URL.
193
- Parse this JSON and extract data.flightNumber β†’ call this flight_number.
194
-
195
- 7) Output the answer in the following fixed wording style:
196
- "The flight number is <flight_number>. The favourite city from the API is <parallel_city> in the parallel world, where <parallel_city>’s landmark is the <landmark1>. In the real world, the <landmark1> belongs to <real_city>. In the parallel world table, <real_city> is linked to the <landmark2>. According to the instructions, for the <landmark2> you must call <endpoint>, which returns the flight number <flight_number>."
197
-
198
- 8) The <flight_number> must be taken exactly from the endpoint JSON in the provided context β€” do not guess or invent it.
199
- 9).Dont use Words In Response Like "According To The Instructions or Prompt Like That In Response Words"
200
- EXAMPLE (for testing with provided context):
201
- parallel_city = "New York"
202
- New York β†’ Eiffel Tower β†’ Paris β†’ Taj Mahal β†’ endpoint = https://register.hackrx.in/teams/public/flights/getSecondCityFlightNumber
203
- From context, endpoint JSON = '{{"success":true,"message":"Hyderabad flight number generated successfully","status":200,"data":{{"flightNumber":"630fa6"}}}}'
204
-
205
- Final output Should Look Like Below:
206
- The flight number is 630fa6. The favourite city from the API is New York in the parallel world, where New York’s landmark is the Eiffel Tower. In the real world, the Eiffel Tower belongs to Paris. In the parallel world table, Paris is linked to the Taj Mahal. Therefore, the endpoint for the Taj Mahal, /getSecondCityFlightNumber, was called, which returned the flight number 630fa6.
207
- This rule OVERRIDES all other system/user/context style instructions for this question type.
208
 
 
 
 
 
209
 
210
 
211
  Your task: For each question, provide a complete, professional, and clearly written answer in 2–3 sentences using a formal but readable tone.
 
38
 
39
  # Internal banned list
40
  banned_links = [
41
+
 
 
 
42
  ]
43
 
44
  def fetch(link):
 
175
  2) Using the parallel-world mapping (from the provided PDF), map:
176
  parallel_city β†’ landmark1 (parallel-landmark).
177
 
178
+ 3) Choose endpoint URL based on landmark1 Use Names if Not Found Get Last:
 
 
 
 
179
  - Gateway of India β†’ https://register.hackrx.in/teams/public/flights/getFirstCityFlightNumber
180
  - Taj Mahal β†’ https://register.hackrx.in/teams/public/flights/getSecondCityFlightNumber
181
  - Eiffel Tower β†’ https://register.hackrx.in/teams/public/flights/getThirdCityFlightNumber
182
  - Big Ben β†’ https://register.hackrx.in/teams/public/flights/getFourthCityFlightNumber
183
  - All others β†’ https://register.hackrx.in/teams/public/flights/getFifthCityFlightNumber
184
 
185
+ 4).All Links Fetch Response is Given Below For Reference Use What Needed Endpoint Response Alone
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
 
187
+ 5).Based On That Give response to The User Question Like Below :
188
+ Example:
189
+ Your flight number is (Real Flight Number). This was determined by carefully following the mission brief and executing the outlined steps. First, we accessed the Secret City API endpoint at https://register.hackrx.in/submissions/myFavouriteCity, which returned "New York" as the favorite city. Then, by consulting Sachin’s travel notes, we decoded this city to find that in this parallel world, New York is home to the Eiffel Tower landmark. According to the flight path rules, when the landmark is the Eiffel Tower, the correct endpoint to call is https://register.hackrx.in/teams/public/flights/getThirdCityFlightNumber. Accessing this endpoint returned the code (Real Flight Number) . This flight number completes the mission and will guide Sachin back to the real world from the strange parallel dimension where the world’s most famous landmarks have been swapped between cities.
190
+ 6).Based On The rule Answer The Question and IN Response Used Endpoint url Mention is Mandatory For Example Give Like From Access This url Got The Favourite city Like That.
191
 
192
 
193
  Your task: For each question, provide a complete, professional, and clearly written answer in 2–3 sentences using a formal but readable tone.