Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 45 additions & 32 deletions 01_materials/labs/01_1_introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 1,
"id": "6accefb4",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -214,7 +214,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"2026-04-09 23:05:52,863, 999434666.py, 1, INFO, This is a log message.\n"
"2026-05-01 05:47:45,661, 999434666.py, 1, INFO, This is a log message.\n"
]
}
],
Expand Down Expand Up @@ -244,7 +244,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"id": "71fc7085",
"metadata": {},
"outputs": [
Expand All @@ -254,7 +254,7 @@
"True"
]
},
"execution_count": 7,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -274,13 +274,24 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 7,
"id": "e800ba21",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"'l6T8LmqrDtwSyFroiVgIBUeotbiJWXxM'"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#import os\n",
"#os.getenv(\"API_GATEWAY_KEY\")"
"import os\n",
"os.getenv(\"API_GATEWAY_KEY\")"
]
},
{
Expand All @@ -293,7 +304,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 8,
"id": "b76030d2",
"metadata": {},
"outputs": [],
Expand All @@ -313,7 +324,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 9,
"id": "99b8d22a",
"metadata": {},
"outputs": [
Expand All @@ -323,7 +334,7 @@
"'INFO'"
]
},
"execution_count": 11,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -367,7 +378,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 14,
"id": "9fecd195",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -396,22 +407,22 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 11,
"id": "ed011ec6",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'id': 'resp_008b1a0d22deae5c0069d86b0e6cf881959c4fecf87effdd7d',\n",
" 'created_at': 1775790862.0,\n",
"{'id': 'resp_08e9dd6449ca0f9c0069f47713f3e4819486da32a04d8077b3',\n",
" 'created_at': 1777628947.0,\n",
" 'error': None,\n",
" 'incomplete_details': None,\n",
" 'instructions': None,\n",
" 'metadata': {},\n",
" 'model': 'gpt-4o-mini-2024-07-18',\n",
" 'object': 'response',\n",
" 'output': [{'id': 'msg_008b1a0d22deae5c0069d86b0fa9d48195987d143c319a2a84',\n",
" 'output': [{'id': 'msg_08e9dd6449ca0f9c0069f47714873c8194aa3b040d49826d2c',\n",
" 'content': [{'annotations': [],\n",
" 'text': 'Hello! How can I assist you today?',\n",
" 'type': 'output_text',\n",
Expand Down Expand Up @@ -445,14 +456,15 @@
" 'total_tokens': 20},\n",
" 'user': None,\n",
" 'billing': {'payer': 'developer'},\n",
" 'completed_at': 1775790863,\n",
" 'completed_at': 1777628948,\n",
" 'frequency_penalty': 0.0,\n",
" 'moderation': None,\n",
" 'presence_penalty': 0.0,\n",
" 'prompt_cache_retention': None,\n",
" 'prompt_cache_retention': 'in_memory',\n",
" 'store': True}"
]
},
"execution_count": 13,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -463,7 +475,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 13,
"id": "b5c6edee",
"metadata": {},
"outputs": [
Expand All @@ -473,7 +485,7 @@
"[ResponseOutputText(annotations=[], text='Hello! How can I assist you today?', type='output_text', logprobs=[])]"
]
},
"execution_count": 14,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -505,8 +517,8 @@
"metadata": {},
"outputs": [],
"source": [
"# from openai import OpenAI\n",
"# client = OpenAI()"
"from openai import OpenAI\n",
"client = OpenAI()"
]
},
{
Expand Down Expand Up @@ -625,22 +637,22 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 21,
"id": "8e46b505",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'id': 'resp_0068b0b4853d61740069d86c6acb948194bee4f233cc5141e4',\n",
" 'created_at': 1775791210.0,\n",
"{'id': 'resp_0517b3247fb6ff960069f47c959d5881969b8e9b102a550829',\n",
" 'created_at': 1777630357.0,\n",
" 'error': None,\n",
" 'incomplete_details': None,\n",
" 'instructions': None,\n",
" 'metadata': {},\n",
" 'model': 'gpt-4o-mini-2024-07-18',\n",
" 'object': 'response',\n",
" 'output': [{'id': 'msg_0068b0b4853d61740069d86c6bd4e88194803a0c6da6f8ff61',\n",
" 'output': [{'id': 'msg_0517b3247fb6ff960069f47c9613d481969773a180f2a7e4b7',\n",
" 'content': [{'annotations': [],\n",
" 'text': 'Hello! How can I assist you today?',\n",
" 'type': 'output_text',\n",
Expand Down Expand Up @@ -674,14 +686,15 @@
" 'total_tokens': 20},\n",
" 'user': None,\n",
" 'billing': {'payer': 'developer'},\n",
" 'completed_at': 1775791212,\n",
" 'completed_at': 1777630358,\n",
" 'frequency_penalty': 0.0,\n",
" 'moderation': None,\n",
" 'presence_penalty': 0.0,\n",
" 'prompt_cache_retention': None,\n",
" 'prompt_cache_retention': 'in_memory',\n",
" 'store': True}"
]
},
"execution_count": 20,
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -705,7 +718,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "deploying-ai-env",
"display_name": "deploying-ai-env (3.12.13)",
"language": "python",
"name": "python3"
},
Expand All @@ -719,7 +732,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.12"
"version": "3.12.13"
}
},
"nbformat": 4,
Expand Down
59 changes: 43 additions & 16 deletions 01_materials/labs/01_2_longer_context.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@
{
"data": {
"text/plain": [
"{'date': 'Fri, 10 Apr 2026 03:30:32 GMT',\n",
"{'date': 'Fri, 01 May 2026 10:22:02 GMT',\n",
" 'server': 'Apache',\n",
" 'last-modified': 'Wed, 01 Apr 2026 08:38:34 GMT',\n",
" 'last-modified': 'Fri, 01 May 2026 08:41:47 GMT',\n",
" 'accept-ranges': 'bytes',\n",
" 'content-length': '434828',\n",
" 'x-backend': 'gutenweb5',\n",
" 'x-backend': 'gutenweb1',\n",
" 'content-type': 'text/plain; charset=utf-8'}"
]
},
Expand Down Expand Up @@ -8102,6 +8102,33 @@
")\n"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "1eff2ba3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"**Title:** The Wisdom of Father Brown \n",
"**Author:** G. K. Chesterton \n",
"**Number of Stories:** 12 \n",
"\n",
"**Summary:** \n",
"In \"The Absence of Mr Glass,\" Father Brown encounters Dr. Orion Hood, a criminologist, in Scarborough. Their meeting is interrupted by Father Brown seeking help for a young couple, Maggie MacNab and Todhunter, who wish to get married but face opposition from Maggie's mother. Brown's innocent demeanor and candid explanations amuse Hood, who later agrees to help.\n",
"\n",
"As the story unfolds, Maggie rushes in to report that Todhunter has been potentially harmed. She heard two voices arguing through a locked door, and Brown quickly decides to investigate. Upon entering Todhunter's room, they find him tied up and his captor, a mysterious man named Glass, is missing, creating a baffling situation surrounding Todhunter's unusual behavior and secretive nature.\n",
"\n",
"Dr. Hood and Father Brown deduce that Todhunter's predicament involves a scheme of blackmail related to his mysterious past and a connection to Mr. Glass. Father Brown's instinctive wisdom leads to the unraveling of Todhunter's situation, revealing that he was merely practicing ventriloquism and magic tricks, which clarified the misunderstandings around him. The conclusion showcases Father Brown’s intuitive grasp of human nature, solidifying his role as a humble yet insightful investigator of moral quandaries.\n"
]
}
],
"source": [
"print(response.output_text)"
]
},
{
"cell_type": "markdown",
"id": "08e87e15",
Expand All @@ -8112,23 +8139,23 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 14,
"id": "86928b2a",
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"Title: The Wisdom of Father Brown \n",
"Author: G. K. Chesterton \n",
"Number of Stories: 12 \n",
"**Title:** The Wisdom of Father Brown \n",
"**Author:** G. K. Chesterton \n",
"**Number of Stories:** 12 \n",
"\n",
"Summary: \n",
"In \"The Absence of Mr Glass,\" a priest named Father Brown visits Dr. Orion Hood, a criminologist, to discuss a mysterious young lodger named Todhunter, who is romantically involved with Maggie MacNab, despite her mother’s disapproval. The narrative shifts as a young woman, Maggie, rushes in, claiming that Todhunter has been murdered and that a man named Mr. Glass was present at the scene. \n",
"**Summary:** \n",
"In \"The Absence of Mr Glass,\" Father Brown encounters Dr. Orion Hood, a criminologist, in Scarborough. Their meeting is interrupted by Father Brown seeking help for a young couple, Maggie MacNab and Todhunter, who wish to get married but face opposition from Maggie's mother. Brown's innocent demeanor and candid explanations amuse Hood, who later agrees to help.\n",
"\n",
"As they investigate the situation, Dr. Hood deduces that Todhunter seems to be the victim of blackmail, with evidence indicating that Mr. Glass may have been the blackmailer. However, upon entering Todhunter's room, they find him bound but alive, suggesting a much deeper complexity to the situation. The story unfolds with revelations about Todhunter's true identity as a conjurer, leaping from a state of mystery to the humorous denouement involving his practice tricks gone awry.\n",
"As the story unfolds, Maggie rushes in to report that Todhunter has been potentially harmed. She heard two voices arguing through a locked door, and Brown quickly decides to investigate. Upon entering Todhunter's room, they find him tied up and his captor, a mysterious man named Glass, is missing, creating a baffling situation surrounding Todhunter's unusual behavior and secretive nature.\n",
"\n",
"In the end, Father Brown unravels the misunderstood events, showing that Todhunter had merely been rehearsing and that no murder had taken place, highlighting themes of assumption versus reality, and the curious workings of human motives. The resolution evokes laughter and satisfaction, infusing the tale with Chesterton's characteristic wit while revealing deeper truths about character and perception."
"Dr. Hood and Father Brown deduce that Todhunter's predicament involves a scheme of blackmail related to his mysterious past and a connection to Mr. Glass. Father Brown's instinctive wisdom leads to the unraveling of Todhunter's situation, revealing that he was merely practicing ventriloquism and magic tricks, which clarified the misunderstandings around him. The conclusion showcases Father Brown’s intuitive grasp of human nature, solidifying his role as a humble yet insightful investigator of moral quandaries."
],
"text/plain": [
"<IPython.core.display.Markdown object>"
Expand Down Expand Up @@ -8160,7 +8187,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 15,
"id": "f9bb5a80",
"metadata": {},
"outputs": [],
Expand All @@ -8170,7 +8197,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 16,
"id": "f5942d14",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -8213,7 +8240,7 @@
{
"data": {
"text/markdown": [
"¡Oye, escucha! La historia de los hormigas nos dice que siempre hay que estar contento con lo que uno tiene. Las hormigas eran hombres, pero el deseo de robar lo ajeno las llevó a su perdición. Así que, si sigues buscando lo que no es tuyo, puedes perderlo todo. ¡Valora tu trabajo y sé agradecido, bro! ¡Así se vive mejor! 🌟"
"Claro, mi gente, listen up! The vibe of this fable is all about being greedy, ya know? Ants were once like us, but their jealousy and desire for what others had got them in a tight spot. Jupiter got mad and turned them into ants, but their instinct to take from others didn't change. So the main message is: **Greed can lead to your downfall, and if you don’t change your ways, you’re just gonna keep facing the same karma.** Keep it real, work for what you got! 🐜✨"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
Expand All @@ -8232,7 +8259,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "deploying-ai-env",
"display_name": "deploying-ai-env (3.12.13)",
"language": "python",
"name": "python3"
},
Expand All @@ -8246,7 +8273,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.12"
"version": "3.12.13"
}
},
"nbformat": 4,
Expand Down
Loading
Loading