Aws review notes
In [3]:
Copied!
import os
from dotenv import load_dotenv
from openai import OpenAI
import json
from time import time
import os
from dotenv import load_dotenv
from openai import OpenAI
import json
from time import time
Example¶
In [4]:
Copied!
load_dotenv()
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key=os.environ.get("OPENROUTER_API_KEY"),
default_headers={
"HTTP-Referer": "https://localhost:8888",
"X-Title": "E-Commerce Portfolio App",
}
)
response = client.chat.completions.create(
model="nvidia/nemotron-3-ultra-550b-a55b:free",
messages=[{"role": "user", "content": "Hello OpenRouter!"}]
)
print(response.choices[0].message.content)
load_dotenv()
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key=os.environ.get("OPENROUTER_API_KEY"),
default_headers={
"HTTP-Referer": "https://localhost:8888",
"X-Title": "E-Commerce Portfolio App",
}
)
response = client.chat.completions.create(
model="nvidia/nemotron-3-ultra-550b-a55b:free",
messages=[{"role": "user", "content": "Hello OpenRouter!"}]
)
print(response.choices[0].message.content)
Hello! How can I help you today?
Create syllabus json¶
In [ ]:
Copied!
markdown_base_path = "../../official_doc/exam_syllabus/machine-learning-engineer-associate-02-domain{domain_id}.md"
markdown_contents = []
for domain_id in range(1, 5):
markdown_file_path = markdown_base_path.format(domain_id=domain_id)
with open(markdown_file_path, "r") as md_file:
md_content = md_file.read()
markdown_contents.append(md_content)
json_format = {
"domain_id": "string",
"domain_name": "string",
"task_id": "string",
"task_name": "string",
"skill_id": "string",
"skill_name": "string"
}
json_example = {
"domain_id": "1",
"domain_name": "Data Engineering",
"task_id": "1",
"task_name": "Data Collection",
"skill_id": "1",
"skill_name": "Extract data from data sources."
}
output = []
for markdown_content in markdown_contents:
json_prompt = f"""
You are provided with a markdown file containing the a content domain of AWS MLA-C02 Exam.
Based on a content, create a json file with the following structure:
{json_format}
For example a skill item: + Skill 1.1.1: Extract data from data sources.
The corresponding json object would be:
{json_example}
Restriction: Do not include any additional information or explanations in the output. Only provide the JSON representation of the skills extracted from the markdown content.
Here is the markdown file:
{markdown_content}
"""
response = client.chat.completions.create(
model="z-ai/glm-5.3",
messages=[{"role": "user", "content": json_prompt}],
response_format={"type": "json_object"}
)
response_content = response.choices[0].message.content
output.append(response_content)
markdown_base_path = "../../official_doc/exam_syllabus/machine-learning-engineer-associate-02-domain{domain_id}.md"
markdown_contents = []
for domain_id in range(1, 5):
markdown_file_path = markdown_base_path.format(domain_id=domain_id)
with open(markdown_file_path, "r") as md_file:
md_content = md_file.read()
markdown_contents.append(md_content)
json_format = {
"domain_id": "string",
"domain_name": "string",
"task_id": "string",
"task_name": "string",
"skill_id": "string",
"skill_name": "string"
}
json_example = {
"domain_id": "1",
"domain_name": "Data Engineering",
"task_id": "1",
"task_name": "Data Collection",
"skill_id": "1",
"skill_name": "Extract data from data sources."
}
output = []
for markdown_content in markdown_contents:
json_prompt = f"""
You are provided with a markdown file containing the a content domain of AWS MLA-C02 Exam.
Based on a content, create a json file with the following structure:
{json_format}
For example a skill item: + Skill 1.1.1: Extract data from data sources.
The corresponding json object would be:
{json_example}
Restriction: Do not include any additional information or explanations in the output. Only provide the JSON representation of the skills extracted from the markdown content.
Here is the markdown file:
{markdown_content}
"""
response = client.chat.completions.create(
model="z-ai/glm-5.3",
messages=[{"role": "user", "content": json_prompt}],
response_format={"type": "json_object"}
)
response_content = response.choices[0].message.content
output.append(response_content)
In [ ]:
Copied!
final_output = []
for item in output:
items = json.loads(item).get("skills", [])
final_output += items
with open("aws_mla_c02_skills.json", "w") as json_file:
json.dump(final_output, json_file, indent=4)
final_output = []
for item in output:
items = json.loads(item).get("skills", [])
final_output += items
with open("aws_mla_c02_skills.json", "w") as json_file:
json.dump(final_output, json_file, indent=4)
Load skills¶
In [6]:
Copied!
with open("aws_mla_c02_skills.json", "r") as json_file:
skills_data = json.load(json_file)
with open("aws_mla_c02_skills.json", "r") as json_file:
skills_data = json.load(json_file)
Notes creation¶
In [64]:
Copied!
note_system_prompt = """
You are an AWS Examination expert and you are responsible in providing accurate and detailed answers to questions related to AWS services, architecture, and best practices.
Your responses should be clear, concise, and informative, catering to both beginners and experienced professionals in the field of cloud computing.
"""
note_prompt_1 = """
You are now responsible in create study notes for the AWS Certified Machine Learning - Associate (MLA-C02) exam.
You are provided with a single skill item from the AWS MLA-C02 exam syllabus.
You are also provided with a AWS domain review notes regarding the task item.
Your task is to create a comprehensive study note for that skill item, including explanations, examples, and any relevant information that would help a candidate understand the concept thoroughly.
Provide scenario-based examples similar to exam questions to illustrate the application of the skill item in real-world scenarios.
Provide exam tips and traps related to the skill item as well.
Utilize tables, mermaid diagrams, and other visual aids to enhance the clarity of your explanations.
Do not include code examples as it is not required for the exam. Focus on conceptual understanding and practical application of the skill item.
Use the notes, your expertise and web search to create a detailed study note for the skill item.
Output: Notes should be in markdown format. Do not include any additional information or explanations in the output. Only provide the markdown representation of the study notes for the skill item.
Example of the header structure for the study notes:
# Task 1.1: {domain_name} - {task_name}
## Skill 1.1.1: {skill_name}
"""
note_prompt_2 = """
Skill item for notes generation: {skill_item}
Domain review notes: {domain_review_notes}
"""
domain_review_notes_base_path = "../../official_doc/domain_review_notes"
note_system_prompt = """
You are an AWS Examination expert and you are responsible in providing accurate and detailed answers to questions related to AWS services, architecture, and best practices.
Your responses should be clear, concise, and informative, catering to both beginners and experienced professionals in the field of cloud computing.
"""
note_prompt_1 = """
You are now responsible in create study notes for the AWS Certified Machine Learning - Associate (MLA-C02) exam.
You are provided with a single skill item from the AWS MLA-C02 exam syllabus.
You are also provided with a AWS domain review notes regarding the task item.
Your task is to create a comprehensive study note for that skill item, including explanations, examples, and any relevant information that would help a candidate understand the concept thoroughly.
Provide scenario-based examples similar to exam questions to illustrate the application of the skill item in real-world scenarios.
Provide exam tips and traps related to the skill item as well.
Utilize tables, mermaid diagrams, and other visual aids to enhance the clarity of your explanations.
Do not include code examples as it is not required for the exam. Focus on conceptual understanding and practical application of the skill item.
Use the notes, your expertise and web search to create a detailed study note for the skill item.
Output: Notes should be in markdown format. Do not include any additional information or explanations in the output. Only provide the markdown representation of the study notes for the skill item.
Example of the header structure for the study notes:
# Task 1.1: {domain_name} - {task_name}
## Skill 1.1.1: {skill_name}
"""
note_prompt_2 = """
Skill item for notes generation: {skill_item}
Domain review notes: {domain_review_notes}
"""
domain_review_notes_base_path = "../../official_doc/domain_review_notes"
In [65]:
Copied!
notes_output = []
for skill in skills_data:
start_time = time()
with open(f"{domain_review_notes_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.md", "r") as drn_file:
domain_review_notes = drn_file.read()
note_prompt = note_prompt_2.format(skill_item=skill, domain_review_notes=domain_review_notes)
response = client.chat.completions.create(
model="deepseek/deepseek-v4-pro-0813",
messages=[
{"role": "system", "content": note_system_prompt},
{"role": "user", "content": note_prompt_1},
{"role": "user", "content": note_prompt}
],
max_completion_tokens=16384
)
study_note_content = response.choices[0].message.content
notes_output.append(study_note_content)
note_output_base_path = "../notes_by_skills"
output_path = f"{note_output_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.{skill.get("skill_id", "")}.md"
with open(output_path, "w", encoding="utf-8") as notes_file:
notes_file.write(study_note_content)
print(f"Study notes for skill {skill.get('skill_id', '')} saved to {output_path}. Time taken: {round(time() - start_time, 2)} seconds.")
notes_output = []
for skill in skills_data:
start_time = time()
with open(f"{domain_review_notes_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.md", "r") as drn_file:
domain_review_notes = drn_file.read()
note_prompt = note_prompt_2.format(skill_item=skill, domain_review_notes=domain_review_notes)
response = client.chat.completions.create(
model="deepseek/deepseek-v4-pro-0813",
messages=[
{"role": "system", "content": note_system_prompt},
{"role": "user", "content": note_prompt_1},
{"role": "user", "content": note_prompt}
],
max_completion_tokens=16384
)
study_note_content = response.choices[0].message.content
notes_output.append(study_note_content)
note_output_base_path = "../notes_by_skills"
output_path = f"{note_output_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.{skill.get("skill_id", "")}.md"
with open(output_path, "w", encoding="utf-8") as notes_file:
notes_file.write(study_note_content)
print(f"Study notes for skill {skill.get('skill_id', '')} saved to {output_path}. Time taken: {round(time() - start_time, 2)} seconds.")
Study notes for skill 1 saved to ../notes_by_skills/1.1.1.md. Time taken: 125.62 seconds. Study notes for skill 2 saved to ../notes_by_skills/1.1.2.md. Time taken: 185.41 seconds. Study notes for skill 3 saved to ../notes_by_skills/1.1.3.md. Time taken: 117.07 seconds. Study notes for skill 4 saved to ../notes_by_skills/1.1.4.md. Time taken: 25.18 seconds. Study notes for skill 5 saved to ../notes_by_skills/1.1.5.md. Time taken: 94.61 seconds. Study notes for skill 6 saved to ../notes_by_skills/1.1.6.md. Time taken: 22.54 seconds. Study notes for skill 7 saved to ../notes_by_skills/1.1.7.md. Time taken: 141.77 seconds. Study notes for skill 8 saved to ../notes_by_skills/1.1.8.md. Time taken: 202.59 seconds. Study notes for skill 9 saved to ../notes_by_skills/1.1.9.md. Time taken: 137.08 seconds. Study notes for skill 1 saved to ../notes_by_skills/1.2.1.md. Time taken: 124.9 seconds. Study notes for skill 2 saved to ../notes_by_skills/1.2.2.md. Time taken: 125.79 seconds. Study notes for skill 3 saved to ../notes_by_skills/1.2.3.md. Time taken: 252.5 seconds. Study notes for skill 4 saved to ../notes_by_skills/1.2.4.md. Time taken: 149.43 seconds. Study notes for skill 5 saved to ../notes_by_skills/1.2.5.md. Time taken: 95.61 seconds. Study notes for skill 6 saved to ../notes_by_skills/1.2.6.md. Time taken: 109.26 seconds. Study notes for skill 7 saved to ../notes_by_skills/1.2.7.md. Time taken: 156.25 seconds. Study notes for skill 8 saved to ../notes_by_skills/1.2.8.md. Time taken: 80.3 seconds. Study notes for skill 9 saved to ../notes_by_skills/1.2.9.md. Time taken: 130.76 seconds. Study notes for skill 1 saved to ../notes_by_skills/1.3.1.md. Time taken: 135.13 seconds. Study notes for skill 2 saved to ../notes_by_skills/1.3.2.md. Time taken: 111.53 seconds. Study notes for skill 3 saved to ../notes_by_skills/1.3.3.md. Time taken: 106.32 seconds. Study notes for skill 4 saved to ../notes_by_skills/1.3.4.md. Time taken: 162.24 seconds. Study notes for skill 5 saved to ../notes_by_skills/1.3.5.md. Time taken: 155.9 seconds. Study notes for skill 6 saved to ../notes_by_skills/1.3.6.md. Time taken: 113.06 seconds. Study notes for skill 7 saved to ../notes_by_skills/1.3.7.md. Time taken: 143.56 seconds. Study notes for skill 1 saved to ../notes_by_skills/2.1.1.md. Time taken: 185.2 seconds. Study notes for skill 2 saved to ../notes_by_skills/2.1.2.md. Time taken: 101.07 seconds. Study notes for skill 3 saved to ../notes_by_skills/2.1.3.md. Time taken: 131.02 seconds. Study notes for skill 4 saved to ../notes_by_skills/2.1.4.md. Time taken: 157.08 seconds. Study notes for skill 5 saved to ../notes_by_skills/2.1.5.md. Time taken: 154.89 seconds. Study notes for skill 6 saved to ../notes_by_skills/2.1.6.md. Time taken: 197.66 seconds. Study notes for skill 7 saved to ../notes_by_skills/2.1.7.md. Time taken: 158.32 seconds. Study notes for skill 8 saved to ../notes_by_skills/2.1.8.md. Time taken: 109.39 seconds. Study notes for skill 1 saved to ../notes_by_skills/2.2.1.md. Time taken: 200.09 seconds. Study notes for skill 2 saved to ../notes_by_skills/2.2.2.md. Time taken: 168.88 seconds. Study notes for skill 3 saved to ../notes_by_skills/2.2.3.md. Time taken: 104.04 seconds. Study notes for skill 4 saved to ../notes_by_skills/2.2.4.md. Time taken: 77.39 seconds. Study notes for skill 5 saved to ../notes_by_skills/2.2.5.md. Time taken: 150.55 seconds. Study notes for skill 6 saved to ../notes_by_skills/2.2.6.md. Time taken: 89.5 seconds. Study notes for skill 7 saved to ../notes_by_skills/2.2.7.md. Time taken: 84.03 seconds. Study notes for skill 8 saved to ../notes_by_skills/2.2.8.md. Time taken: 99.56 seconds. Study notes for skill 9 saved to ../notes_by_skills/2.2.9.md. Time taken: 112.27 seconds. Study notes for skill 1 saved to ../notes_by_skills/2.3.1.md. Time taken: 133.99 seconds. Study notes for skill 2 saved to ../notes_by_skills/2.3.2.md. Time taken: 130.86 seconds. Study notes for skill 3 saved to ../notes_by_skills/2.3.3.md. Time taken: 83.92 seconds. Study notes for skill 4 saved to ../notes_by_skills/2.3.4.md. Time taken: 150.48 seconds. Study notes for skill 5 saved to ../notes_by_skills/2.3.5.md. Time taken: 86.81 seconds. Study notes for skill 6 saved to ../notes_by_skills/2.3.6.md. Time taken: 99.8 seconds. Study notes for skill 7 saved to ../notes_by_skills/2.3.7.md. Time taken: 125.0 seconds. Study notes for skill 8 saved to ../notes_by_skills/2.3.8.md. Time taken: 173.18 seconds. Study notes for skill 9 saved to ../notes_by_skills/2.3.9.md. Time taken: 179.93 seconds. Study notes for skill 10 saved to ../notes_by_skills/2.3.10.md. Time taken: 106.21 seconds. Study notes for skill 1 saved to ../notes_by_skills/3.1.1.md. Time taken: 107.71 seconds. Study notes for skill 2 saved to ../notes_by_skills/3.1.2.md. Time taken: 113.25 seconds. Study notes for skill 3 saved to ../notes_by_skills/3.1.3.md. Time taken: 103.4 seconds. Study notes for skill 4 saved to ../notes_by_skills/3.1.4.md. Time taken: 111.43 seconds. Study notes for skill 5 saved to ../notes_by_skills/3.1.5.md. Time taken: 153.63 seconds. Study notes for skill 6 saved to ../notes_by_skills/3.1.6.md. Time taken: 115.32 seconds. Study notes for skill 7 saved to ../notes_by_skills/3.1.7.md. Time taken: 141.35 seconds. Study notes for skill 8 saved to ../notes_by_skills/3.1.8.md. Time taken: 94.19 seconds. Study notes for skill 1 saved to ../notes_by_skills/3.2.1.md. Time taken: 145.91 seconds. Study notes for skill 2 saved to ../notes_by_skills/3.2.2.md. Time taken: 103.63 seconds. Study notes for skill 3 saved to ../notes_by_skills/3.2.3.md. Time taken: 125.27 seconds. Study notes for skill 4 saved to ../notes_by_skills/3.2.4.md. Time taken: 177.96 seconds. Study notes for skill 5 saved to ../notes_by_skills/3.2.5.md. Time taken: 229.64 seconds. Study notes for skill 6 saved to ../notes_by_skills/3.2.6.md. Time taken: 214.42 seconds. Study notes for skill 7 saved to ../notes_by_skills/3.2.7.md. Time taken: 133.7 seconds. Study notes for skill 8 saved to ../notes_by_skills/3.2.8.md. Time taken: 174.35 seconds. Study notes for skill 9 saved to ../notes_by_skills/3.2.9.md. Time taken: 68.21 seconds. Study notes for skill 10 saved to ../notes_by_skills/3.2.10.md. Time taken: 148.19 seconds. Study notes for skill 11 saved to ../notes_by_skills/3.2.11.md. Time taken: 58.42 seconds. Study notes for skill 1 saved to ../notes_by_skills/3.3.1.md. Time taken: 146.74 seconds. Study notes for skill 2 saved to ../notes_by_skills/3.3.2.md. Time taken: 141.27 seconds. Study notes for skill 3 saved to ../notes_by_skills/3.3.3.md. Time taken: 128.03 seconds. Study notes for skill 4 saved to ../notes_by_skills/3.3.4.md. Time taken: 127.91 seconds. Study notes for skill 5 saved to ../notes_by_skills/3.3.5.md. Time taken: 72.65 seconds. Study notes for skill 6 saved to ../notes_by_skills/3.3.6.md. Time taken: 136.3 seconds. Study notes for skill 7 saved to ../notes_by_skills/3.3.7.md. Time taken: 154.7 seconds. Study notes for skill 8 saved to ../notes_by_skills/3.3.8.md. Time taken: 211.04 seconds. Study notes for skill 9 saved to ../notes_by_skills/3.3.9.md. Time taken: 98.47 seconds. Study notes for skill 10 saved to ../notes_by_skills/3.3.10.md. Time taken: 175.1 seconds. Study notes for skill 11 saved to ../notes_by_skills/3.3.11.md. Time taken: 141.56 seconds. Study notes for skill 1 saved to ../notes_by_skills/4.1.1.md. Time taken: 140.47 seconds. Study notes for skill 2 saved to ../notes_by_skills/4.1.2.md. Time taken: 137.53 seconds. Study notes for skill 3 saved to ../notes_by_skills/4.1.3.md. Time taken: 124.95 seconds. Study notes for skill 4 saved to ../notes_by_skills/4.1.4.md. Time taken: 116.22 seconds. Study notes for skill 5 saved to ../notes_by_skills/4.1.5.md. Time taken: 146.69 seconds. Study notes for skill 6 saved to ../notes_by_skills/4.1.6.md. Time taken: 137.86 seconds. Study notes for skill 1 saved to ../notes_by_skills/4.2.1.md. Time taken: 103.08 seconds. Study notes for skill 2 saved to ../notes_by_skills/4.2.2.md. Time taken: 184.73 seconds. Study notes for skill 3 saved to ../notes_by_skills/4.2.3.md. Time taken: 137.76 seconds. Study notes for skill 4 saved to ../notes_by_skills/4.2.4.md. Time taken: 152.69 seconds. Study notes for skill 5 saved to ../notes_by_skills/4.2.5.md. Time taken: 189.56 seconds. Study notes for skill 6 saved to ../notes_by_skills/4.2.6.md. Time taken: 92.89 seconds. Study notes for skill 7 saved to ../notes_by_skills/4.2.7.md. Time taken: 121.46 seconds. Study notes for skill 8 saved to ../notes_by_skills/4.2.8.md. Time taken: 136.17 seconds. Study notes for skill 9 saved to ../notes_by_skills/4.2.9.md. Time taken: 141.07 seconds. Study notes for skill 10 saved to ../notes_by_skills/4.2.10.md. Time taken: 97.51 seconds. Study notes for skill 1 saved to ../notes_by_skills/4.3.1.md. Time taken: 99.35 seconds. Study notes for skill 2 saved to ../notes_by_skills/4.3.2.md. Time taken: 102.34 seconds. Study notes for skill 3 saved to ../notes_by_skills/4.3.3.md. Time taken: 227.96 seconds. Study notes for skill 4 saved to ../notes_by_skills/4.3.4.md. Time taken: 144.74 seconds. Study notes for skill 5 saved to ../notes_by_skills/4.3.5.md. Time taken: 131.04 seconds. Study notes for skill 6 saved to ../notes_by_skills/4.3.6.md. Time taken: 196.8 seconds. Study notes for skill 7 saved to ../notes_by_skills/4.3.7.md. Time taken: 93.1 seconds. Study notes for skill 8 saved to ../notes_by_skills/4.3.8.md. Time taken: 179.86 seconds. Study notes for skill 9 saved to ../notes_by_skills/4.3.9.md. Time taken: 85.08 seconds.
Question bank¶
In [28]:
Copied!
questions_system_prompt = """
You are an AWS Examination expert and you are responsible in providing accurate and detailed answers to questions related to AWS services, architecture, and best practices.
Your responses should be clear, concise, and informative, catering to both beginners and experienced professionals in the field of cloud computing.
"""
questions_prompt_1 = """
You are now responsible in create practice questions for the AWS Certified Machine Learning - Associate (MLA-C02) exam.
You are provided with a single skill item from the AWS MLA-C02 exam syllabus.
You are also provided with a AWS domain review notes regarding the task item.
Your task is to create a set of 10 questions for that skill item, contained in a 2-column table structure.
Strict Rules for Question Formatting:
1. Scenario Structure:
- Each question must begin with a realistic enterprise business scenario (3–5 sentences).
- The scenario MUST specify clear constraints (e.g., "least operational overhead", "lowest latency", "most cost-effective solution", or "compliance with zero data retention").
- Frame the scenario around AWS native architecture (SageMaker, Bedrock, OpenSearch, Step Functions, Glue, S3, IAM, etc.).
2. Options (A, B, C, D, E):
- Provide exactly 4-5 options.
- There can be either 1 or more than 1 correct option. State in the question. (e.g. Select ONE/TWO that's applicable)
- The correct option(s) MUST be the objectively correct choice under the specified constraints.
- other options MUST be plausible distractors (they should sound like real AWS best practices, but violate a specific constraint, use a non-existent feature, or choose a higher-overhead architectural pattern).
3. Output Format for Each Question:
- Question Text
- Options A, B, C, D
- Correct Answer (Hidden or marked under a spoiler block)
- Detailed Explanation Breakdown:
* Correct Answer Analysis: Why it satisfies all requirements and constraints.
* Distractor Analysis: Explicitly explain why EACH incorrect option (Option A, B, etc.) is wrong (e.g., "Option B introduces unnecessary operational complexity", "Option C is invalid because Bedrock Titan doesn't support...").
* Exam Tip / AWS Best Practice: A 1-sentence key takeaway for quick revision.
- Do NOT use raw line breaks inside table cells (which breaks Markdown table rendering). Use HTML `<br>` tags for all line breaks and paragraph separations inside the table cells.
Header format:
# Skill 1.1.1: Extract data from data sources
---
Example question:
| Question | Answer & Explanation |
| --- | --- |
| **### Question 1 - Amazon Bedrock Knowledge Bases & OpenSearch Serverless Encryption**<br>
<br>
<br>An AI engineering team is configuring an automated ingestion pipeline for an enterprise knowledge base using **Amazon Bedrock Knowledge Bases** and **Amazon OpenSearch Serverless**.<br>
<br>
<br>The pipeline must parse unstructured PDF documents stored in an Amazon S3 bucket, generate vector embeddings, and store them in an encrypted vector collection. Compliance policies mandate that the vector index at rest must be encrypted using a customer-managed key (CMK) in **AWS KMS**, and operational maintenance must be minimized.<br>
<br>
<br>Which **TWO** steps should the engineer perform to fulfill these requirements? (Select TWO)<br>
<br>
<br>- **A)** Configure an S3 Event Notification to invoke an AWS Lambda function that parses PDFs using PyPDF and writes embeddings directly to OpenSearch.<br>
<br>- **B)** Create a Bedrock Knowledge Base data source pointing to the S3 bucket and trigger the ingestion job (`StartIngestionJob`).<br>
<br>- **C)** Define an encryption policy in Amazon OpenSearch Serverless specifying the KMS customer-managed key (CMK) ARN prior to creating the vector collection.<br>
<br>- **D)** Enable client-side encryption on the S3 bucket using Amazon Bedrock Guardrails before sending documents to the embedding model.<br>
<br>- **E)** Enable SSE-S3 default encryption on the source S3 bucket to automatically encrypt the downstream OpenSearch Serverless collection. | **Correct Answers:** **B** and **C**<br>
<br>
<br>**Correct Options Analysis:**<br>
<br>- **B is Correct:** Amazon Bedrock Knowledge Bases natively manages document parsing, semantic chunking, embedding generation, and indexing into OpenSearch Serverless without needing custom pipeline code.<br>
<br>- **C is Correct:** Encryption policies in OpenSearch Serverless must be defined before creating the collection. Setting the KMS CMK in the security policy guarantees at-rest encryption for the vector index.<br>
<br>
<br>**Distractor Analysis:**<br>
<br>- **A is Incorrect:** Writing custom Lambda code to parse PDFs and generate embeddings introduces unnecessary operational overhead compared to Bedrock's native ingestion job.<br>
<br>- **D is Incorrect:** Bedrock Guardrails handle content filtering, PII redaction, and safety checks—not database client-side encryption.<br>
<br>- **E is Incorrect:** SSE-S3 encryption only protects objects stored inside the S3 bucket itself; it does not extend at-rest encryption to OpenSearch Serverless collections.<br>
<br>
<br>> **Key Takeaway:** Bedrock Knowledge Bases eliminates custom ETL compute (Lambda/Glue) for RAG ingestion, and OpenSearch Serverless requires encryption policies configured *before* collection creation. |
"""
questions_prompt_2 = """
Skill item for notes generation: {skill_item}
Domain review notes: {domain_review_notes}
"""
domain_review_notes_base_path = "../../official_doc/domain_review_notes"
questions_system_prompt = """
You are an AWS Examination expert and you are responsible in providing accurate and detailed answers to questions related to AWS services, architecture, and best practices.
Your responses should be clear, concise, and informative, catering to both beginners and experienced professionals in the field of cloud computing.
"""
questions_prompt_1 = """
You are now responsible in create practice questions for the AWS Certified Machine Learning - Associate (MLA-C02) exam.
You are provided with a single skill item from the AWS MLA-C02 exam syllabus.
You are also provided with a AWS domain review notes regarding the task item.
Your task is to create a set of 10 questions for that skill item, contained in a 2-column table structure.
Strict Rules for Question Formatting:
1. Scenario Structure:
- Each question must begin with a realistic enterprise business scenario (3–5 sentences).
- The scenario MUST specify clear constraints (e.g., "least operational overhead", "lowest latency", "most cost-effective solution", or "compliance with zero data retention").
- Frame the scenario around AWS native architecture (SageMaker, Bedrock, OpenSearch, Step Functions, Glue, S3, IAM, etc.).
2. Options (A, B, C, D, E):
- Provide exactly 4-5 options.
- There can be either 1 or more than 1 correct option. State in the question. (e.g. Select ONE/TWO that's applicable)
- The correct option(s) MUST be the objectively correct choice under the specified constraints.
- other options MUST be plausible distractors (they should sound like real AWS best practices, but violate a specific constraint, use a non-existent feature, or choose a higher-overhead architectural pattern).
3. Output Format for Each Question:
- Question Text
- Options A, B, C, D
- Correct Answer (Hidden or marked under a spoiler block)
- Detailed Explanation Breakdown:
* Correct Answer Analysis: Why it satisfies all requirements and constraints.
* Distractor Analysis: Explicitly explain why EACH incorrect option (Option A, B, etc.) is wrong (e.g., "Option B introduces unnecessary operational complexity", "Option C is invalid because Bedrock Titan doesn't support...").
* Exam Tip / AWS Best Practice: A 1-sentence key takeaway for quick revision.
- Do NOT use raw line breaks inside table cells (which breaks Markdown table rendering). Use HTML `<br>` tags for all line breaks and paragraph separations inside the table cells.
Header format:
# Skill 1.1.1: Extract data from data sources
---
Example question:
| Question | Answer & Explanation |
| --- | --- |
| **### Question 1 - Amazon Bedrock Knowledge Bases & OpenSearch Serverless Encryption**<br>
<br>
<br>An AI engineering team is configuring an automated ingestion pipeline for an enterprise knowledge base using **Amazon Bedrock Knowledge Bases** and **Amazon OpenSearch Serverless**.<br>
<br>
<br>The pipeline must parse unstructured PDF documents stored in an Amazon S3 bucket, generate vector embeddings, and store them in an encrypted vector collection. Compliance policies mandate that the vector index at rest must be encrypted using a customer-managed key (CMK) in **AWS KMS**, and operational maintenance must be minimized.<br>
<br>
<br>Which **TWO** steps should the engineer perform to fulfill these requirements? (Select TWO)<br>
<br>
<br>- **A)** Configure an S3 Event Notification to invoke an AWS Lambda function that parses PDFs using PyPDF and writes embeddings directly to OpenSearch.<br>
<br>- **B)** Create a Bedrock Knowledge Base data source pointing to the S3 bucket and trigger the ingestion job (`StartIngestionJob`).<br>
<br>- **C)** Define an encryption policy in Amazon OpenSearch Serverless specifying the KMS customer-managed key (CMK) ARN prior to creating the vector collection.<br>
<br>- **D)** Enable client-side encryption on the S3 bucket using Amazon Bedrock Guardrails before sending documents to the embedding model.<br>
<br>- **E)** Enable SSE-S3 default encryption on the source S3 bucket to automatically encrypt the downstream OpenSearch Serverless collection. | **Correct Answers:** **B** and **C**<br>
<br>
<br>**Correct Options Analysis:**<br>
<br>- **B is Correct:** Amazon Bedrock Knowledge Bases natively manages document parsing, semantic chunking, embedding generation, and indexing into OpenSearch Serverless without needing custom pipeline code.<br>
<br>- **C is Correct:** Encryption policies in OpenSearch Serverless must be defined before creating the collection. Setting the KMS CMK in the security policy guarantees at-rest encryption for the vector index.<br>
<br>
<br>**Distractor Analysis:**<br>
<br>- **A is Incorrect:** Writing custom Lambda code to parse PDFs and generate embeddings introduces unnecessary operational overhead compared to Bedrock's native ingestion job.<br>
<br>- **D is Incorrect:** Bedrock Guardrails handle content filtering, PII redaction, and safety checks—not database client-side encryption.<br>
<br>- **E is Incorrect:** SSE-S3 encryption only protects objects stored inside the S3 bucket itself; it does not extend at-rest encryption to OpenSearch Serverless collections.<br>
<br>
<br>> **Key Takeaway:** Bedrock Knowledge Bases eliminates custom ETL compute (Lambda/Glue) for RAG ingestion, and OpenSearch Serverless requires encryption policies configured *before* collection creation. |
"""
questions_prompt_2 = """
Skill item for notes generation: {skill_item}
Domain review notes: {domain_review_notes}
"""
domain_review_notes_base_path = "../../official_doc/domain_review_notes"
In [29]:
Copied!
with open("aws_mla_c02_skills.json", "r") as json_file:
skills_data = json.load(json_file)
with open("aws_mla_c02_skills.json", "r") as json_file:
skills_data = json.load(json_file)
In [32]:
Copied!
questions_output = []
for skill in skills_data:
start_time = time()
with open(f"{domain_review_notes_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.md", "r") as drn_file:
domain_review_notes = drn_file.read()
questions_prompt = questions_prompt_2.format(
skill_item=skill,
domain_review_notes=domain_review_notes
)
response = client.chat.completions.create(
model="z-ai/glm-5.2",
messages=[
{"role": "system", "content": questions_system_prompt},
{"role": "user", "content": questions_prompt_1},
{"role": "user", "content": questions_prompt}
],
max_completion_tokens=16384
)
study_note_content = response.choices[0].message.content
questions_output.append(study_note_content)
questions_output_base_path = "../practice_questions_tables"
output_path = f"{questions_output_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.{skill.get("skill_id", "")}.md"
with open(output_path, "w", encoding="utf-8") as questions_file:
questions_file.write(study_note_content)
print(f"Questions for skill {skill.get('skill_id', '')} saved to {output_path}. Time taken: {round(time() - start_time, 2)} seconds.")
questions_output = []
for skill in skills_data:
start_time = time()
with open(f"{domain_review_notes_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.md", "r") as drn_file:
domain_review_notes = drn_file.read()
questions_prompt = questions_prompt_2.format(
skill_item=skill,
domain_review_notes=domain_review_notes
)
response = client.chat.completions.create(
model="z-ai/glm-5.2",
messages=[
{"role": "system", "content": questions_system_prompt},
{"role": "user", "content": questions_prompt_1},
{"role": "user", "content": questions_prompt}
],
max_completion_tokens=16384
)
study_note_content = response.choices[0].message.content
questions_output.append(study_note_content)
questions_output_base_path = "../practice_questions_tables"
output_path = f"{questions_output_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.{skill.get("skill_id", "")}.md"
with open(output_path, "w", encoding="utf-8") as questions_file:
questions_file.write(study_note_content)
print(f"Questions for skill {skill.get('skill_id', '')} saved to {output_path}. Time taken: {round(time() - start_time, 2)} seconds.")
Questions for skill 1 saved to ../practice_questions_tables/1.1.1.md. Time taken: 29.84 seconds. Questions for skill 2 saved to ../practice_questions_tables/1.1.2.md. Time taken: 39.3 seconds. Questions for skill 3 saved to ../practice_questions_tables/1.1.3.md. Time taken: 36.57 seconds. Questions for skill 4 saved to ../practice_questions_tables/1.1.4.md. Time taken: 37.27 seconds. Questions for skill 5 saved to ../practice_questions_tables/1.1.5.md. Time taken: 59.26 seconds. Questions for skill 6 saved to ../practice_questions_tables/1.1.6.md. Time taken: 45.41 seconds. Questions for skill 7 saved to ../practice_questions_tables/1.1.7.md. Time taken: 55.64 seconds. Questions for skill 8 saved to ../practice_questions_tables/1.1.8.md. Time taken: 38.87 seconds. Questions for skill 9 saved to ../practice_questions_tables/1.1.9.md. Time taken: 35.62 seconds. Questions for skill 1 saved to ../practice_questions_tables/1.2.1.md. Time taken: 37.12 seconds. Questions for skill 2 saved to ../practice_questions_tables/1.2.2.md. Time taken: 49.62 seconds. Questions for skill 3 saved to ../practice_questions_tables/1.2.3.md. Time taken: 57.68 seconds. Questions for skill 4 saved to ../practice_questions_tables/1.2.4.md. Time taken: 53.77 seconds. Questions for skill 5 saved to ../practice_questions_tables/1.2.5.md. Time taken: 24.66 seconds. Questions for skill 6 saved to ../practice_questions_tables/1.2.6.md. Time taken: 30.73 seconds. Questions for skill 7 saved to ../practice_questions_tables/1.2.7.md. Time taken: 51.77 seconds. Questions for skill 8 saved to ../practice_questions_tables/1.2.8.md. Time taken: 29.57 seconds. Questions for skill 9 saved to ../practice_questions_tables/1.2.9.md. Time taken: 23.75 seconds. Questions for skill 1 saved to ../practice_questions_tables/1.3.1.md. Time taken: 30.02 seconds. Questions for skill 2 saved to ../practice_questions_tables/1.3.2.md. Time taken: 28.54 seconds. Questions for skill 3 saved to ../practice_questions_tables/1.3.3.md. Time taken: 108.92 seconds. Questions for skill 4 saved to ../practice_questions_tables/1.3.4.md. Time taken: 37.1 seconds. Questions for skill 5 saved to ../practice_questions_tables/1.3.5.md. Time taken: 49.96 seconds. Questions for skill 6 saved to ../practice_questions_tables/1.3.6.md. Time taken: 65.46 seconds. Questions for skill 7 saved to ../practice_questions_tables/1.3.7.md. Time taken: 57.47 seconds. Questions for skill 1 saved to ../practice_questions_tables/2.1.1.md. Time taken: 30.11 seconds. Questions for skill 2 saved to ../practice_questions_tables/2.1.2.md. Time taken: 64.94 seconds. Questions for skill 3 saved to ../practice_questions_tables/2.1.3.md. Time taken: 35.93 seconds. Questions for skill 4 saved to ../practice_questions_tables/2.1.4.md. Time taken: 23.9 seconds. Questions for skill 5 saved to ../practice_questions_tables/2.1.5.md. Time taken: 52.64 seconds. Questions for skill 6 saved to ../practice_questions_tables/2.1.6.md. Time taken: 30.92 seconds. Questions for skill 7 saved to ../practice_questions_tables/2.1.7.md. Time taken: 34.93 seconds. Questions for skill 8 saved to ../practice_questions_tables/2.1.8.md. Time taken: 29.75 seconds. Questions for skill 1 saved to ../practice_questions_tables/2.2.1.md. Time taken: 36.14 seconds. Questions for skill 2 saved to ../practice_questions_tables/2.2.2.md. Time taken: 43.65 seconds. Questions for skill 3 saved to ../practice_questions_tables/2.2.3.md. Time taken: 29.02 seconds. Questions for skill 4 saved to ../practice_questions_tables/2.2.4.md. Time taken: 62.35 seconds. Questions for skill 5 saved to ../practice_questions_tables/2.2.5.md. Time taken: 32.18 seconds. Questions for skill 6 saved to ../practice_questions_tables/2.2.6.md. Time taken: 43.51 seconds. Questions for skill 7 saved to ../practice_questions_tables/2.2.7.md. Time taken: 25.63 seconds. Questions for skill 8 saved to ../practice_questions_tables/2.2.8.md. Time taken: 41.12 seconds. Questions for skill 9 saved to ../practice_questions_tables/2.2.9.md. Time taken: 58.37 seconds. Questions for skill 1 saved to ../practice_questions_tables/2.3.1.md. Time taken: 33.86 seconds. Questions for skill 2 saved to ../practice_questions_tables/2.3.2.md. Time taken: 26.8 seconds. Questions for skill 3 saved to ../practice_questions_tables/2.3.3.md. Time taken: 32.91 seconds. Questions for skill 4 saved to ../practice_questions_tables/2.3.4.md. Time taken: 41.14 seconds. Questions for skill 5 saved to ../practice_questions_tables/2.3.5.md. Time taken: 41.69 seconds. Questions for skill 6 saved to ../practice_questions_tables/2.3.6.md. Time taken: 37.93 seconds. Questions for skill 7 saved to ../practice_questions_tables/2.3.7.md. Time taken: 27.19 seconds. Questions for skill 8 saved to ../practice_questions_tables/2.3.8.md. Time taken: 34.75 seconds. Questions for skill 9 saved to ../practice_questions_tables/2.3.9.md. Time taken: 57.53 seconds. Questions for skill 10 saved to ../practice_questions_tables/2.3.10.md. Time taken: 32.87 seconds. Questions for skill 1 saved to ../practice_questions_tables/3.1.1.md. Time taken: 28.95 seconds. Questions for skill 2 saved to ../practice_questions_tables/3.1.2.md. Time taken: 33.59 seconds. Questions for skill 3 saved to ../practice_questions_tables/3.1.3.md. Time taken: 35.62 seconds. Questions for skill 4 saved to ../practice_questions_tables/3.1.4.md. Time taken: 44.12 seconds. Questions for skill 5 saved to ../practice_questions_tables/3.1.5.md. Time taken: 59.09 seconds. Questions for skill 6 saved to ../practice_questions_tables/3.1.6.md. Time taken: 48.77 seconds. Questions for skill 7 saved to ../practice_questions_tables/3.1.7.md. Time taken: 37.75 seconds. Questions for skill 8 saved to ../practice_questions_tables/3.1.8.md. Time taken: 42.57 seconds. Questions for skill 1 saved to ../practice_questions_tables/3.2.1.md. Time taken: 49.62 seconds. Questions for skill 2 saved to ../practice_questions_tables/3.2.2.md. Time taken: 65.89 seconds. Questions for skill 3 saved to ../practice_questions_tables/3.2.3.md. Time taken: 77.09 seconds. Questions for skill 4 saved to ../practice_questions_tables/3.2.4.md. Time taken: 37.64 seconds. Questions for skill 5 saved to ../practice_questions_tables/3.2.5.md. Time taken: 55.21 seconds. Questions for skill 6 saved to ../practice_questions_tables/3.2.6.md. Time taken: 47.55 seconds. Questions for skill 7 saved to ../practice_questions_tables/3.2.7.md. Time taken: 41.87 seconds. Questions for skill 8 saved to ../practice_questions_tables/3.2.8.md. Time taken: 39.89 seconds. Questions for skill 9 saved to ../practice_questions_tables/3.2.9.md. Time taken: 48.69 seconds. Questions for skill 10 saved to ../practice_questions_tables/3.2.10.md. Time taken: 34.61 seconds. Questions for skill 11 saved to ../practice_questions_tables/3.2.11.md. Time taken: 36.4 seconds. Questions for skill 1 saved to ../practice_questions_tables/3.3.1.md. Time taken: 46.9 seconds. Questions for skill 2 saved to ../practice_questions_tables/3.3.2.md. Time taken: 68.25 seconds. Questions for skill 3 saved to ../practice_questions_tables/3.3.3.md. Time taken: 67.74 seconds. Questions for skill 4 saved to ../practice_questions_tables/3.3.4.md. Time taken: 92.22 seconds. Questions for skill 5 saved to ../practice_questions_tables/3.3.5.md. Time taken: 35.03 seconds. Questions for skill 6 saved to ../practice_questions_tables/3.3.6.md. Time taken: 36.69 seconds. Questions for skill 7 saved to ../practice_questions_tables/3.3.7.md. Time taken: 40.68 seconds. Questions for skill 8 saved to ../practice_questions_tables/3.3.8.md. Time taken: 38.76 seconds. Questions for skill 9 saved to ../practice_questions_tables/3.3.9.md. Time taken: 63.11 seconds. Questions for skill 10 saved to ../practice_questions_tables/3.3.10.md. Time taken: 68.63 seconds. Questions for skill 11 saved to ../practice_questions_tables/3.3.11.md. Time taken: 51.39 seconds. Questions for skill 1 saved to ../practice_questions_tables/4.1.1.md. Time taken: 56.48 seconds. Questions for skill 2 saved to ../practice_questions_tables/4.1.2.md. Time taken: 45.14 seconds. Questions for skill 3 saved to ../practice_questions_tables/4.1.3.md. Time taken: 73.27 seconds. Questions for skill 4 saved to ../practice_questions_tables/4.1.4.md. Time taken: 48.74 seconds. Questions for skill 5 saved to ../practice_questions_tables/4.1.5.md. Time taken: 68.8 seconds. Questions for skill 6 saved to ../practice_questions_tables/4.1.6.md. Time taken: 35.91 seconds. Questions for skill 1 saved to ../practice_questions_tables/4.2.1.md. Time taken: 41.96 seconds. Questions for skill 2 saved to ../practice_questions_tables/4.2.2.md. Time taken: 68.63 seconds. Questions for skill 3 saved to ../practice_questions_tables/4.2.3.md. Time taken: 53.09 seconds. Questions for skill 4 saved to ../practice_questions_tables/4.2.4.md. Time taken: 61.55 seconds. Questions for skill 5 saved to ../practice_questions_tables/4.2.5.md. Time taken: 51.52 seconds. Questions for skill 6 saved to ../practice_questions_tables/4.2.6.md. Time taken: 45.97 seconds. Questions for skill 7 saved to ../practice_questions_tables/4.2.7.md. Time taken: 44.05 seconds. Questions for skill 8 saved to ../practice_questions_tables/4.2.8.md. Time taken: 70.46 seconds. Questions for skill 9 saved to ../practice_questions_tables/4.2.9.md. Time taken: 61.66 seconds. Questions for skill 10 saved to ../practice_questions_tables/4.2.10.md. Time taken: 53.97 seconds. Questions for skill 1 saved to ../practice_questions_tables/4.3.1.md. Time taken: 58.08 seconds. Questions for skill 2 saved to ../practice_questions_tables/4.3.2.md. Time taken: 60.01 seconds. Questions for skill 3 saved to ../practice_questions_tables/4.3.3.md. Time taken: 110.89 seconds. Questions for skill 4 saved to ../practice_questions_tables/4.3.4.md. Time taken: 95.27 seconds. Questions for skill 5 saved to ../practice_questions_tables/4.3.5.md. Time taken: 35.47 seconds. Questions for skill 6 saved to ../practice_questions_tables/4.3.6.md. Time taken: 68.12 seconds. Questions for skill 7 saved to ../practice_questions_tables/4.3.7.md. Time taken: 71.56 seconds. Questions for skill 8 saved to ../practice_questions_tables/4.3.8.md. Time taken: 94.44 seconds. Questions for skill 9 saved to ../practice_questions_tables/4.3.9.md. Time taken: 66.51 seconds.
In [27]:
Copied!
questions_prompt = """
You are now responsible in create practice questions for the AWS Certified Machine Learning - Associate (MLA-C02) exam.
You are provided with a single skill item from the AWS MLA-C02 exam syllabus.
You are also provided with a AWS domain review notes regarding the task item.
Your task is to create a set of 10 questions for that skill item.
Strict Rules for Question Formatting:
1. Scenario Structure:
- Each question must begin with a realistic enterprise business scenario (3–5 sentences).
- The scenario MUST specify clear constraints (e.g., "least operational overhead", "lowest latency", "most cost-effective solution", or "compliance with zero data retention").
- Frame the scenario around AWS native architecture (SageMaker, Bedrock, OpenSearch, Step Functions, Glue, S3, IAM, etc.).
2. Options (A, B, C, D, E):
- Provide exactly 4-5 options.
- There can be either 1 or more than 1 correct option. State in the question. (e.g. Select ONE/TWO that's applicable)
- The correct option(s) MUST be the objectively correct choice under the specified constraints.
- other options MUST be plausible distractors (they should sound like real AWS best practices, but violate a specific constraint, use a non-existent feature, or choose a higher-overhead architectural pattern).
3. Output Format for Each Question:
- Question Text
- Options A, B, C, D
- Correct Answer (Hidden or marked under a spoiler block)
- Detailed Explanation Breakdown:
* Correct Answer Analysis: Why it satisfies all requirements and constraints.
* Distractor Analysis: Explicitly explain why EACH incorrect option (Option A, B, etc.) is wrong (e.g., "Option B introduces unnecessary operational complexity", "Option C is invalid because Bedrock Titan doesn't support...").
* Exam Tip / AWS Best Practice: A 1-sentence key takeaway for quick revision.
Header format:
# Skill 1.1.1: Extract data from data sources
Question:
---
| Questions | Answers |
| --------- | --------- |
| <content> | <content> |
Original question document is here:
{original_questions}
"""
practice_questions_base_path = "../practice_questions"
questions_content = []
domain_id = "1"
for skill in skills_data:
if skill.get("domain_id", "") != "1":
continue
with open(f"{practice_questions_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.{skill.get("skill_id", "")}.md", "r") as drn_file:
original_questions = drn_file.read()
questions_prompt = questions_prompt.format(original_questions=original_questions)
response = client.chat.completions.create(
model="x-ai/grok-4.7",
messages=[
{"role": "system", "content": questions_system_prompt},
{"role": "user", "content": questions_prompt}
],
max_completion_tokens=16384
)
study_note_content = response.choices[0].message.content
questions_content.append(study_note_content)
print(f"Questions for skill {skill.get('skill_id', '')} is reformatted.")
PAGE_BREAK = "\n\n---\n\n"
full_text = PAGE_BREAK.join(questions_content)
with open(f"{practice_questions_base_path}/{domain_id}.md", "w", encoding="utf-8") as f:
f.write(full_text)
questions_prompt = """
You are now responsible in create practice questions for the AWS Certified Machine Learning - Associate (MLA-C02) exam.
You are provided with a single skill item from the AWS MLA-C02 exam syllabus.
You are also provided with a AWS domain review notes regarding the task item.
Your task is to create a set of 10 questions for that skill item.
Strict Rules for Question Formatting:
1. Scenario Structure:
- Each question must begin with a realistic enterprise business scenario (3–5 sentences).
- The scenario MUST specify clear constraints (e.g., "least operational overhead", "lowest latency", "most cost-effective solution", or "compliance with zero data retention").
- Frame the scenario around AWS native architecture (SageMaker, Bedrock, OpenSearch, Step Functions, Glue, S3, IAM, etc.).
2. Options (A, B, C, D, E):
- Provide exactly 4-5 options.
- There can be either 1 or more than 1 correct option. State in the question. (e.g. Select ONE/TWO that's applicable)
- The correct option(s) MUST be the objectively correct choice under the specified constraints.
- other options MUST be plausible distractors (they should sound like real AWS best practices, but violate a specific constraint, use a non-existent feature, or choose a higher-overhead architectural pattern).
3. Output Format for Each Question:
- Question Text
- Options A, B, C, D
- Correct Answer (Hidden or marked under a spoiler block)
- Detailed Explanation Breakdown:
* Correct Answer Analysis: Why it satisfies all requirements and constraints.
* Distractor Analysis: Explicitly explain why EACH incorrect option (Option A, B, etc.) is wrong (e.g., "Option B introduces unnecessary operational complexity", "Option C is invalid because Bedrock Titan doesn't support...").
* Exam Tip / AWS Best Practice: A 1-sentence key takeaway for quick revision.
Header format:
# Skill 1.1.1: Extract data from data sources
Question:
---
| Questions | Answers |
| --------- | --------- |
| <content> | <content> |
Original question document is here:
{original_questions}
"""
practice_questions_base_path = "../practice_questions"
questions_content = []
domain_id = "1"
for skill in skills_data:
if skill.get("domain_id", "") != "1":
continue
with open(f"{practice_questions_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.{skill.get("skill_id", "")}.md", "r") as drn_file:
original_questions = drn_file.read()
questions_prompt = questions_prompt.format(original_questions=original_questions)
response = client.chat.completions.create(
model="x-ai/grok-4.7",
messages=[
{"role": "system", "content": questions_system_prompt},
{"role": "user", "content": questions_prompt}
],
max_completion_tokens=16384
)
study_note_content = response.choices[0].message.content
questions_content.append(study_note_content)
print(f"Questions for skill {skill.get('skill_id', '')} is reformatted.")
PAGE_BREAK = "\n\n---\n\n"
full_text = PAGE_BREAK.join(questions_content)
with open(f"{practice_questions_base_path}/{domain_id}.md", "w", encoding="utf-8") as f:
f.write(full_text)
Questions for skill 1 is reformatted. Questions for skill 2 is reformatted. Questions for skill 3 is reformatted. Questions for skill 4 is reformatted. Questions for skill 5 is reformatted. Questions for skill 6 is reformatted. Questions for skill 7 is reformatted. Questions for skill 8 is reformatted. Questions for skill 9 is reformatted. Questions for skill 1 is reformatted. Questions for skill 2 is reformatted. Questions for skill 3 is reformatted. Questions for skill 4 is reformatted. Questions for skill 5 is reformatted. Questions for skill 6 is reformatted. Questions for skill 7 is reformatted. Questions for skill 8 is reformatted. Questions for skill 9 is reformatted. Questions for skill 1 is reformatted. Questions for skill 2 is reformatted. Questions for skill 3 is reformatted. Questions for skill 4 is reformatted. Questions for skill 5 is reformatted. Questions for skill 6 is reformatted. Questions for skill 7 is reformatted.
Short Notes¶
In [9]:
Copied!
note_system_prompt = """
You are an AWS Examination expert and you are responsible in providing accurate and detailed answers to questions related to AWS services, architecture, and best practices.
Your responses should be clear, concise, and informative, catering to both beginners and experienced professionals in the field of cloud computing.
"""
note_prompt_1 = """
Act as a Senior AWS Machine Learning Architect specializing in the AWS Certified Machine Learning Engineer – Associate (MLA-C02) exam.
Generate a dense, scannable 1-page Markdown cheatsheet for the given skill item.
### Guidelines:
1. Scope & Density:
- Focus fully of the space on high-yield exam takeaways, architectural trade-offs, key configurations, and anti-patterns.
- DO NOT include any practice questions, sample exam scenarios, or quizzes.
- DO NOT include information related to SDK or code syntaxes. MLA-C02 exam is about implementations and concepts.
- DO NOT include introductory/conversational fluff (e.g., "Here is your cheatsheet"). Start directly with the main header.
2. Dynamic Layout (Adapt to Topic):
- Choose the subheadings and structural elements that best fit the topic rather than following a rigid template.
- Use Markdown tables for comparisons and decision matrices.
- Use bold lead-ins for bullet points so key terms stand out immediately for fast scanning.
- Use blockquotes (`>`) for critical "Exam Gotchas" or hard rules (e.g., default quotas, pre-requisites, non-negotiable settings).
3. Core Information Coverage (Include where relevant):
- Core concept & primary AWS business objective.
- Key APIs, SDK methods, CLI flags, or Boto3 parameter nuances.
- Security & Compliance (IAM roles, KMS encryption at rest/transit, VPC endpoints).
- "When to use X vs Y" trade-offs and common distractor traps.
Example header:
# Skill 1.1.1: {skill_name}
## Task 1.1: {domain_name} - {task_name}
"""
note_prompt_2 = """
Skill item for notes generation: {skill_item}
Domain review notes: {domain_review_notes}
"""
domain_review_notes_base_path = "../../official_doc/domain_review_notes"
note_system_prompt = """
You are an AWS Examination expert and you are responsible in providing accurate and detailed answers to questions related to AWS services, architecture, and best practices.
Your responses should be clear, concise, and informative, catering to both beginners and experienced professionals in the field of cloud computing.
"""
note_prompt_1 = """
Act as a Senior AWS Machine Learning Architect specializing in the AWS Certified Machine Learning Engineer – Associate (MLA-C02) exam.
Generate a dense, scannable 1-page Markdown cheatsheet for the given skill item.
### Guidelines:
1. Scope & Density:
- Focus fully of the space on high-yield exam takeaways, architectural trade-offs, key configurations, and anti-patterns.
- DO NOT include any practice questions, sample exam scenarios, or quizzes.
- DO NOT include information related to SDK or code syntaxes. MLA-C02 exam is about implementations and concepts.
- DO NOT include introductory/conversational fluff (e.g., "Here is your cheatsheet"). Start directly with the main header.
2. Dynamic Layout (Adapt to Topic):
- Choose the subheadings and structural elements that best fit the topic rather than following a rigid template.
- Use Markdown tables for comparisons and decision matrices.
- Use bold lead-ins for bullet points so key terms stand out immediately for fast scanning.
- Use blockquotes (`>`) for critical "Exam Gotchas" or hard rules (e.g., default quotas, pre-requisites, non-negotiable settings).
3. Core Information Coverage (Include where relevant):
- Core concept & primary AWS business objective.
- Key APIs, SDK methods, CLI flags, or Boto3 parameter nuances.
- Security & Compliance (IAM roles, KMS encryption at rest/transit, VPC endpoints).
- "When to use X vs Y" trade-offs and common distractor traps.
Example header:
# Skill 1.1.1: {skill_name}
## Task 1.1: {domain_name} - {task_name}
"""
note_prompt_2 = """
Skill item for notes generation: {skill_item}
Domain review notes: {domain_review_notes}
"""
domain_review_notes_base_path = "../../official_doc/domain_review_notes"
In [11]:
Copied!
notes_output = []
for skill in skills_data:
if skill.get("domain_id", "") not in ["3", "4"]:
continue
start_time = time()
with open(f"{domain_review_notes_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.md", "r") as drn_file:
domain_review_notes = drn_file.read()
note_prompt = note_prompt_2.format(skill_item=skill, domain_review_notes=domain_review_notes)
response = client.chat.completions.create(
model="deepseek/deepseek-v4.1-flash",
messages=[
{"role": "system", "content": note_system_prompt},
{"role": "user", "content": note_prompt_1},
{"role": "user", "content": note_prompt}
],
max_completion_tokens=16384
)
study_note_content = response.choices[0].message.content
notes_output.append(study_note_content)
note_output_base_path = "../short_notes_by_skills"
output_path = f"{note_output_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.{skill.get("skill_id", "")}.md"
with open(output_path, "w", encoding="utf-8") as notes_file:
notes_file.write(study_note_content)
print(f"Study notes for skill {skill.get('skill_id', '')} saved to {output_path}. Time taken: {round(time() - start_time, 2)} seconds.")
notes_output = []
for skill in skills_data:
if skill.get("domain_id", "") not in ["3", "4"]:
continue
start_time = time()
with open(f"{domain_review_notes_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.md", "r") as drn_file:
domain_review_notes = drn_file.read()
note_prompt = note_prompt_2.format(skill_item=skill, domain_review_notes=domain_review_notes)
response = client.chat.completions.create(
model="deepseek/deepseek-v4.1-flash",
messages=[
{"role": "system", "content": note_system_prompt},
{"role": "user", "content": note_prompt_1},
{"role": "user", "content": note_prompt}
],
max_completion_tokens=16384
)
study_note_content = response.choices[0].message.content
notes_output.append(study_note_content)
note_output_base_path = "../short_notes_by_skills"
output_path = f"{note_output_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.{skill.get("skill_id", "")}.md"
with open(output_path, "w", encoding="utf-8") as notes_file:
notes_file.write(study_note_content)
print(f"Study notes for skill {skill.get('skill_id', '')} saved to {output_path}. Time taken: {round(time() - start_time, 2)} seconds.")
Study notes for skill 1 saved to ../short_notes_by_skills/3.1.1.md. Time taken: 50.58 seconds. Study notes for skill 2 saved to ../short_notes_by_skills/3.1.2.md. Time taken: 63.8 seconds. Study notes for skill 3 saved to ../short_notes_by_skills/3.1.3.md. Time taken: 47.47 seconds. Study notes for skill 4 saved to ../short_notes_by_skills/3.1.4.md. Time taken: 55.12 seconds. Study notes for skill 5 saved to ../short_notes_by_skills/3.1.5.md. Time taken: 55.83 seconds. Study notes for skill 6 saved to ../short_notes_by_skills/3.1.6.md. Time taken: 62.0 seconds. Study notes for skill 7 saved to ../short_notes_by_skills/3.1.7.md. Time taken: 48.22 seconds. Study notes for skill 8 saved to ../short_notes_by_skills/3.1.8.md. Time taken: 33.39 seconds. Study notes for skill 1 saved to ../short_notes_by_skills/3.2.1.md. Time taken: 36.32 seconds. Study notes for skill 2 saved to ../short_notes_by_skills/3.2.2.md. Time taken: 55.09 seconds. Study notes for skill 3 saved to ../short_notes_by_skills/3.2.3.md. Time taken: 43.07 seconds. Study notes for skill 4 saved to ../short_notes_by_skills/3.2.4.md. Time taken: 63.69 seconds. Study notes for skill 5 saved to ../short_notes_by_skills/3.2.5.md. Time taken: 65.7 seconds. Study notes for skill 6 saved to ../short_notes_by_skills/3.2.6.md. Time taken: 68.35 seconds. Study notes for skill 7 saved to ../short_notes_by_skills/3.2.7.md. Time taken: 65.52 seconds. Study notes for skill 8 saved to ../short_notes_by_skills/3.2.8.md. Time taken: 59.79 seconds. Study notes for skill 9 saved to ../short_notes_by_skills/3.2.9.md. Time taken: 52.55 seconds. Study notes for skill 10 saved to ../short_notes_by_skills/3.2.10.md. Time taken: 40.25 seconds. Study notes for skill 11 saved to ../short_notes_by_skills/3.2.11.md. Time taken: 38.19 seconds. Study notes for skill 1 saved to ../short_notes_by_skills/3.3.1.md. Time taken: 58.61 seconds. Study notes for skill 2 saved to ../short_notes_by_skills/3.3.2.md. Time taken: 37.08 seconds. Study notes for skill 3 saved to ../short_notes_by_skills/3.3.3.md. Time taken: 36.72 seconds. Study notes for skill 4 saved to ../short_notes_by_skills/3.3.4.md. Time taken: 56.75 seconds. Study notes for skill 5 saved to ../short_notes_by_skills/3.3.5.md. Time taken: 55.88 seconds. Study notes for skill 6 saved to ../short_notes_by_skills/3.3.6.md. Time taken: 51.19 seconds. Study notes for skill 7 saved to ../short_notes_by_skills/3.3.7.md. Time taken: 62.91 seconds. Study notes for skill 8 saved to ../short_notes_by_skills/3.3.8.md. Time taken: 63.95 seconds. Study notes for skill 9 saved to ../short_notes_by_skills/3.3.9.md. Time taken: 44.42 seconds. Study notes for skill 10 saved to ../short_notes_by_skills/3.3.10.md. Time taken: 67.66 seconds. Study notes for skill 11 saved to ../short_notes_by_skills/3.3.11.md. Time taken: 51.58 seconds. Study notes for skill 1 saved to ../short_notes_by_skills/4.1.1.md. Time taken: 48.87 seconds. Study notes for skill 2 saved to ../short_notes_by_skills/4.1.2.md. Time taken: 44.27 seconds. Study notes for skill 3 saved to ../short_notes_by_skills/4.1.3.md. Time taken: 74.98 seconds. Study notes for skill 4 saved to ../short_notes_by_skills/4.1.4.md. Time taken: 41.08 seconds. Study notes for skill 5 saved to ../short_notes_by_skills/4.1.5.md. Time taken: 48.44 seconds. Study notes for skill 6 saved to ../short_notes_by_skills/4.1.6.md. Time taken: 52.84 seconds. Study notes for skill 1 saved to ../short_notes_by_skills/4.2.1.md. Time taken: 35.11 seconds. Study notes for skill 2 saved to ../short_notes_by_skills/4.2.2.md. Time taken: 50.97 seconds. Study notes for skill 3 saved to ../short_notes_by_skills/4.2.3.md. Time taken: 49.67 seconds. Study notes for skill 4 saved to ../short_notes_by_skills/4.2.4.md. Time taken: 41.37 seconds. Study notes for skill 5 saved to ../short_notes_by_skills/4.2.5.md. Time taken: 84.1 seconds. Study notes for skill 6 saved to ../short_notes_by_skills/4.2.6.md. Time taken: 46.32 seconds. Study notes for skill 7 saved to ../short_notes_by_skills/4.2.7.md. Time taken: 63.99 seconds. Study notes for skill 8 saved to ../short_notes_by_skills/4.2.8.md. Time taken: 30.53 seconds. Study notes for skill 9 saved to ../short_notes_by_skills/4.2.9.md. Time taken: 24.98 seconds. Study notes for skill 10 saved to ../short_notes_by_skills/4.2.10.md. Time taken: 27.28 seconds. Study notes for skill 1 saved to ../short_notes_by_skills/4.3.1.md. Time taken: 35.45 seconds. Study notes for skill 2 saved to ../short_notes_by_skills/4.3.2.md. Time taken: 57.7 seconds. Study notes for skill 3 saved to ../short_notes_by_skills/4.3.3.md. Time taken: 27.63 seconds. Study notes for skill 4 saved to ../short_notes_by_skills/4.3.4.md. Time taken: 85.61 seconds. Study notes for skill 5 saved to ../short_notes_by_skills/4.3.5.md. Time taken: 77.07 seconds. Study notes for skill 6 saved to ../short_notes_by_skills/4.3.6.md. Time taken: 105.19 seconds. Study notes for skill 7 saved to ../short_notes_by_skills/4.3.7.md. Time taken: 61.47 seconds. Study notes for skill 8 saved to ../short_notes_by_skills/4.3.8.md. Time taken: 65.06 seconds. Study notes for skill 9 saved to ../short_notes_by_skills/4.3.9.md. Time taken: 36.75 seconds.
In [25]:
Copied!
all_notes_content = []
domain_id = "4"
combined_note_output_base_path = "../short_notes_combined"
for skill in skills_data:
if skill.get("domain_id", "") != domain_id:
continue
with open(f"{note_output_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.{skill.get("skill_id", "")}.md", "r", encoding="utf-8") as drn_file:
domain_review_notes = drn_file.read()
all_notes_content.append(domain_review_notes)
PAGE_BREAK = "\n\n---\n\n"
full_text = PAGE_BREAK.join(all_notes_content)
with open(f"{combined_note_output_base_path}/{domain_id}.md", "w", encoding="utf-8") as f:
f.write(full_text)
all_notes_content = []
domain_id = "4"
combined_note_output_base_path = "../short_notes_combined"
for skill in skills_data:
if skill.get("domain_id", "") != domain_id:
continue
with open(f"{note_output_base_path}/{skill.get("domain_id", "")}.{skill.get("task_id", "")}.{skill.get("skill_id", "")}.md", "r", encoding="utf-8") as drn_file:
domain_review_notes = drn_file.read()
all_notes_content.append(domain_review_notes)
PAGE_BREAK = "\n\n---\n\n"
full_text = PAGE_BREAK.join(all_notes_content)
with open(f"{combined_note_output_base_path}/{domain_id}.md", "w", encoding="utf-8") as f:
f.write(full_text)
Question to markdown for revision¶
In [37]:
Copied!
note_system_prompt = """
You are an AWS Examination expert and you are responsible in providing accurate and detailed answers to questions related to AWS services, architecture, and best practices.
Your responses should be clear, concise, and informative, catering to both beginners and experienced professionals in the field of cloud computing.
"""
example_output_prompt = """
Example output:
### Question: <topic covered>
**Category:** <domain 1-4 of exam as provided>
**Review Bucket:** [ ] Bucket A (Term Mapping) | [ ] Bucket B (Missed Constraint) | [ ] Bucket C (Knowledge Gap) <Note: do not fill in the checkbox>
A media company runs machine learning workloads in Amazon SageMaker AI for several internal business units. Each unit receives a predetermined AWS spending allowance every month, and resources are labeled with department-specific tags so that costs can be tracked separately.
Finance wants an automated way to notify each business unit **before** its **projected** monthly charges surpass its assigned spending limit, with **minimal administrative effort**.
What solution should be implemented?
* **A)** Create an AWS Cost Anomaly Detection monitor for each business unit. Scope each monitor by the cost allocation tags associated with the corresponding unit. Configure alert subscriptions to notify the unit when unusual spending patterns are detected during the month.
* **B)** Configure a fixed budget in AWS Budgets for each business unit. Filter the budget by user-defined cost allocation tags assigned to each unit. Send an alert when forecasted monthly charges are expected to exceed the configured spending threshold.
* **C)** Configure an auto-adjusting budget in AWS Budgets for each business unit. Filter the budget by AWS-generated cost allocation tags associated with each unit. Configure daily budget reports to provide updates on departmental spending.
* **D)** Create a fixed budget in AWS Budgets for each business unit and filter the budget by user-defined cost allocation tags. Configure the budget to publish a notification to an Amazon SNS topic when actual monthly spending reaches the assigned limit. Subscribe an AWS Lambda function to the SNS topic to process the event and notify the corresponding business unit.
??? note "Click to reveal Answer & Explanation"
**Correct Answer:** **B**
#### Correct Option Analysis
* **B is Correct:** AWS Budgets allows setting custom budget thresholds filtered by **user-defined cost allocation tags** (custom tags added by the team, like `Department: Marketing`). It natively supports alerts based on **forecasted** costs (notifying users *before* the limit is hit) without writing custom code or serverless infrastructure.
#### Distractor Analysis
* **A is Incorrect:** AWS Cost Anomaly Detection identifies unexpected spending spikes based on historical trends; it does not track spending against a fixed monthly budget cap or send alerts based on forecasted monthly totals.
* **C is Incorrect:** Auto-adjusting budgets dynamically change based on spending patterns over time, which violates the requirement for a *predetermined monthly allowance*. Furthermore, custom tags applied by business units are *user-defined*, not *AWS-generated*.
* **D is Incorrect:** This option uses *actual* spending (which alerts *after* the limit is reached instead of *before*) and introduces unnecessary operational overhead by building a custom Lambda + SNS processing pipeline when AWS Budgets natively supports email/SNS notifications.
> **Key Takeaway:** For cost alerts **before** exceeding a limit, choose **AWS Budgets with Forecasted alerts**. Avoid custom Lambda pipelines when native AWS service alerts exist ("minimal operational effort").
??? warning "self-notes"
<space for user to write self notes>
---
"""
note_prompt = """
You are provided with a unformatted exam question of AWS MLA-C02 exam.
You are now responsible in turning it into markdown format and add explanation to correct and incorrect answers.
Do not include extra explanation or opening/closing, only output the question and explanation in proper markdown format.
The Answer and explanation should be in collapsible format as enclosed.
"""
note_system_prompt = """
You are an AWS Examination expert and you are responsible in providing accurate and detailed answers to questions related to AWS services, architecture, and best practices.
Your responses should be clear, concise, and informative, catering to both beginners and experienced professionals in the field of cloud computing.
"""
example_output_prompt = """
Example output:
### Question: <topic covered>
**Category:** <domain 1-4 of exam as provided>
**Review Bucket:** [ ] Bucket A (Term Mapping) | [ ] Bucket B (Missed Constraint) | [ ] Bucket C (Knowledge Gap) <Note: do not fill in the checkbox>
A media company runs machine learning workloads in Amazon SageMaker AI for several internal business units. Each unit receives a predetermined AWS spending allowance every month, and resources are labeled with department-specific tags so that costs can be tracked separately.
Finance wants an automated way to notify each business unit **before** its **projected** monthly charges surpass its assigned spending limit, with **minimal administrative effort**.
What solution should be implemented?
* **A)** Create an AWS Cost Anomaly Detection monitor for each business unit. Scope each monitor by the cost allocation tags associated with the corresponding unit. Configure alert subscriptions to notify the unit when unusual spending patterns are detected during the month.
* **B)** Configure a fixed budget in AWS Budgets for each business unit. Filter the budget by user-defined cost allocation tags assigned to each unit. Send an alert when forecasted monthly charges are expected to exceed the configured spending threshold.
* **C)** Configure an auto-adjusting budget in AWS Budgets for each business unit. Filter the budget by AWS-generated cost allocation tags associated with each unit. Configure daily budget reports to provide updates on departmental spending.
* **D)** Create a fixed budget in AWS Budgets for each business unit and filter the budget by user-defined cost allocation tags. Configure the budget to publish a notification to an Amazon SNS topic when actual monthly spending reaches the assigned limit. Subscribe an AWS Lambda function to the SNS topic to process the event and notify the corresponding business unit.
??? note "Click to reveal Answer & Explanation"
**Correct Answer:** **B**
#### Correct Option Analysis
* **B is Correct:** AWS Budgets allows setting custom budget thresholds filtered by **user-defined cost allocation tags** (custom tags added by the team, like `Department: Marketing`). It natively supports alerts based on **forecasted** costs (notifying users *before* the limit is hit) without writing custom code or serverless infrastructure.
#### Distractor Analysis
* **A is Incorrect:** AWS Cost Anomaly Detection identifies unexpected spending spikes based on historical trends; it does not track spending against a fixed monthly budget cap or send alerts based on forecasted monthly totals.
* **C is Incorrect:** Auto-adjusting budgets dynamically change based on spending patterns over time, which violates the requirement for a *predetermined monthly allowance*. Furthermore, custom tags applied by business units are *user-defined*, not *AWS-generated*.
* **D is Incorrect:** This option uses *actual* spending (which alerts *after* the limit is reached instead of *before*) and introduces unnecessary operational overhead by building a custom Lambda + SNS processing pipeline when AWS Budgets natively supports email/SNS notifications.
> **Key Takeaway:** For cost alerts **before** exceeding a limit, choose **AWS Budgets with Forecasted alerts**. Avoid custom Lambda pipelines when native AWS service alerts exist ("minimal operational effort").
??? warning "self-notes"
<space for user to write self notes>
---
"""
note_prompt = """
You are provided with a unformatted exam question of AWS MLA-C02 exam.
You are now responsible in turning it into markdown format and add explanation to correct and incorrect answers.
Do not include extra explanation or opening/closing, only output the question and explanation in proper markdown format.
The Answer and explanation should be in collapsible format as enclosed.
"""
In [38]:
Copied!
with open("./raw_question.txt", "r", encoding="utf-8") as f:
question_raw_content = f.read()
with open("./raw_question.txt", "r", encoding="utf-8") as f:
question_raw_content = f.read()
In [40]:
Copied!
response = client.chat.completions.create(
model="deepseek/deepseek-v4-pro-0813",
messages=[
{"role": "system", "content": note_system_prompt},
{"role": "user", "content": note_prompt},
{"role": "user", "content": example_output_prompt},
{"role": "user", "content": "The raw question is as follows:"},
{"role": "user", "content": question_raw_content},
],
max_completion_tokens=4096
)
study_note_content = response.choices[0].message.content
with open("./question_output.txt", "w", encoding="utf-8") as f:
f.write(study_note_content)
response = client.chat.completions.create(
model="deepseek/deepseek-v4-pro-0813",
messages=[
{"role": "system", "content": note_system_prompt},
{"role": "user", "content": note_prompt},
{"role": "user", "content": example_output_prompt},
{"role": "user", "content": "The raw question is as follows:"},
{"role": "user", "content": question_raw_content},
],
max_completion_tokens=4096
)
study_note_content = response.choices[0].message.content
with open("./question_output.txt", "w", encoding="utf-8") as f:
f.write(study_note_content)