Box
BoxAIExtractToolSpec #
Bases: BaseToolSpec
Extracts AI generated content from a Box file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
box_client
|
BoxClient
|
A BoxClient instance for interacting with Box API. |
required |
Attributes:
Name | Type | Description |
---|---|---|
spec_functions |
list
|
A list of supported functions. |
_box_client |
BoxClient
|
An instance of BoxClient for interacting with Box API. |
Methods:
Name | Description |
---|---|
ai_extract |
Extracts AI generated content from a Box file. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_id
|
str
|
The ID of the Box file. |
required |
ai_prompt
|
str
|
The AI prompt to use for extraction. |
required |
Returns:
Name | Type | Description |
---|---|---|
Document |
A Document object containing the extracted AI content. |
Source code in llama-index-integrations/tools/llama-index-tools-box/llama_index/tools/box/ai_extract/base.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
ai_extract #
ai_extract(file_id: str, ai_prompt: str) -> Document
Extracts AI generated content from a Box file using the provided AI prompt.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_id
|
str
|
The ID of the Box file to process. |
required |
ai_prompt
|
str
|
The AI prompt to use for content extraction. |
required |
Returns:
Name | Type | Description |
---|---|---|
Document |
Document
|
A Document object containing the extracted AI content, |
Document
|
including metadata about the original Box file. |
Source code in llama-index-integrations/tools/llama-index-tools-box/llama_index/tools/box/ai_extract/base.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
BoxAIPromptToolSpec #
Bases: BaseToolSpec
Generates AI prompts based on a Box file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
box_client
|
BoxClient
|
A BoxClient instance for interacting with Box API. |
required |
Attributes:
Name | Type | Description |
---|---|---|
spec_functions |
list
|
A list of supported functions. |
_box_client |
BoxClient
|
An instance of BoxClient for interacting with Box API. |
Methods:
Name | Description |
---|---|
ai_prompt |
Generates an AI prompt based on a Box file. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_id
|
str
|
The ID of the Box file. |
required |
ai_prompt
|
str
|
The base AI prompt to use. |
required |
Returns:
Name | Type | Description |
---|---|---|
Document |
A Document object containing the generated AI prompt. |
Source code in llama-index-integrations/tools/llama-index-tools-box/llama_index/tools/box/ai_prompt/base.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
ai_prompt #
ai_prompt(file_id: str, ai_prompt: str) -> Document
Generates an AI prompt based on a Box file.
Retrieves the specified Box file, constructs an AI prompt using the provided base prompt, and returns a Document object containing the generated prompt and file metadata.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_id
|
str
|
The ID of the Box file to process. |
required |
ai_prompt
|
str
|
The base AI prompt to use as a template. |
required |
Returns:
Name | Type | Description |
---|---|---|
Document |
Document
|
A Document object containing the generated AI prompt and file metadata. |
Source code in llama-index-integrations/tools/llama-index-tools-box/llama_index/tools/box/ai_prompt/base.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
BoxSearchByMetadataToolSpec #
Bases: BaseToolSpec
Provides functionalities for searching Box resources based on metadata.
This class allows you to search for Box resources based on metadata specified
using the BoxSearchByMetadataOptions
class. It utilizes the Box API search
functionality and returns a list of Document
objects containing information
about the found resources.
Attributes:
Name | Type | Description |
---|---|---|
spec_functions |
list
|
A list of supported functions (always "search"). |
_box_client |
BoxClient
|
An instance of BoxClient for interacting with Box API. |
_options |
BoxSearchByMetadataOptions
|
An instance of BoxSearchByMetadataOptions containing search options. |
Methods:
Name | Description |
---|---|
search |
Optional[str] = None) -> List[Document]:
Performs a search for Box resources based on the configured metadata options
and optional query parameters. Returns a list of |
Source code in llama-index-integrations/tools/llama-index-tools-box/llama_index/tools/box/search_by_metadata/base.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
search #
search(query_params: Optional[str] = None) -> List[Document]
Searches for Box resources based on metadata and returns a list of documents.
This method leverages the configured metadata options (self._options
) to
search for Box resources. It converts the provided JSON string (query_params
)
into a dictionary and uses it to refine the search based on additional
metadata criteria. It retrieves matching Box files and then converts them
into Document
objects containing relevant information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query_params
|
Optional[str]
|
An optional JSON string representing additional query parameters for filtering by metadata. |
None
|
Returns:
Type | Description |
---|---|
List[Document]
|
List[Document]: A list of |
Source code in llama-index-integrations/tools/llama-index-tools-box/llama_index/tools/box/search_by_metadata/base.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
BoxSearchToolSpec #
Bases: BaseToolSpec
Provides functionalities for searching Box resources.
This class allows you to search for Box resources based on various criteria
specified using the BoxSearchOptions
class. It utilizes the Box API search
functionality and returns a list of Document
objects containing information
about the found resources.
Attributes:
Name | Type | Description |
---|---|---|
spec_functions |
list
|
A list of supported functions (always "box_search"). |
_box_client |
BoxClient
|
An instance of BoxClient for interacting with Box API. |
_options |
BoxSearchOptions
|
An instance of BoxSearchOptions containing search options. |
Methods:
Name | Description |
---|---|
box_search |
str) -> List[Document]:
Performs a search for Box resources based on the provided query and configured
search options. Returns a list of |
Source code in llama-index-integrations/tools/llama-index-tools-box/llama_index/tools/box/search/base.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
box_search #
box_search(query: str) -> List[Document]
Searches for Box resources based on the provided query and configured search options.
This method utilizes the Box API search functionality to find resources matching the provided
query and search options specified in the BoxSearchOptions
object. It returns a list of
Document
objects containing information about the found resources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
str
|
The search query to use for searching Box resources. |
required |
Returns:
Type | Description |
---|---|
List[Document]
|
List[Document]: A list of |
Source code in llama-index-integrations/tools/llama-index-tools-box/llama_index/tools/box/search/base.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
BoxTextExtractToolSpec #
Bases: BaseToolSpec
Box Text Extraction Tool Specification.
This class provides a specification for extracting text content from Box files and creating Document objects. It leverages the Box API to retrieve the text representation (if available) of specified Box files.
Attributes:
Name | Type | Description |
---|---|---|
_box_client |
BoxClient
|
An instance of the Box client for interacting with the Box API. |
Source code in llama-index-integrations/tools/llama-index-tools-box/llama_index/tools/box/text_extract/base.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
extract #
extract(file_id: str) -> Document
Extracts text content from Box files and creates Document objects.
This method utilizes the Box API to retrieve the text representation (if available) of the specified Box files. It then creates Document objects containing the extracted text and file metadata.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_id
|
str
|
A of Box file ID to extract text from. |
required |
Returns:
Type | Description |
---|---|
Document
|
List[Document]: A list of Document objects containing the extracted text content and file metadata. |
Source code in llama-index-integrations/tools/llama-index-tools-box/llama_index/tools/box/text_extract/base.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|