Skip to content

Commit 8b5edcc

Browse files
committed
add issue formatter notebook
1 parent a820819 commit 8b5edcc

File tree

1 file changed

+124
-0
lines changed

1 file changed

+124
-0
lines changed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"id": "8c3fc72d-5014-41f9-ad2f-5696a057acfe",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"from dotenv import load_dotenv\n",
11+
"\n",
12+
"_ = load_dotenv(\n",
13+
" override=True,\n",
14+
" verbose=True,\n",
15+
")"
16+
]
17+
},
18+
{
19+
"cell_type": "code",
20+
"execution_count": 2,
21+
"id": "a96ceb73-447d-44b6-ba96-f5fa9f591b70",
22+
"metadata": {},
23+
"outputs": [],
24+
"source": [
25+
"from template_langgraph.agents.issue_formatter_agent.agent import IssueFormatterAgent\n",
26+
"\n",
27+
"# Create an instance of the agent\n",
28+
"agent = IssueFormatterAgent().create_graph()"
29+
]
30+
},
31+
{
32+
"cell_type": "code",
33+
"execution_count": 3,
34+
"id": "c23a49b7-a3e9-4685-899e-3e7c02278360",
35+
"metadata": {},
36+
"outputs": [
37+
{
38+
"name": "stdout",
39+
"output_type": "stream",
40+
"text": [
41+
"--------------------\n",
42+
"Event: {'analyze': {'messages': [HumanMessage(content='KABUTOにログインできない!パスワードは合ってるはずなのに…若手社員である山田太郎は、Windows 11 を立ち上げ、日課のように自社の業務システムKABUTOのログイン画面を開きます。しかし、そこには、意味をなさない「虚無」という文字だけがただひっそりと表示されていたのです。これは質問でもあり不具合の報告でもあります。岡本太郎さんに本件調査依頼します。', additional_kwargs={}, response_metadata={}, id='27af67f0-29a1-466f-a85a-0789660771bc')], 'issue': Issue(title='KABUTOログイン問題', description='若手社員の山田太郎さんがWindows 11環境で自社業務システムKABUTOにログインしようとした際、ログイン画面に「虚無」という文字が表示され、ログインできない問題が発生しました。', labels=[<IssueLabel.BUG: 'bug'>, <IssueLabel.QUESTION: 'question'>], assignee='岡本太郎', milestone=None, system_info=SystemInfo(os='Windows 11', version=None), steps_to_reproduce=['Windows 11を起動する', 'KABUTOのログイン画面を開く', 'ログインを試みる'], current_behavior='ログイン画面に「虚無」という文字が表示される', expected_behavior='正常にログインできる')}}\n"
43+
]
44+
}
45+
],
46+
"source": [
47+
"question = \"KABUTOにログインできない!パスワードは合ってるはずなのに…若手社員である山田太郎は、Windows 11 を立ち上げ、日課のように自社の業務システムKABUTOのログイン画面を開きます。しかし、そこには、意味をなさない「虚無」という文字だけがただひっそりと表示されていたのです。これは質問でもあり不具合の報告でもあります。岡本太郎さんに本件調査依頼します。\"\n",
48+
"\n",
49+
"# Stream the agent's response to the question\n",
50+
"for event in agent.stream(\n",
51+
" input={\n",
52+
" \"messages\": [\n",
53+
" {\n",
54+
" \"role\": \"user\",\n",
55+
" \"content\": question,\n",
56+
" }\n",
57+
" ],\n",
58+
" }\n",
59+
"):\n",
60+
" print(\"-\" * 20)\n",
61+
" print(f\"Event: {event}\")"
62+
]
63+
},
64+
{
65+
"cell_type": "code",
66+
"execution_count": 4,
67+
"id": "ea28f1f5",
68+
"metadata": {},
69+
"outputs": [
70+
{
71+
"name": "stdout",
72+
"output_type": "stream",
73+
"text": [
74+
"{\n",
75+
" \"title\": \"KABUTOログイン問題\",\n",
76+
" \"description\": \"若手社員の山田太郎さんがWindows 11環境で自社業務システムKABUTOにログインしようとした際、ログイン画面に「虚無」という文字が表示され、ログインできない問題が発生しました。\",\n",
77+
" \"labels\": [\n",
78+
" \"bug\",\n",
79+
" \"question\"\n",
80+
" ],\n",
81+
" \"assignee\": \"岡本太郎\",\n",
82+
" \"milestone\": null,\n",
83+
" \"system_info\": {\n",
84+
" \"os\": \"Windows 11\",\n",
85+
" \"version\": null\n",
86+
" },\n",
87+
" \"steps_to_reproduce\": [\n",
88+
" \"Windows 11を起動する\",\n",
89+
" \"KABUTOのログイン画面を開く\",\n",
90+
" \"ログインを試みる\"\n",
91+
" ],\n",
92+
" \"current_behavior\": \"ログイン画面に「虚無」という文字が表示される\",\n",
93+
" \"expected_behavior\": \"正常にログインできる\"\n",
94+
"}\n"
95+
]
96+
}
97+
],
98+
"source": [
99+
"print(event[\"analyze\"][\"issue\"].model_dump_json(indent=2))"
100+
]
101+
}
102+
],
103+
"metadata": {
104+
"kernelspec": {
105+
"display_name": "Python 3 (ipykernel)",
106+
"language": "python",
107+
"name": "python3"
108+
},
109+
"language_info": {
110+
"codemirror_mode": {
111+
"name": "ipython",
112+
"version": 3
113+
},
114+
"file_extension": ".py",
115+
"mimetype": "text/x-python",
116+
"name": "python",
117+
"nbconvert_exporter": "python",
118+
"pygments_lexer": "ipython3",
119+
"version": "3.12.0"
120+
}
121+
},
122+
"nbformat": 4,
123+
"nbformat_minor": 5
124+
}

0 commit comments

Comments
 (0)