Spaces:
Running
Running
File size: 7,639 Bytes
044b38d |
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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
from langchain.prompts import ChatPromptTemplate
SYS_STRUCT = '''You are a software requirements engineer with years of experience working at a big tech company.
Your aim is to craft a well-written and clear software requirements documentation for the provided systems and use cases.
'''
# and respond only in Arabic
HUMAN_STRUCT = '''Can you generate the following component for a {system_name}.
- System actors
# FORAMT INSTRUCTIONS
{format_instructions}'''
# - System epics for each Actor
# - System feature for each epic
system_structure_template = ChatPromptTemplate.from_messages([
("system", SYS_STRUCT),
("human", HUMAN_STRUCT),
])
SYS_EPICS = '''You are a software requirements engineer with years of experience working at a big tech company.
Your aim is to craft a well-written and clear software requirements documentation for the provided systems and use cases.
'''
HUMAN_EPICS = '''Generate the system epics and features for the following actor make sure you create the core needed actors only.
System Name: {system_name}
System Actor: {system_actor}
Actor Description: {actor_description}
# FORAMT INSTRUCTIONS
{format_instructions}
'''
system_epics_template = ChatPromptTemplate.from_messages([
("system", SYS_EPICS),
("human", HUMAN_EPICS),
])
SYS_CARDS = '''You are a software requirements engineer with years of experience working at a big tech company.
Your aim in this exciting project is to craft a well-written and clear software requirements document. You must be very detailed and thorough.
'''
HUMAN_CARDS = '''Generate a detailed user story card for the following context. You must pay a close attention to the data available in the Schema section.
# General Instructions:
- If you used an email notification make sure you mention the email in the message.
# Schema:
{schema}
# System Epic:
{system_epic}
# Epic Feature:
{epic_feature}
# FORAMT INSTRUCTIONS
{format_instructions}
Take a deep breath and begin!
'''
story_cards_template = ChatPromptTemplate.from_messages([
("system", SYS_CARDS),
("human", HUMAN_CARDS),
])
# =======================================================================================================================================
# Generateing Entities prompt
# =======================================================================================================================================
SYS_ENTITIES = '''Please provide up to four crucial actors and entities for the given system's high-level data models. Exclude any configuration-related entities.
'''
HUMAN_ENTITIES = '''Generate the high-level data models (4 maximum) of the given system (i.e., actors and entities).
Make sure you only mention the most important ones.
Avoid mentioning the config related entities.
Be very concise you have to sort it from the most important one to the least important.
# System Context:
{system_context}
# FORAMT INSTRUCTIONS
{format_instructions}
'''
entities_template = ChatPromptTemplate.from_messages([
("system", SYS_ENTITIES),
("human", HUMAN_ENTITIES),
])
# =======================================================================================================================================
# End of Entities prompt
# =======================================================================================================================================
SYS_CARDS = '''You are a software requirements engineer with years of experience working at a big tech company.
Your aim in this exciting project is to craft a well-written and clear software requirements document. You must be very detailed and thorough.
'''
HUMAN_CARDS = '''Generate a detailed data model card given the provided entity and context. Use spaces instead of dashes on the attribute name.
Please rely on the system context (provided in a json format) to derive the data and attributes.
You will also return the result in a JSON format explained below.
# Examples of properties:
Example properties for a system actor:
First Name, Last Name, Date of Birth, [.. continue as you see fit from the context]
Example properties for a physical entity (i.e., room) properties:
Width, Location, [.. continue as you see fit from the context]
# System Information
- System Entity: {system_entity}
- System Context in a JSON format:
{system_context}
# FORAMT INSTRUCTIONS
{format_instructions}
'''
schema_template = ChatPromptTemplate.from_messages([
("system", SYS_CARDS),
("human", HUMAN_CARDS),
])
SYS_CARDS = '''You are a software requirements engineer with years of experience working at a big tech company.
Your aim in this exciting project is to craft a well-written and clear software requirements document. You must be very detailed and thorough.
'''
HUMAN_CARDS = '''The user has new feature request. Given the old data schema shown below, edit it and print out the updated data schema (which may contain either modified fields or entirly new fields). Be conservative.
Please rely on the system context (provided in a json format).
You will also return the result in a JSON format explained below.
You must follow the format instructions very closely.
# Schema:
{schema}
# System Context:
{system_context}
# New Use Case:
{new_usecase}
# FORAMT INSTRUCTIONS
{format_instructions}
Be very conservative and only edit existing schema if necessary.
Only return the entity object containing the modifications or updates, not the entire schema.
'''
update_schema_template = ChatPromptTemplate.from_messages([
("system", SYS_CARDS),
("human", HUMAN_CARDS),
])
SYS_CARDS = '''You are a software requirements engineer with years of experience working at a big tech company.
Your aim in this exciting project is to craft a well-written and clear software requirements document. You must be very detailed and thorough.
'''
HUMAN_CARDS = '''Generate an updated user story card provided the new schema shown below. You must pay a close attention to the data available in the Schema section.
Be very concise to show all the editable or viewable data available in the data Schema in the data section within the user story card.
# Story Card:
{story_card}
# Updated Schema:
{schema}
# FORAMT INSTRUCTIONS
{format_instructions}
Take a deep breath and begin!
'''
update_story_cards_template = ChatPromptTemplate.from_messages([
("system", SYS_CARDS),
("human", HUMAN_CARDS),
])
# Build a data schema for the given system context shown previously, with the following sections
# Each object will hold the following information
# Object Name
# Object Unique ID numbers only
# Each Object will hold as many Attribute as needed with the following information
# Attribute Unique ID (Start with Object Unique ID then dashed Attribute ID)
# Attribute name only in Arabic.
# Attribute Data type with the following option (Number or text or date or number and text ) only in Arabic.
# Make sure you build an Object for each actor mentioned previously
# You can use spaces instead of dashes on the attribute name
# Show the data on the markdown table
# Don’t mention the key type
SYS_STRUCT = '''Please answer with yes or no.
Is the following message a possible {var}, if it is answer with yes please.
Yet if it is a part of a chat like 'hello', 'thank you' or other non-possible system name please respond with no.
'''
# and respond only in Arabic
HUMAN_STRUCT = '''{message}'''
# - System epics for each Actor
# - System feature for each epic
check_message_template = ChatPromptTemplate.from_messages([
("system", SYS_STRUCT),
("human", HUMAN_STRUCT),
])
|