Skip to content

Commit

Permalink
samples fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bszwarc committed Oct 8, 2024
1 parent 6bf0201 commit 084ef67
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
2 changes: 0 additions & 2 deletions content/guides/box-ai/ai-agents/get-agent-default-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ Box AI API is currently a beta feature offered subject to Box’s Main Beta Agre
The `GET /2.0/ai_agent_default` endpoint allows you to fetch the default configuration for AI services.
Once you get the configuration details you can override them using the [`ai_agent`][ai-agent-config] parameter.

For details and override use cases, see the [tutorials][override-tutorials].

## Send a request

To send a request, use the
Expand Down
28 changes: 14 additions & 14 deletions content/guides/box-ai/ai-agents/overrides-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The override examples include:

A sample configuration for `ai/ask` is as follows:

```curl
```sh
{
"type": "ai_agent_ask",
"basic_text": {
Expand Down Expand Up @@ -140,7 +140,7 @@ For OpenAI models, temperature is the sampling temperature with values between 0
The `system_message` parameter's aim is to help the LLM understand its role and what it’s supposed to do.
For example, if your solution is processing travel itineraries, you can add a system message saying:

```curl
```sh
You are a travel agent aid. You are going to help support staff process large amounts of schedules, tickets, etc.
```

Expand All @@ -157,7 +157,7 @@ query result.
The first step is to ask Box AI to summarize a document about Box AI for Documents.
The `mode` parameter is set to `single_item_qa` because only one document is supplied.

```curl
```sh
curl -i -L POST "https://api.box.com/2.0/ai/ask" \
-H "content-type: application/json" \
-H "authorization: <Bearer TOKEN>" \
Expand All @@ -175,7 +175,7 @@ curl -i -L POST "https://api.box.com/2.0/ai/ask" \

You will get a response similar to the following:

```curl
```sh
{
"answer": "Box AI for Documents is a tool that enhances document analysis by allowing users to summarize content, identify key points, and draft outlines directly from files in Box. It supports various file types, including text documents, spreadsheets, and presentation slides. Users can initiate interactions with Box AI through the web app, where they can select suggestions or type specific questions. Responses are generated in real time, and users have options to save or clear chat history. The document also provides guidelines for effective inquiries and troubleshooting tips for potential issues with using Box AI.",
"created_at": "2024-10-08T00:29:07.283-07:00",
Expand All @@ -185,7 +185,7 @@ You will get a response similar to the following:

To further improve the result, you can use the `prompt_template` parameter to add some more instructions for Box AI. In this example, let's change the tone of the response.

```curl
```sh
{
"prompt": "Summarize this article about Box AI for Documents",
"mode": "single_item_qa",
Expand All @@ -207,7 +207,7 @@ To further improve the result, you can use the `prompt_template` parameter to ad

The response would be slightly less formal:

```curl
```sh
{
"answer": "Box AI for Documents is a tool that helps you analyze and gain insights from your documents in Box. You can use it to summarize content, identify key points, and draft outlines, making it easier to handle meeting notes, reports, and marketing materials. To get started, just open a file in the Box web app and click the Box AI button. It offers quick suggestions like summarizing the document or checking for next steps. Responses are generated in real time, and you can save them or clear chat history as needed. Just remember, Box AI only pulls info from the document you're viewing, so be specific with your questions!",
"created_at": "2024-10-08T00:38:01.767-07:00",
Expand All @@ -221,7 +221,7 @@ This example shows you how changing the AI model in the `ai_agent` options can i

First let's generate some text using the `POST ai/text_gen` endpoint. This endpoint is using the OpenAI 3.5 turbo model by default.

```curl
```sh
curl -i -L POST "https://api.box.com/2.0/ai/text_gen" \
-H "content-type: application/json" \
-H "authorization: Bearer TOKEN" \
Expand All @@ -238,7 +238,7 @@ curl -i -L POST "https://api.box.com/2.0/ai/text_gen" \
The response is as follows:
```curl
```sh
{
"answer": "🌟 Exciting News! 🌟\n\nIntroducing Box AI for documents - your new best friend in creating smarter, more efficient content! 🤖💡\n\n🔹 Say goodbye to manual searching and organizing - Box AI does it all for you!\n🔹 Enjoy lightning-fast document analysis and categorization.\n🔹 Boost productivity with automated suggestions and smart recommendations.\n🔹 Collaborate seamlessly with real-time insights and intelligent tagging.\n\nExperience the future of document creation with Box AI - making work easier, faster, and more fun! 🚀💻 #BoxAI #SmartDocuments",
"created_at": "2024-10-08T01:19:06.22-07:00",
Expand All @@ -248,7 +248,7 @@ The response is as follows:
Let's change the model using the `ai_agent` configuration:

```curl
```sh
curl -i -L POST "https://api.box.com/2.0/ai/text_gen" \
-H "content-type: application/json" \
-H "authorization: Bearer TOKEN" \
Expand All @@ -272,7 +272,7 @@ curl -i -L POST "https://api.box.com/2.0/ai/text_gen" \
After the model switch, the response is slightly different:
```curl
```sh
{
"answer": "🚀 **Boost Your Productivity with Box AI for Documents!** 📄✨\n\nSay goodbye to tedious document creation and editing! With Box AI, you can streamline your workflow and focus on what truly matters. Here’s why you’ll love it:\n\n1. **Smart Suggestions** 🤖: Get real-time recommendations to enhance your content.\n2. **Automated Formatting** 📝: Ensure consistency across all your documents effortlessly.\n3. **Collaboration Made Easy** 👥: Work seamlessly with your team, no matter where they are.\n4. **Time-Saving Templates** ⏳: Use pre-built templates to speed up document creation.\n5. **Enhanced Accuracy** ✅: Reduce errors with intelligent proofreading.\n\nTransform the way you work with documents and experience a new level of efficiency with Box AI! 🌟",
"created_at": "2024-10-08T01:28:36.777-07:00",
Expand All @@ -287,7 +287,7 @@ As you can see the responses differ to some extent. Thanks to the model switch,
Switching models can also give us different results for metadata extraction.
Let's use a sample contract to extract the metadata. In this example, the model used is Google Gemini.
```curl
```sh
curl -i -L 'https://api.box.com/2.0/ai/extract' \
-H 'content-type: application/json' \
-H 'authorization: Bearer TOKEN' \
Expand All @@ -304,7 +304,7 @@ curl -i -L 'https://api.box.com/2.0/ai/extract' \

The response is a set of metadata:

```curl
```sh
{
"answer": "{\"Buyer Legal Entity Name\": \"Acme Retail Corp.\", \"Supplier Legal Entity Name\": \"Acme Manufacturing Inc.\", \"Buyer Contact Person\": \"Jane Doe\", \"Supplier Contact Person\": \"Eva Smith\", \"Payment Term\": \"payment in full before pickup of goods\", \"Invoice Currency\": \"Euro\", \"Incoterm\": \"FCA Amsterdam\", \"Governing Law\": \"laws state jurisdiction in which supplier is located\", \"Effective Date\": \"March 27, 2024\", \"Buyer Signature Date\": \"March 28th, 2024\", \"Supplier Signature Date\": \"March 28th, 2024\"}",
"created_at": "2024-10-08T01:53:14.993-07:00",
Expand All @@ -314,7 +314,7 @@ The response is a set of metadata:

Let's change the model to the most recent OpenAI option:

```curl
```sh
curl -i -L 'https://api.box.com/2.0/ai/extract' \
-H 'content-type: application/json' \
-H 'authorization: Bearer TOKEN' \
Expand All @@ -337,7 +337,7 @@ curl -i -L 'https://api.box.com/2.0/ai/extract' \

Using this model results in a response listing more metadata entries:

```curl
```sh
{
"answer": "{\"Effective Date\": \"March 27, 2024\", \"Supplier Legal Entity Name\": \"Acme Manufacturing Inc.\", \"Supplier Registered Office Address\": \"123 Main Street\", \"Supplier Contact Person(s)\": \"Eva Smith\", \"Buyer Legal Entity Name\": \"Acme Retail Corp.\", \"Buyer Registered Office Address\": \"456 Market Avenue\", \"Buyer Contact Person(s)\": \"Jane Doe\", \"Incoterm\": \"FCA Amsterdam\", \"Payment Term\": \"payment in full before pickup of goods\", \"Invoice Currency\": \"Euro\", \"Buyer Printed Name\": \"Jane Doe\", \"Buyer Date\": \"March 28th, 2024\", \"Buyer Title / Position\": \"CEO\", \"Seller Printed Name\": \"Eve Smith\", \"Seller Date\": \"March 28th, 2024\", \"Seller Title / Position\": \"Sales Manager\"}",
"created_at": "2024-10-08T01:54:28.099-07:00",
Expand Down

0 comments on commit 084ef67

Please sign in to comment.