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
38 changes: 33 additions & 5 deletions 1_foundations/1_lab1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
"outputs": [],
"source": [
"# First let's do an import. If you get an Import Error, double check that your Kernel is correct..\n",
"\n",
"from dotenv import load_dotenv\n"
]
},
Expand Down Expand Up @@ -324,15 +323,44 @@
"source": [
"# First create the messages:\n",
"\n",
"messages = [{\"role\": \"user\", \"content\": \"Something here\"}]\n",
"messages = [{\"role\": \"user\", \"content\": \"AIエージェントが最も活躍しそうなビジネス分野を1つだけ教えてください.\"}]\n",
"\n",
"# Then make the first call:\n",
"\n",
"response =\n",
"question = openai.chat.completions.create(\n",
" model=\"gpt-4.1-mini\",\n",
" messages=messages\n",
")\n",
"\n",
"answer = question.choices[0].message.content\n",
"\n",
"print(answer)\n",
"\n",
"\n",
"messages = [{\"role\": \"user\", \"content\": f\"{answer}での課題はなんですか?\"}]\n",
"\n",
"\n",
"question = openai.chat.completions.create(\n",
" model =\"gpt-4.1-mini\",\n",
" messages=messages\n",
")\n",
"\n",
"reply = question.choices[0].message.content\n",
"\n",
"print(reply)\n",
"\n",
"# Then read the business idea:\n",
"\n",
"business_idea = response.\n",
"messages = [{\"role\": \"user\", \"content\": f\"{reply}に対してAIエージェントでのソリューションを提案してください。\"}]\n",
"\n",
"response = openai.chat.completions.create(\n",
" model=\"gpt-4.1-mini\",\n",
" messages=messages\n",
")\n",
"\n",
"business_idea = response.choices[0].message.content\n",
"\n",
"print(business_idea)\n",
"\n",
"# And repeat! In the next message, include the business idea within the message"
]
Expand All @@ -359,7 +387,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.9"
"version": "3.12.0"
}
},
"nbformat": 4,
Expand Down
22 changes: 17 additions & 5 deletions 1_foundations/2_lab2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Start with imports - ask ChatGPT to explain any package that you don't know\n",
"\n",
"import os\n",
"import json\n",
"from dotenv import load_dotenv\n",
"from dotenv import load_dotenvs\n",
"from openai import OpenAI\n",
"from anthropic import Anthropic\n",
"from IPython.display import Markdown, display"
Expand All @@ -55,9 +55,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"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 @@ -466,7 +478,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.9"
"version": "3.12.0"
}
},
"nbformat": 4,
Expand Down
Binary file added 1_foundations/me/replace.pdf
Binary file not shown.