Create, Get, Update
Manage your concepts.
Create
Add Concepts
import com.clarifai.grpc.api.*;
import com.clarifai.grpc.api.status.*;
// Insert here the initialization code as outlined on this page:
// https://docs.clarifai.com/api-guide/api-overview/api-clients#client-installation-instructions
MultiConceptResponse postConceptsResponse = stub.postConcepts(
PostConceptsRequest.newBuilder()
.addConcepts(Concept.newBuilder().setId("charlie").setName("Charlie Name"))
.build()
);
if (postConceptsResponse.getStatus().getCode() != StatusCode.SUCCESS) {
throw new RuntimeException("Post concepts failed, status: " + postConceptsResponse.getStatus());
}// Insert here the initialization code as outlined on this page:
// https://docs.clarifai.com/api-guide/api-overview/api-clients#client-installation-instructions
stub.PostConcepts(
{
concepts: [{id: "charlie", name: "Charlie Name"}]
},
metadata,
(err, response) => {
if (err) {
throw new Error(err);
}
if (response.status.code !== 10000) {
throw new Error("Post concepts failed, status: " + response.status.description);
}
}
);Get
Get Concept by ID
List concepts
Update
Update Concept Name
Last updated
Was this helpful?