File tree Expand file tree Collapse file tree 5 files changed +162
-14
lines changed
conversational_retrieval_chain Expand file tree Collapse file tree 5 files changed +162
-14
lines changed Original file line number Diff line number Diff line change 9
9
" Demo of a client interacting with a remote agent. "
10
10
]
11
11
},
12
+ {
13
+ "cell_type" : " markdown" ,
14
+ "metadata" : {},
15
+ "source" : [
16
+ " You can interact with this via API directly"
17
+ ]
18
+ },
19
+ {
20
+ "cell_type" : " code" ,
21
+ "execution_count" : 7 ,
22
+ "metadata" : {},
23
+ "outputs" : [
24
+ {
25
+ "data" : {
26
+ "text/plain" : [
27
+ " {'output': {'output': 'Eugene thinks that cats like fish.'}}"
28
+ ]
29
+ },
30
+ "execution_count" : 7 ,
31
+ "metadata" : {},
32
+ "output_type" : " execute_result"
33
+ }
34
+ ],
35
+ "source" : [
36
+ " import requests\n " ,
37
+ " \n " ,
38
+ " inputs = {\" input\" : {\" input\" : \" what does eugene think of cats?\" }}\n " ,
39
+ " response = requests.post(\" http://localhost:8000/invoke\" , json=inputs)\n " ,
40
+ " \n " ,
41
+ " response.json()"
42
+ ]
43
+ },
44
+ {
45
+ "cell_type" : " markdown" ,
46
+ "metadata" : {},
47
+ "source" : [
48
+ " You can also interact with this via the RemoteRunnable interface (to use in other chains)"
49
+ ]
50
+ },
12
51
{
13
52
"cell_type" : " code" ,
14
53
"execution_count" : 3 ,
Original file line number Diff line number Diff line change 9
9
" Demo of client interacting with the simple chain server, which deploys a chain that tells jokes about a particular topic."
10
10
]
11
11
},
12
+ {
13
+ "cell_type" : " markdown" ,
14
+ "metadata" : {},
15
+ "source" : [
16
+ " You can interact with this via API directly"
17
+ ]
18
+ },
12
19
{
13
20
"cell_type" : " code" ,
14
- "execution_count" : 1 ,
15
- "metadata" : {
16
- "tags" : []
17
- },
18
- "outputs" : [],
21
+ "execution_count" : 3 ,
22
+ "metadata" : {},
23
+ "outputs" : [
24
+ {
25
+ "data" : {
26
+ "text/plain" : [
27
+ " {'output': {'content': \" Why don't scientists trust atoms when playing sports? \\ n\\ nBecause they make up everything!\" ,\n " ,
28
+ " 'additional_kwargs': {},\n " ,
29
+ " 'type': 'ai',\n " ,
30
+ " 'example': False}}"
31
+ ]
32
+ },
33
+ "execution_count" : 3 ,
34
+ "metadata" : {},
35
+ "output_type" : " execute_result"
36
+ }
37
+ ],
38
+ "source" : [
39
+ " import requests\n " ,
40
+ " \n " ,
41
+ " inputs = {\" input\" : {\" topic\" : \" sports\" }}\n " ,
42
+ " response = requests.post(\" http://localhost:8000/invoke\" , json=inputs)\n " ,
43
+ " \n " ,
44
+ " response.json()"
45
+ ]
46
+ },
47
+ {
48
+ "cell_type" : " markdown" ,
49
+ "metadata" : {},
19
50
"source" : [
20
- " from langchain.prompts.chat import (\n " ,
21
- " HumanMessagePromptTemplate,\n " ,
22
- " SystemMessagePromptTemplate,\n " ,
23
- " )"
51
+ " You can also interact with this via the RemoteRunnable interface (to use in other chains)"
24
52
]
25
53
},
26
54
{
155
183
"name" : " python" ,
156
184
"nbconvert_exporter" : " python" ,
157
185
"pygments_lexer" : " ipython3" ,
158
- "version" : " 3.11.4 "
186
+ "version" : " 3.10.1 "
159
187
}
160
188
},
161
189
"nbformat" : 4 ,
Original file line number Diff line number Diff line change 9
9
" Demo of a client interacting with a remote conversational retrieval chain. "
10
10
]
11
11
},
12
+ {
13
+ "cell_type" : " markdown" ,
14
+ "metadata" : {},
15
+ "source" : [
16
+ " You can interact with this via API directly"
17
+ ]
18
+ },
19
+ {
20
+ "cell_type" : " code" ,
21
+ "execution_count" : 2 ,
22
+ "metadata" : {},
23
+ "outputs" : [
24
+ {
25
+ "data" : {
26
+ "text/plain" : [
27
+ " {'output': {'answer': 'Cats like fish.'}}"
28
+ ]
29
+ },
30
+ "execution_count" : 2 ,
31
+ "metadata" : {},
32
+ "output_type" : " execute_result"
33
+ }
34
+ ],
35
+ "source" : [
36
+ " import requests\n " ,
37
+ " \n " ,
38
+ " inputs = {\" input\" : {\" question\" : \" what do cats like?\" , \" chat_history\" : \"\" }}\n " ,
39
+ " response = requests.post(\" http://localhost:8000/invoke\" , json=inputs)\n " ,
40
+ " \n " ,
41
+ " response.json()"
42
+ ]
43
+ },
44
+ {
45
+ "cell_type" : " markdown" ,
46
+ "metadata" : {},
47
+ "source" : [
48
+ " You can also interact with this via the RemoteRunnable interface (to use in other chains)"
49
+ ]
50
+ },
12
51
{
13
52
"cell_type" : " code" ,
14
53
"execution_count" : 6 ,
Original file line number Diff line number Diff line change 316
316
"name" : " python" ,
317
317
"nbconvert_exporter" : " python" ,
318
318
"pygments_lexer" : " ipython3" ,
319
- "version" : " 3.11.4 "
319
+ "version" : " 3.10.1 "
320
320
}
321
321
},
322
322
"nbformat" : 4 ,
Original file line number Diff line number Diff line change 9
9
" Demo of a client interacting with a remote retriever. "
10
10
]
11
11
},
12
+ {
13
+ "cell_type" : " markdown" ,
14
+ "metadata" : {},
15
+ "source" : [
16
+ " You can interact with this via API directly"
17
+ ]
18
+ },
19
+ {
20
+ "cell_type" : " code" ,
21
+ "execution_count" : 4 ,
22
+ "metadata" : {},
23
+ "outputs" : [
24
+ {
25
+ "data" : {
26
+ "text/plain" : [
27
+ " {'output': [{'page_content': 'dogs like sticks',\n " ,
28
+ " 'metadata': {},\n " ,
29
+ " 'type': 'Document'},\n " ,
30
+ " {'page_content': 'cats like fish', 'metadata': {}, 'type': 'Document'}]}"
31
+ ]
32
+ },
33
+ "execution_count" : 4 ,
34
+ "metadata" : {},
35
+ "output_type" : " execute_result"
36
+ }
37
+ ],
38
+ "source" : [
39
+ " import requests\n " ,
40
+ " \n " ,
41
+ " inputs = {\" input\" : \" tree\" }\n " ,
42
+ " response = requests.post(\" http://localhost:8000/invoke\" , json=inputs)\n " ,
43
+ " \n " ,
44
+ " response.json()"
45
+ ]
46
+ },
47
+ {
48
+ "cell_type" : " markdown" ,
49
+ "metadata" : {},
50
+ "source" : [
51
+ " You can also interact with this via the RemoteRunnable interface (to use in other chains)"
52
+ ]
53
+ },
12
54
{
13
55
"cell_type" : " code" ,
14
56
"execution_count" : 1 ,
39
81
{
40
82
"data" : {
41
83
"text/plain" : [
42
- " [Document(page_content='dogs like sticks', metadata={} ),\n " ,
43
- " Document(page_content='cats like fish', metadata={} )]"
84
+ " [Document(page_content='dogs like sticks'),\n " ,
85
+ " Document(page_content='cats like fish')]"
44
86
]
45
87
},
46
88
"execution_count" : 2 ,
182
224
"name" : " python" ,
183
225
"nbconvert_exporter" : " python" ,
184
226
"pygments_lexer" : " ipython3" ,
185
- "version" : " 3.11.4 "
227
+ "version" : " 3.10.1 "
186
228
}
187
229
},
188
230
"nbformat" : 4 ,
You can’t perform that action at this time.
0 commit comments