diff --git a/src/prompts/parsePDF.ts b/src/prompts/parsePDF.ts index ee38402c..244f4327 100644 --- a/src/prompts/parsePDF.ts +++ b/src/prompts/parsePDF.ts @@ -51,11 +51,11 @@ I have a text extracted from a PDF file containing a company's annual report and "totalEmissions": "1553", "totalUnit": "Million ton CO2e" } - // Additional years follow the same structure + // Additional years follow the same structure. NEVER REUSE THE EXAMPLES ABOVE. } } -4. **Include Total**: Don't forget to include the total CO2 emissions for each year if presented. Never try to calculate any values! For Scope 2 - if both market based (MB) and location based (LB) emissions are presented, include both values and select the most relevant one for the total emissions. +4. **Never calculate total**: Don't forget to include the total CO2 emissions for each year if presented. Never try to calculate any values! For Scope 2 - if both market based (MB) and location based (LB) emissions are presented, include both values and select the most relevant one for the total emissions. 5. **Error Codes**: If not all information is available, use the following error codes to indicate missing data (using HTTP Status codes as inspiration): diff --git a/src/workers/searchVectors.ts b/src/workers/searchVectors.ts index 536de79b..4a4a60b0 100644 --- a/src/workers/searchVectors.ts +++ b/src/workers/searchVectors.ts @@ -28,7 +28,9 @@ const worker = new Worker( const url = job.data.url job.log('Searching ' + url) - const channel = await discord.client.channels.fetch(job.data.channelId) as TextChannel + const channel = (await discord.client.channels.fetch( + job.data.channelId + )) as TextChannel const message = await channel.messages.fetch(job.data.messageId) await message.edit(`Hämtar ut utsläppsdata...`) @@ -40,7 +42,7 @@ const worker = new Worker( const results = await collection.query({ nResults: 5, queryTexts: [ - 'GHG accounting, tCO2e (location-based method), ton CO2e, scope, scope 1, scope 2, scope 3, co2, emissions, emissions, 2021, 2023, 2022, gri protocol, CO2, ghg, greenhouse, gas, climate, change, global, warming, carbon, ', + 'GHG accounting, tCO2e (location-based method), ton CO2e, scope, scope 1, scope 2, scope 3, co2, emissions, emissions, 2021, 2023, 2022, gri protocol, CO2, ghg, greenhouse, gas, climate, change, global, warming, carbon, växthusgaser, utsläpp, basår, koldioxidutsläpp, koldioxid, klimatmål, ', ], })