try await client.ai.createAiExtractStructured(requestBody: AiExtractStructured(fields: [AiExtractStructuredFieldsField(key: "firstName", displayName: "First name", description: "Person first name", prompt: "What is the your first name?", type: "string"), AiExtractStructuredFieldsField(key: "lastName", displayName: "Last name", description: "Person last name", prompt: "What is the your last name?", type: "string"), AiExtractStructuredFieldsField(key: "dateOfBirth", displayName: "Birth date", description: "Person date of birth", prompt: "What is the date of your birth?", type: "date"), AiExtractStructuredFieldsField(key: "age", displayName: "Age", description: "Person age", prompt: "How old are you?", type: "float"), AiExtractStructuredFieldsField(key: "hobby", displayName: "Hobby", description: "Person hobby", prompt: "What is your hobby?", type: "multiSelect", options: [AiExtractStructuredFieldsOptionsField(key: "guitar"), AiExtractStructuredFieldsOptionsField(key: "books")]), AiExtractStructuredFieldsField(key: "address", displayName: "Address", description: "Person address", type: "struct", prompt: "Extract the full mailing address.", fields: [AiExtractSubField(key: "street", displayName: "Street", type: "string"), AiExtractSubField(key: "city", displayName: "City", type: "string"), AiExtractSubField(key: "state", displayName: "State", type: "string"), AiExtractSubField(key: "zip", displayName: "Zip", type: "string"), AiExtractSubField(key: "country", displayName: "Country", type: "string")]), AiExtractStructuredFieldsField(key: "work_history", displayName: "Work history", description: "Person work history", type: "table", prompt: "Extract each job as a row.", fields: [AiExtractSubField(key: "job_title", displayName: "Job title", type: "string"), AiExtractSubField(key: "company", displayName: "Company", type: "string"), AiExtractSubField(key: "start_year", displayName: "Start year", type: "string"), AiExtractSubField(key: "end_year", displayName: "End year", type: "string")])], items: [AiItemBase(id: file.id)], includeConfidenceScore: true, includeReference: true))
client.getAi().createAiExtractStructured(new AiExtractStructured.Builder(Arrays.asList(new AiItemBase(file.getId()))).fields(Arrays.asList(new AiExtractStructuredFieldsField.Builder("firstName").description("Person first name").displayName("First name").prompt("What is the your first name?").type("string").build(), new AiExtractStructuredFieldsField.Builder("lastName").description("Person last name").displayName("Last name").prompt("What is the your last name?").type("string").build(), new AiExtractStructuredFieldsField.Builder("dateOfBirth").description("Person date of birth").displayName("Birth date").prompt("What is the date of your birth?").type("date").build(), new AiExtractStructuredFieldsField.Builder("age").description("Person age").displayName("Age").prompt("How old are you?").type("float").build(), new AiExtractStructuredFieldsField.Builder("hobby").description("Person hobby").displayName("Hobby").prompt("What is your hobby?").type("multiSelect").options(Arrays.asList(new AiExtractStructuredFieldsOptionsField("guitar"), new AiExtractStructuredFieldsOptionsField("books"))).build(), new AiExtractStructuredFieldsField.Builder("address").description("Person address").displayName("Address").prompt("Extract the full mailing address.").type("struct").fields(Arrays.asList(new AiExtractSubField.Builder("street").displayName("Street").type("string").build(), new AiExtractSubField.Builder("city").displayName("City").type("string").build(), new AiExtractSubField.Builder("state").displayName("State").type("string").build(), new AiExtractSubField.Builder("zip").displayName("Zip").type("string").build(), new AiExtractSubField.Builder("country").displayName("Country").type("string").build())).build(), new AiExtractStructuredFieldsField.Builder("work_history").description("Person work history").displayName("Work history").prompt("Extract each job as a row.").type("table").fields(Arrays.asList(new AiExtractSubField.Builder("job_title").displayName("Job title").type("string").build(), new AiExtractSubField.Builder("company").displayName("Company").type("string").build(), new AiExtractSubField.Builder("start_year").displayName("Start year").type("string").build(), new AiExtractSubField.Builder("end_year").displayName("End year").type("string").build())).build())).aiAgent(aiExtractStructuredAgentBasicTextConfig).includeConfidenceScore(true).includeReference(true).build())
await client.Ai.CreateAiExtractStructuredAsync(requestBody: new AiExtractStructured(items: Array.AsReadOnly(new [] {new AiItemBase(id: file.Id)})) { Fields = Array.AsReadOnly(new [] {new AiExtractStructuredFieldsField(key: "firstName") { DisplayName = "First name", Description = "Person first name", Prompt = "What is the your first name?", Type = "string" },new AiExtractStructuredFieldsField(key: "lastName") { DisplayName = "Last name", Description = "Person last name", Prompt = "What is the your last name?", Type = "string" },new AiExtractStructuredFieldsField(key: "dateOfBirth") { DisplayName = "Birth date", Description = "Person date of birth", Prompt = "What is the date of your birth?", Type = "date" },new AiExtractStructuredFieldsField(key: "age") { DisplayName = "Age", Description = "Person age", Prompt = "How old are you?", Type = "float" },new AiExtractStructuredFieldsField(key: "hobby") { DisplayName = "Hobby", Description = "Person hobby", Prompt = "What is your hobby?", Type = "multiSelect", Options = Array.AsReadOnly(new [] {new AiExtractStructuredFieldsOptionsField(key: "guitar"),new AiExtractStructuredFieldsOptionsField(key: "books")}) },new AiExtractStructuredFieldsField(key: "address") { DisplayName = "Address", Description = "Person address", Type = "struct", Prompt = "Extract the full mailing address.", Fields = Array.AsReadOnly(new [] {new AiExtractSubField(key: "street") { DisplayName = "Street", Type = "string" },new AiExtractSubField(key: "city") { DisplayName = "City", Type = "string" },new AiExtractSubField(key: "state") { DisplayName = "State", Type = "string" },new AiExtractSubField(key: "zip") { DisplayName = "Zip", Type = "string" },new AiExtractSubField(key: "country") { DisplayName = "Country", Type = "string" }}) },new AiExtractStructuredFieldsField(key: "work_history") { DisplayName = "Work history", Description = "Person work history", Type = "table", Prompt = "Extract each job as a row.", Fields = Array.AsReadOnly(new [] {new AiExtractSubField(key: "job_title") { DisplayName = "Job title", Type = "string" },new AiExtractSubField(key: "company") { DisplayName = "Company", Type = "string" },new AiExtractSubField(key: "start_year") { DisplayName = "Start year", Type = "string" },new AiExtractSubField(key: "end_year") { DisplayName = "End year", Type = "string" }}) }}), IncludeConfidenceScore = true, IncludeReference = true });
try await client.ai.createAiExtractStructured(requestBody: AiExtractStructured(fields: [AiExtractStructuredFieldsField(key: "firstName", displayName: "First name", description: "Person first name", prompt: "What is the your first name?", type: "string"), AiExtractStructuredFieldsField(key: "lastName", displayName: "Last name", description: "Person last name", prompt: "What is the your last name?", type: "string"), AiExtractStructuredFieldsField(key: "dateOfBirth", displayName: "Birth date", description: "Person date of birth", prompt: "What is the date of your birth?", type: "date"), AiExtractStructuredFieldsField(key: "age", displayName: "Age", description: "Person age", prompt: "How old are you?", type: "float"), AiExtractStructuredFieldsField(key: "hobby", displayName: "Hobby", description: "Person hobby", prompt: "What is your hobby?", type: "multiSelect", options: [AiExtractStructuredFieldsOptionsField(key: "guitar"), AiExtractStructuredFieldsOptionsField(key: "books")]), AiExtractStructuredFieldsField(key: "address", displayName: "Address", description: "Person address", type: "struct", prompt: "Extract the full mailing address.", fields: [AiExtractSubField(key: "street", displayName: "Street", type: "string"), AiExtractSubField(key: "city", displayName: "City", type: "string"), AiExtractSubField(key: "state", displayName: "State", type: "string"), AiExtractSubField(key: "zip", displayName: "Zip", type: "string"), AiExtractSubField(key: "country", displayName: "Country", type: "string")]), AiExtractStructuredFieldsField(key: "work_history", displayName: "Work history", description: "Person work history", type: "table", prompt: "Extract each job as a row.", fields: [AiExtractSubField(key: "job_title", displayName: "Job title", type: "string"), AiExtractSubField(key: "company", displayName: "Company", type: "string"), AiExtractSubField(key: "start_year", displayName: "Start year", type: "string"), AiExtractSubField(key: "end_year", displayName: "End year", type: "string")])], items: [AiItemBase(id: file.id)], includeConfidenceScore: true, includeReference: true))
client.getAi().createAiExtractStructured(new AiExtractStructured.Builder(Arrays.asList(new AiItemBase(file.getId()))).fields(Arrays.asList(new AiExtractStructuredFieldsField.Builder("firstName").description("Person first name").displayName("First name").prompt("What is the your first name?").type("string").build(), new AiExtractStructuredFieldsField.Builder("lastName").description("Person last name").displayName("Last name").prompt("What is the your last name?").type("string").build(), new AiExtractStructuredFieldsField.Builder("dateOfBirth").description("Person date of birth").displayName("Birth date").prompt("What is the date of your birth?").type("date").build(), new AiExtractStructuredFieldsField.Builder("age").description("Person age").displayName("Age").prompt("How old are you?").type("float").build(), new AiExtractStructuredFieldsField.Builder("hobby").description("Person hobby").displayName("Hobby").prompt("What is your hobby?").type("multiSelect").options(Arrays.asList(new AiExtractStructuredFieldsOptionsField("guitar"), new AiExtractStructuredFieldsOptionsField("books"))).build(), new AiExtractStructuredFieldsField.Builder("address").description("Person address").displayName("Address").prompt("Extract the full mailing address.").type("struct").fields(Arrays.asList(new AiExtractSubField.Builder("street").displayName("Street").type("string").build(), new AiExtractSubField.Builder("city").displayName("City").type("string").build(), new AiExtractSubField.Builder("state").displayName("State").type("string").build(), new AiExtractSubField.Builder("zip").displayName("Zip").type("string").build(), new AiExtractSubField.Builder("country").displayName("Country").type("string").build())).build(), new AiExtractStructuredFieldsField.Builder("work_history").description("Person work history").displayName("Work history").prompt("Extract each job as a row.").type("table").fields(Arrays.asList(new AiExtractSubField.Builder("job_title").displayName("Job title").type("string").build(), new AiExtractSubField.Builder("company").displayName("Company").type("string").build(), new AiExtractSubField.Builder("start_year").displayName("Start year").type("string").build(), new AiExtractSubField.Builder("end_year").displayName("End year").type("string").build())).build())).aiAgent(aiExtractStructuredAgentBasicTextConfig).includeConfidenceScore(true).includeReference(true).build())
await client.Ai.CreateAiExtractStructuredAsync(requestBody: new AiExtractStructured(items: Array.AsReadOnly(new [] {new AiItemBase(id: file.Id)})) { Fields = Array.AsReadOnly(new [] {new AiExtractStructuredFieldsField(key: "firstName") { DisplayName = "First name", Description = "Person first name", Prompt = "What is the your first name?", Type = "string" },new AiExtractStructuredFieldsField(key: "lastName") { DisplayName = "Last name", Description = "Person last name", Prompt = "What is the your last name?", Type = "string" },new AiExtractStructuredFieldsField(key: "dateOfBirth") { DisplayName = "Birth date", Description = "Person date of birth", Prompt = "What is the date of your birth?", Type = "date" },new AiExtractStructuredFieldsField(key: "age") { DisplayName = "Age", Description = "Person age", Prompt = "How old are you?", Type = "float" },new AiExtractStructuredFieldsField(key: "hobby") { DisplayName = "Hobby", Description = "Person hobby", Prompt = "What is your hobby?", Type = "multiSelect", Options = Array.AsReadOnly(new [] {new AiExtractStructuredFieldsOptionsField(key: "guitar"),new AiExtractStructuredFieldsOptionsField(key: "books")}) },new AiExtractStructuredFieldsField(key: "address") { DisplayName = "Address", Description = "Person address", Type = "struct", Prompt = "Extract the full mailing address.", Fields = Array.AsReadOnly(new [] {new AiExtractSubField(key: "street") { DisplayName = "Street", Type = "string" },new AiExtractSubField(key: "city") { DisplayName = "City", Type = "string" },new AiExtractSubField(key: "state") { DisplayName = "State", Type = "string" },new AiExtractSubField(key: "zip") { DisplayName = "Zip", Type = "string" },new AiExtractSubField(key: "country") { DisplayName = "Country", Type = "string" }}) },new AiExtractStructuredFieldsField(key: "work_history") { DisplayName = "Work history", Description = "Person work history", Type = "table", Prompt = "Extract each job as a row.", Fields = Array.AsReadOnly(new [] {new AiExtractSubField(key: "job_title") { DisplayName = "Job title", Type = "string" },new AiExtractSubField(key: "company") { DisplayName = "Company", Type = "string" },new AiExtractSubField(key: "start_year") { DisplayName = "Start year", Type = "string" },new AiExtractSubField(key: "end_year") { DisplayName = "End year", Type = "string" }}) }}), IncludeConfidenceScore = true, IncludeReference = true });