Full name: projects.locations.schemas.schemaVersions.generate
Generates a schema version.
HTTP request
POST https://{endpoint}/v1/{parent}/schemaVersions:generate
Where {endpoint} is one of the supported service endpoints.
Path parameters
| Parameters | |
|---|---|
parent |
Required. The parent (project, location and schema) under which to generate the SchemaVersion. Format: |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{ "generateSchemaVersionParams": { object ( |
| Fields | |
|---|---|
generateSchemaVersionParams |
Optional. User specified parameters for the schema generation. |
Union field source. Source of the documents which will be used for schema generation. source can be only one of the following: |
|
inlineDocuments |
The set of documents specified inline. |
rawDocuments |
The set of raw documents. |
gcsDocuments |
The set of documents placed on Cloud Storage. |
gcsPrefix |
The common prefix of documents placed on Cloud Storage. |
baseSchemaVersion |
The base schema version name to use for the schema generation. Format: |
Response body
Response message for schemaVersions.generate.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{
"schemaVersion": {
object ( |
| Fields | |
|---|---|
schemaVersion |
The schema version generated by the model. |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the parent resource:
documentai.schemaVersions.create
For more information, see the IAM documentation.
Documents
A set of inline documents.
| JSON representation |
|---|
{
"documents": [
{
object ( |
| Fields | |
|---|---|
documents[] |
The list of documents. |
RawDocuments
Specifies a set of raw documents.
| JSON representation |
|---|
{
"documents": [
{
object ( |
| Fields | |
|---|---|
documents[] |
Specifies raw document content and mime type. |
GenerateSchemaVersionParams
The parameters for the schema generation.
| JSON representation |
|---|
{
"prompt": string,
"history": {
object ( |
| Fields | |
|---|---|
prompt |
Optional. The prompt used for the schema generation. |
history |
Optional. Previous prompt-answers in a chronological order. |
SchemaGenerationHistory
The history of schema generation iterations.
| JSON representation |
|---|
{
"iterations": [
{
object ( |
| Fields | |
|---|---|
iterations[] |
Required. Previous prompt-answers in a chronological order. |
SchemaGenerationIteration
A single iteration of the schema generation.
| JSON representation |
|---|
{ "prompt": string, "generatedSchema": { object ( |
| Fields | |
|---|---|
prompt |
Optional. The prompt used for the iteration. |
generatedSchema |
Required. The schema version generated by the model. |
adjustedSchema |
Optional. The previous schema version adjusted by the model. |