File size: 2,930 Bytes
cef1c86 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
from langchain_core.pydantic_v1 import BaseModel, Field
class QueryAnalysis(BaseModel):
"""Analyzing the user query"""
esrs_type: str = Field(
enum=[
"ESRS 1",
"ESRS 2",
"ESRS E1",
"ESRS E2",
"ESRS E3",
"ESRS E4",
"ESRS E5",
"ESRS S1",
"ESRS S2",
"ESRS S3",
"ESRS S4",
"ESRS G1",
],
description="""
Given a user question choose which documents would be most relevant for answering their question,
- ESRS 1 is for questions about general principles for preparing and presenting sustainability information in accordance with CSRD
- ESRS 2 is for questions about general disclosures related to sustainability reporting, including governance, strategy, impact, risk, opportunity management, and metrics and targets
- ESRS E1 is for questions about climate change, global warming, GES and energy
- ESRS E2 is for questions about air, water, and soil pollution, and dangerous substances
- ESRS E3 is for questions about water and marine resources
- ESRS E4 is for questions about biodiversity, nature, wildlife and ecosystems
- ESRS E5 is for questions about resource use and circular economy
- ESRS S1 is for questions about workforce and labor issues, job security, fair pay, and health and safety
- ESRS S2 is for questions about workers in the value chain, workers' treatment
- SRS S3 is for questions about affected communities, impact on local communities
- ESRS S4 is for questions about consumers and end users, customer privacy, safety, and inclusion
- ESRS G1 is for questions about governance, risk management, internal control, and business conduct
""",
)
sources: str = Field(
enum=["ESRS", "External"],
description="""
Given a user question choose which documents would be most relevant for answering their question,
- ESRS is for questions about a specific environmental, social or governance topic, as well as CSRD's general principles and disclosures
- External is for questions about how to implement the CSRD, or general questions about CSRD's context
""",
)
intent: str = Field(
enum=[
"Specific topic",
"Implementation reco",
"KPI extraction",
],
description="""
Categorize the user query in one of the following categories,
Examples:
- Specific topic: "What are the specificities of ESRS E1 ?"
- Implementation reco: "How should I compute my scope 1 reduction target ?"
- KPI extraction: "When will the CSRD be mandatory for my small French company ?"
""",
)
|