You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/agent/agent_component_reference/code.mdx
+36-41Lines changed: 36 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,62 +136,57 @@ Please try again shortly or increase the pool size in the configuration to impro
136
136
137
137
### How to import my own Python or JavaScript packages into Sandbox?
138
138
139
-
To install the additional dependencies for your Python packages:
139
+
To import your Python packages, update **sandbox_base_image/python/requirements.txt** to install the required dependencies. For example, to add the `openpyxl` package, proceed with the following command lines:
140
140
141
-
```bash
142
-
(ragflow) ➜ ragflow/sandbox main ✓ pwd
143
-
```
141
+
```bash {4,6}
142
+
(ragflow) ➜ ragflow/sandbox main ✓ pwd# make sure you are in the right directory
143
+
/home/infiniflow/workspace/ragflow/sandbox
144
144
145
-
```bash
146
-
(ragflow) ➜ ragflow/sandbox main ✓ ls
147
-
```
145
+
(ragflow) ➜ ragflow/sandbox main ✓ echo"openpyxl">> sandbox_base_image/python/requirements.txt # add the package to the requirements.txt file
148
146
149
-
```bash
150
-
(ragflow) ➜ ragflow/sandbox main ✓ echo"openpyxl">> sandbox_base_image/python/requirements.txt
151
-
```
147
+
(ragflow) ➜ ragflow/sandbox main ✗ cat sandbox_base_image/python/requirements.txt # make sure the package is added
148
+
numpy
149
+
pandas
150
+
requests
151
+
openpyxl # here it is
152
152
153
-
```bash
154
-
(ragflow) ➜ ragflow/sandbox main ✗ cat sandbox_base_image/python/requirements.txt
155
-
```
153
+
(ragflow) ➜ ragflow/sandbox main ✗ make # rebuild the docker image, this command will rebuild the iamge and start the service immediately. To build image only, using `make build` instead.
156
154
157
-
```bash
158
-
(ragflow) ➜ ragflow/sandbox main ✗ make
159
-
```
155
+
(ragflow) ➜ ragflow/sandbox main ✗ docker exec -it sandbox_python_0 /bin/bash # entering container to check if the package is installed
160
156
161
-
```bash
162
-
(ragflow) ➜ ragflow/sandbox main ✗ docker exec -it sandbox_python_0 /bin/bash
Python 3.11.13 (main, Aug 12 2025, 22:46:03) [GCC 12.2.0] on linux
161
+
Type "help", "copyright", "credits" or "license"for more information.
162
+
>>> import openpyxl # import the package to verify installation
163
+
>>>
164
+
# That's okay!
163
165
```
164
166
165
-
To install the additional dependencies for your JavaScript packages:
167
+
To import your JavaScript packages, navigate to `sandbox_base_image/nodejs` and use `npm` to install the required packages. For example, to add the `lodash` package, run the following commands:
166
168
167
169
```bash
168
170
(ragflow) ➜ ragflow/sandbox main ✓ pwd
169
171
/home/infiniflow/workspace/ragflow/sandbox
170
172
171
-
```
172
-
173
-
```bash
174
173
(ragflow) ➜ ragflow/sandbox main ✓ cd sandbox_base_image/nodejs
175
-
```
176
174
177
-
```bash
178
175
(ragflow) ➜ ragflow/sandbox/sandbox_base_image/nodejs main ✓ npm install lodash
179
-
```
180
176
181
-
```bash
182
-
(ragflow) ➜ ragflow/sandbox/sandbox_base_image/nodejs main ✗ make
183
-
make: *** No targets specified and no makefile found. Stop.
184
-
(ragflow) ➜ ragflow/sandbox/sandbox_base_image/nodejs main ✗ lg
185
-
(ragflow) ➜ ragflow/sandbox/sandbox_base_image/nodejs main ✓ ls
(ragflow) ➜ ragflow/sandbox main ✓ cd sandbox_base_image/nodejs
196
-
(ragflow) ➜ ragflow/sandbox/sandbox_base_image/nodejs main ✓ npm install lodash
177
+
(ragflow) ➜ ragflow/sandbox/sandbox_base_image/nodejs main ✓ cd ../.. # go back to sandbox root directory
178
+
179
+
(ragflow) ➜ ragflow/sandbox main ✗ make # rebuild the docker image, this command will rebuild the iamge and start the service immediately. To build image only, using `make build` instead.
180
+
181
+
(ragflow) ➜ ragflow/sandbox main ✗ docker exec -it sandbox_nodejs_0 /bin/bash # entering container to check if the package is installed
182
+
183
+
# in the container
184
+
nobody@dd4bbcabef63:/workspace$ npm list lodash # verify via npm list
185
+
/workspace
186
+
`-- lodash@4.17.21 extraneous
187
+
188
+
nobody@dd4bbcabef63:/workspace$ ls node_modules | grep lodash # or verify via listing node_modules
0 commit comments