You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sends an AI request to supported LLMs and returns an answer specifically focused on the user's question given the provided context.
226
228
:param mode: The mode specifies if this request is for a single or multiple items. If you select `single_item_qa` the `items` array can have one element only. Selecting `multiple_item_qa` allows you to provide up to 25 items.
@@ -232,7 +234,7 @@ def create_ai_ask(
232
234
**Note**: Box AI handles documents with text representations up to 1MB in size, or a maximum of 25 files, whichever comes first.
233
235
If the file size exceeds 1MB, the first 1MB of text representation will be processed.
234
236
If you set `mode` parameter to `single_item_qa`, the `items` array can have one element only.
235
-
:type items: List[AiItemBase]
237
+
:type items: List[AiItemAsk]
236
238
:param dialogue_history: The history of prompts and answers previously passed to the LLM. This provides additional context to the LLM in generating the response., defaults to None
**Note**: Box AI handles documents with text representations up to 1MB in size, or a maximum of 25 files, whichever comes first.
43
43
If the file size exceeds 1MB, the first 1MB of text representation will be processed.
44
44
If you set `mode` parameter to `single_item_qa`, the `items` array can have one element only.
45
-
:type items: List[AiItemBase]
45
+
:type items: List[AiItemAsk]
46
46
:param dialogue_history: The history of prompts and answers previously passed to the LLM. This provides additional context to the LLM in generating the response., defaults to None
Copy file name to clipboardExpand all lines: docs/ai.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,14 @@ client.ai.create_ai_ask(
22
22
CreateAiAskMode.MULTIPLE_ITEM_QA,
23
23
"Which direction sun rises?",
24
24
[
25
-
AiItemBase(
25
+
AiItemAsk(
26
26
id=file_to_ask_1.id,
27
-
type=AiItemBaseTypeField.FILE,
27
+
type=AiItemAskTypeField.FILE,
28
28
content="Earth goes around the sun",
29
29
),
30
-
AiItemBase(
30
+
AiItemAsk(
31
31
id=file_to_ask_2.id,
32
-
type=AiItemBaseTypeField.FILE,
32
+
type=AiItemAskTypeField.FILE,
33
33
content="Sun rises in the East in the morning",
34
34
),
35
35
],
@@ -42,7 +42,7 @@ client.ai.create_ai_ask(
42
42
- The mode specifies if this request is for a single or multiple items. If you select `single_item_qa` the `items` array can have one element only. Selecting `multiple_item_qa` allows you to provide up to 25 items.
43
43
- prompt `str`
44
44
- The prompt provided by the client to be answered by the LLM. The prompt's length is limited to 10000 characters.
45
-
- items `List[AiItemBase]`
45
+
- items `List[AiItemAsk]`
46
46
- The items to be processed by the LLM, often files. **Note**: Box AI handles documents with text representations up to 1MB in size, or a maximum of 25 files, whichever comes first. If the file size exceeds 1MB, the first 1MB of text representation will be processed. If you set `mode` parameter to `single_item_qa`, the `items` array can have one element only.
- The history of prompts and answers previously passed to the LLM. This provides additional context to the LLM in generating the response.
@@ -55,9 +55,9 @@ client.ai.create_ai_ask(
55
55
56
56
### Returns
57
57
58
-
This function returns a value of type `AiResponseFull`.
58
+
This function returns a value of type `Optional[AiResponseFull]`.
59
59
60
-
A successful response including the answer from the LLM.
60
+
A successful response including the answer from the LLM.No content is available to answer the question. This is returned when the request item is a hub, but content in the hubs is not indexed. To ensure content in the hub is indexed, make sure Box AI for Hubs in the Admin Console was enabled before hub creation.
0 commit comments