Back to Genai Toolbox

cloud-storage-write-object

docs/en/integrations/cloud-storage/tools/cloud-storage-write-object.md

1.6.03.0 KB
Original Source

About

A cloud-storage-write-object tool writes text content from the tool request directly into a Cloud Storage object. It is useful for creating or replacing small text objects without first writing a local file on the Toolbox server.

When content_type is empty, Cloud Storage detects the content type from the written bytes.

Compatible Sources

{{< compatible-sources >}}

Requirements

The Cloud Storage credentials must be able to create or update the target object.

Parameters

parametertyperequireddescription
bucketstringtrueName of the Cloud Storage bucket to write into.
objectstringtrueFull object name (path) within the bucket, e.g. path/to/file.txt.
contentstringtrueText content to write to the Cloud Storage object.
content_typestringfalseMIME type to record on the written object. When empty, Cloud Storage auto-detects from the content.

If bucket is configured on the tool, it is removed from the parameter list and the configured bucket is used for every invocation.

Example

yaml
kind: tool
name: write_object
type: cloud-storage-write-object
source: my-gcs-source
description: Use this tool to write text content to Cloud Storage.
yaml
kind: tool
name: write_reports
type: cloud-storage-write-object
source: my-gcs-source
description: Use this tool to write generated reports to Cloud Storage.
bucket: analytics-exports

Output Format

The tool returns a JSON object with:

fieldtypedescription
bucketstringCloud Storage bucket that received content.
objectstringCloud Storage object name that was written.
bytesintegerNumber of bytes written.
contentTypestringContent type recorded on the written object.

Reference

fieldtyperequireddescription
typestringtrueMust be "cloud-storage-write-object".
sourcestringtrueName of the Cloud Storage source to write objects to.
descriptionstringtrueDescription of the tool that is passed to the LLM.
bucketstringfalseCloud Storage bucket to use for every invocation. When set, bucket is hidden from the tool parameters.