File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,15 @@ The easiest way to define tools in LangChain is using the `@tool` decorator. The
23
23
24
24
An example of a tool in LangChain is as follows:
25
25
26
- ```
26
+ ``` python
27
27
@tool (" search-tool" , return_direct = True )
28
28
def search (query : str ) -> str :
29
29
""" Look up things online."""
30
30
return " MongoDB"
31
31
```
32
32
An example of a tool call is as follows:
33
33
34
- ```
34
+ ``` json
35
35
{
36
36
"name" : " search-tool" ,
37
37
"args" : {
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ get_embedding(user_query)
39
39
<details >
40
40
<summary >Answer</summary >
41
41
<div >
42
- ``` python
42
+ ``` json
43
43
[
44
44
{
45
45
"$vectorSearch" : {
@@ -78,7 +78,7 @@ vs_collection.aggregate(pipeline)
78
78
<details >
79
79
<summary >Answer</summary >
80
80
<div >
81
- ``` python
81
+ ``` json
82
82
{"title" : user_query }
83
83
```
84
84
</div >
@@ -89,7 +89,7 @@ vs_collection.aggregate(pipeline)
89
89
<details >
90
90
<summary >Answer</summary >
91
91
<div >
92
- ``` python
92
+ ``` json
93
93
{"_id" : 0 , "body" : 1 }
94
94
```
95
95
</div >
You can’t perform that action at this time.
0 commit comments