@@ -19,20 +19,16 @@ See the endpoint docs at
1919
2020``` python
2121client.ai.create_ai_ask(
22- CreateAiAskMode.MULTIPLE_ITEM_QA ,
23- " Which direction sun rises? " ,
22+ CreateAiAskMode.SINGLE_ITEM_QA ,
23+ " which direction sun rises" ,
2424 [
2525 AiItemAsk(
26- id = file_to_ask_1.id,
27- type = AiItemAskTypeField.FILE ,
28- content = " Earth goes around the sun" ,
29- ),
30- AiItemAsk(
31- id = file_to_ask_2.id,
26+ id = file_to_ask.id,
3227 type = AiItemAskTypeField.FILE ,
33- content = " Sun rises in the East in the morning " ,
34- ),
28+ content = " Sun rises in the East" ,
29+ )
3530 ],
31+ ai_agent = ai_ask_agent_config,
3632)
3733```
3834
@@ -127,9 +123,7 @@ See the endpoint docs at
127123<!-- sample get_ai_agent_default -->
128124
129125``` python
130- client.ai.get_ai_agent_default_config(
131- GetAiAgentDefaultConfigMode.EXTRACT_STRUCTURED , language = " en-US"
132- )
126+ client.ai.get_ai_agent_default_config(GetAiAgentDefaultConfigMode.ASK , language = " en-US" )
133127```
134128
135129### Arguments
@@ -212,9 +206,48 @@ See the endpoint docs at
212206``` python
213207client.ai.create_ai_extract_structured(
214208 [AiItemBase(id = file .id)],
215- metadata_template = CreateAiExtractStructuredMetadataTemplate(
216- template_key = template_key, scope = " enterprise"
217- ),
209+ fields = [
210+ CreateAiExtractStructuredFields(
211+ key = " firstName" ,
212+ display_name = " First name" ,
213+ description = " Person first name" ,
214+ prompt = " What is the your first name?" ,
215+ type = " string" ,
216+ ),
217+ CreateAiExtractStructuredFields(
218+ key = " lastName" ,
219+ display_name = " Last name" ,
220+ description = " Person last name" ,
221+ prompt = " What is the your last name?" ,
222+ type = " string" ,
223+ ),
224+ CreateAiExtractStructuredFields(
225+ key = " dateOfBirth" ,
226+ display_name = " Birth date" ,
227+ description = " Person date of birth" ,
228+ prompt = " What is the date of your birth?" ,
229+ type = " date" ,
230+ ),
231+ CreateAiExtractStructuredFields(
232+ key = " age" ,
233+ display_name = " Age" ,
234+ description = " Person age" ,
235+ prompt = " How old are you?" ,
236+ type = " float" ,
237+ ),
238+ CreateAiExtractStructuredFields(
239+ key = " hobby" ,
240+ display_name = " Hobby" ,
241+ description = " Person hobby" ,
242+ prompt = " What is your hobby?" ,
243+ type = " multiSelect" ,
244+ options = [
245+ CreateAiExtractStructuredFieldsOptionsField(key = " guitar" ),
246+ CreateAiExtractStructuredFieldsOptionsField(key = " books" ),
247+ ],
248+ ),
249+ ],
250+ ai_agent = agent_ignoring_overriding_embeddings_model,
218251)
219252```
220253
0 commit comments