Skip to content

Commit

Permalink
feat: Support Box AI endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
congminh1254 committed Jul 9, 2024
1 parent 035fd7a commit 51cbc24
Show file tree
Hide file tree
Showing 13 changed files with 8,482 additions and 5,175 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Avatar URL: 'https://app.box.com/api/avatar/large/77777'
<!-- commands -->
# Command Topics

* [`box ai`](docs/ai.md) - Sends an AI request to supported LLMs and returns an answer
* [`box autocomplete`](docs/autocomplete.md) - Display autocomplete installation instructions
* [`box collaboration-allowlist`](docs/collaboration-allowlist.md) - List collaboration allowlist entries
* [`box collaborations`](docs/collaborations.md) - Manage collaborations
Expand Down
83 changes: 83 additions & 0 deletions docs/ai.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
`box ai`
========

Sends an AI request to supported LLMs and returns an answer

* [`box ai:ask`](#box-aiask)
* [`box ai:text-gen`](#box-aitext-gen)

## `box ai:ask`

Sends an AI request to supported LLMs and returns an answer

```
USAGE
$ box ai:ask
OPTIONS
-h, --help Show CLI help
-q, --quiet Suppress any non-error output to stderr
-s, --save Save report to default reports folder on disk
-t, --token=token Provide a token to perform this call
-v, --verbose Show verbose output, which can be helpful for debugging
-y, --yes Automatically respond yes to all confirmation prompts
--as-user=as-user Provide an ID for a user
--bulk-file-path=bulk-file-path File path to bulk .csv or .json objects
--csv Output formatted CSV
--fields=fields Comma separated list of fields to show
--items=items (required) The items for the AI request
--json Output formatted JSON
--mode=mode The mode of the AI request, should be 'single_item_qa' for one item or
'multi_item_qa' for multiple items
--no-color Turn off colors for logging
--prompt=prompt (required) The prompt for the AI request
--save-to-file-path=save-to-file-path Override default file path to save report
EXAMPLE
box ai:ask --mode single_item_qa --items=id=12345,type=file --prompt "What is the status of this document?"
```

_See code: [src/commands/ai/ask.js](https://github.com/box/boxcli/blob/v3.14.1/src/commands/ai/ask.js)_

## `box ai:text-gen`

Sends an AI request to supported LLMs and returns an answer specifically focused on the creation of new text.

```
USAGE
$ box ai:text-gen
OPTIONS
-h, --help Show CLI help
-q, --quiet Suppress any non-error output to stderr
-s, --save Save report to default reports folder on disk
-t, --token=token Provide a token to perform this call
-v, --verbose Show verbose output, which can be helpful for debugging
-y, --yes Automatically respond yes to all confirmation prompts
--as-user=as-user Provide an ID for a user
--bulk-file-path=bulk-file-path File path to bulk .csv or .json objects
--csv Output formatted CSV
--dialogue_history=dialogue_history The history of prompts and answers previously passed to the LLM.
--fields=fields Comma separated list of fields to show
--items=items (required) The items to be processed by the LLM, often files. The array can
include exactly one element.
--json Output formatted JSON
--no-color Turn off colors for logging
--prompt=prompt (required) The prompt for the AI request
--save-to-file-path=save-to-file-path Override default file path to save report
EXAMPLE
box ai:text-gen --dialogue_history=prompt="What is the status of this document?",answer="It is in review"
--items=id=12345,type=file --prompt="What is the status of this document?"
```

_See code: [src/commands/ai/text-gen.js](https://github.com/box/boxcli/blob/v3.14.1/src/commands/ai/text-gen.js)_
Loading

0 comments on commit 51cbc24

Please sign in to comment.