Skip to content
Open
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
411 changes: 385 additions & 26 deletions 1_foundations/1_lab1.ipynb

Large diffs are not rendered by default.

35 changes: 29 additions & 6 deletions 1_foundations/2_lab2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -45,19 +45,42 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Always remember to do this!\n",
"load_dotenv(override=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"OpenAI API Key exists and begins sk-proj-\n",
"Anthropic API Key not set (and this is optional)\n",
"Google API Key not set (and this is optional)\n",
"DeepSeek API Key not set (and this is optional)\n",
"Groq API Key not set (and this is optional)\n"
]
}
],
"source": [
"# Print the key prefixes to help with any debugging\n",
"\n",
Expand Down Expand Up @@ -484,7 +507,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.9"
"version": "3.12.12"
}
},
"nbformat": 4,
Expand Down
289 changes: 262 additions & 27 deletions 1_foundations/3_lab3.ipynb

Large diffs are not rendered by default.

144 changes: 119 additions & 25 deletions 1_foundations/4_lab4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -47,7 +47,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -59,9 +59,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 21,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Pushover user found and starts with u\n",
"Pushover token found and starts with a\n"
]
}
],
"source": [
"# For pushover\n",
"\n",
Expand All @@ -82,7 +91,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -94,16 +103,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 23,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Push: HEY!!\n"
]
}
],
"source": [
"push(\"HEY!!\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -114,7 +131,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -125,7 +142,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -157,7 +174,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -180,7 +197,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -190,16 +207,46 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 29,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"[{'type': 'function',\n",
" 'function': {'name': 'record_user_details',\n",
" 'description': 'Use this tool to record that a user is interested in being in touch and provided an email address',\n",
" 'parameters': {'type': 'object',\n",
" 'properties': {'email': {'type': 'string',\n",
" 'description': 'The email address of this user'},\n",
" 'name': {'type': 'string',\n",
" 'description': \"The user's name, if they provided it\"},\n",
" 'notes': {'type': 'string',\n",
" 'description': \"Any additional information about the conversation that's worth recording to give context\"}},\n",
" 'required': ['email'],\n",
" 'additionalProperties': False}}},\n",
" {'type': 'function',\n",
" 'function': {'name': 'record_unknown_question',\n",
" 'description': \"Always use this tool to record any question that couldn't be answered as you didn't know the answer\",\n",
" 'parameters': {'type': 'object',\n",
" 'properties': {'question': {'type': 'string',\n",
" 'description': \"The question that couldn't be answered\"}},\n",
" 'required': ['question'],\n",
" 'additionalProperties': False}}}]"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"tools"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -225,16 +272,34 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 31,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Push: Recording this is a really hard question asked that I couldn't answer\n"
]
},
{
"data": {
"text/plain": [
"{'recorded': 'ok'}"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"globals()[\"record_unknown_question\"](\"this is a really hard question\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 32,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -254,7 +319,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 33,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -268,12 +333,12 @@
"with open(\"me/summary.txt\", \"r\", encoding=\"utf-8\") as f:\n",
" summary = f.read()\n",
"\n",
"name = \"Ed Donner\""
"name = \"Keerthi Bheemagani\""
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 34,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -291,7 +356,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -321,9 +386,38 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 36,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"* Running on local URL: http://127.0.0.1:7861\n",
"* To create a public link, set `share=True` in `launch()`.\n"
]
},
{
"data": {
"text/html": [
"<div><iframe src=\"http://127.0.0.1:7861/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": []
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gr.ChatInterface(chat, type=\"messages\").launch()"
]
Expand Down Expand Up @@ -442,7 +536,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.9"
"version": "3.12.12"
}
},
"nbformat": 4,
Expand Down
Loading