Create Data Sink
DataSink dataSinks().create(DataSinkCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/api/v1/data-sinks
Create Data Sink
package ai.llamaindex.llamacloud.example;
import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.core.JsonValue;
import ai.llamaindex.llamacloud.models.datasinks.DataSink;
import ai.llamaindex.llamacloud.models.datasinks.DataSinkCreateParams;
import ai.llamaindex.llamacloud.models.pipelines.DataSinkCreate;
public final class Main {
private Main() {}
public static void main(String[] args) {
LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();
DataSinkCreate params = DataSinkCreate.builder()
.component(DataSinkCreate.Component.UnionMember0.builder()
.putAdditionalProperty("foo", JsonValue.from("bar"))
.build())
.name("name")
.sinkType(DataSinkCreate.SinkType.ASTRA_DB)
.build();
DataSink dataSink = client.dataSinks().create(params);
}
}{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"component": {
"foo": "bar"
},
"name": "name",
"project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"sink_type": "ASTRA_DB",
"created_at": "2019-12-27T18:11:19.117Z",
"updated_at": "2019-12-27T18:11:19.117Z"
}Returns Examples
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"component": {
"foo": "bar"
},
"name": "name",
"project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"sink_type": "ASTRA_DB",
"created_at": "2019-12-27T18:11:19.117Z",
"updated_at": "2019-12-27T18:11:19.117Z"
}