Skip to content

Commit 41a360d

Browse files
add code
1 parent b06d609 commit 41a360d

4 files changed

Lines changed: 92 additions & 82 deletions

File tree

agent_team.ipynb

Lines changed: 13 additions & 80 deletions
Large diffs are not rendered by default.

code.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
"metadata": {},
236236
"outputs": [],
237237
"source": [
238-
"app.invoke({\"message\": \"Please analyze the testscript.py file\", \"error\": \"\", \"error_message\": \"\", \"file_path\": \"\", \"code\": \"\", \"iterations\": 1})"
238+
"app.invoke({\"message\": \"Please analyze the testscript.py file\", \"iterations\": 1})"
239239
]
240240
}
241241
],

dialog_flow.ipynb

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"### Combination of LLMs with Deterministic dialogue flows"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": null,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"from langchain_core.messages import BaseMessage\n",
17+
"from typing_extensions import TypedDict"
18+
]
19+
},
20+
{
21+
"cell_type": "code",
22+
"execution_count": null,
23+
"metadata": {},
24+
"outputs": [],
25+
"source": [
26+
"class AgentState(TypedDict):\n",
27+
" history: list[BaseMessage]\n",
28+
" deterministic: str\n",
29+
" deterministic_state: dict"
30+
]
31+
},
32+
{
33+
"cell_type": "code",
34+
"execution_count": null,
35+
"metadata": {},
36+
"outputs": [],
37+
"source": [
38+
"def deterministic_router(state: AgentState):\n",
39+
" deterministic = state[\"deterministic\"]\n",
40+
" if deterministic == \"yes\":\n",
41+
" return \"dialog_flow\"\n",
42+
" return \"llm\""
43+
]
44+
},
45+
{
46+
"cell_type": "code",
47+
"execution_count": null,
48+
"metadata": {},
49+
"outputs": [],
50+
"source": [
51+
"def deterministic_route(state: AgentState):\n",
52+
" do deterministic stuff"
53+
]
54+
}
55+
],
56+
"metadata": {
57+
"kernelspec": {
58+
"display_name": "app",
59+
"language": "python",
60+
"name": "python3"
61+
},
62+
"language_info": {
63+
"codemirror_mode": {
64+
"name": "ipython",
65+
"version": 3
66+
},
67+
"file_extension": ".py",
68+
"mimetype": "text/x-python",
69+
"name": "python",
70+
"nbconvert_exporter": "python",
71+
"pygments_lexer": "ipython3",
72+
"version": "3.11.0"
73+
}
74+
},
75+
"nbformat": 4,
76+
"nbformat_minor": 2
77+
}

testscript.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
x = 2
22
y = "test"
3-
print(str(x) + y)
3+
print(x + y)

0 commit comments

Comments
 (0)