Skip to content

Commit 5b42800

Browse files
authored

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/langsmith/data-export-destinations.mdx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ The following information is needed to configure a destination:
3030
- **Access Key**: The access key for the S3 bucket.
3131
- **Secret Key**: The secret key for the S3 bucket.
3232
- **Include Bucket in Prefix** (optional): Whether to include the bucket name as part of the path prefix. Defaults to `true`. Set to `false` when using virtual-hosted style endpoints where the bucket name is already in the endpoint URL.
33+
- **S3 Config Options** (`config_kwargs_s3`, optional): Advanced S3 addressing style and request settings passed to botocore. The most common use is setting `addressing_style` for S3-compatible services that require virtual-hosted or path-style requests:
34+
- `"virtual"`: bucket name is part of the hostname (e.g. `bucket.endpoint/key`). Required for some S3-compatible services such as Volcengine TOS.
35+
- `"path"`: bucket name is part of the URL path (e.g. `endpoint/bucket/key`).
36+
- `"auto"` (default): boto3 decides based on the endpoint.
3337

3438
We support any S3 compatible bucket. For non-AWS buckets such as GCS or MinIO, you will need to provide the endpoint URL.
3539

@@ -198,6 +202,34 @@ curl --request POST \
198202

199203
See [Google documentation](https://cloud.google.com/storage/docs/interoperability#xml_api) for more info
200204

205+
### S3-compatible bucket with virtual-hosted style addressing
206+
207+
Some S3-compatible services (such as Volcengine TOS) require virtual-hosted style addressing, where the bucket name is part of the hostname rather than the URL path. Use `config_kwargs_s3` with `addressing_style: "virtual"` to enable this:
208+
209+
```bash
210+
curl --request POST \
211+
--url 'https://api.smith.langchain.com/api/v1/bulk-exports/destinations' \
212+
--header 'Content-Type: application/json' \
213+
--header 'X-API-Key: YOUR_API_KEY' \
214+
--header 'X-Tenant-Id: YOUR_WORKSPACE_ID' \
215+
--data '{
216+
"destination_type": "s3",
217+
"display_name": "My Volcengine TOS Destination",
218+
"config": {
219+
"bucket_name": "my_bucket",
220+
"prefix": "data_exports",
221+
"endpoint_url": "https://tos-s3-cn-beijing.volces.com",
222+
"config_kwargs_s3": {
223+
"addressing_style": "virtual"
224+
}
225+
},
226+
"credentials": {
227+
"access_key_id": "YOUR_ACCESS_KEY_ID",
228+
"secret_access_key": "YOUR_SECRET_ACCESS_KEY"
229+
}
230+
}'
231+
```
232+
201233
### S3-compatible bucket with virtual-hosted style endpoint
202234

203235
If your endpoint URL already includes the bucket name (virtual-hosted style), set `include_bucket_in_prefix` to `false` to avoid duplicating the bucket name in the path:
@@ -339,3 +371,4 @@ Here are some common errors:
339371
| Bucket is not valid | The specified blob store bucket is not valid. This error is thrown when the bucket doesn't exist or there is not enough access to perform writes on the bucket. |
340372
| Key ID you provided does not exist | The blob store credentials provided are not valid. This error occurs when the access key ID used for authentication is not a valid key. |
341373
| Invalid endpoint | The endpoint_url provided is invalid. This error is raised when the specified endpoint is an invalid endpoint. Only S3 compatible endpoints are supported, for example `https://storage.googleapis.com` for GCS, `https://play.min.io` for minio, etc. If using AWS, you should omit the endpoint_url. |
374+
| InvalidBucketName | The S3-compatible service rejected the request due to addressing style mismatch. Some services require virtual-hosted style addressing. Set `config_kwargs_s3: {"addressing_style": "virtual"}` in your destination config to resolve this. |

0 commit comments

Comments
 (0)