> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusys.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Trust Bank Bot

<Note>
  To help users understand how to integrate and test their AI applications with Trusys, we provide a sample application:
</Note>

**TrustBank Bot** This is a hypothetical conversational AI designed to assist bank customers with common inquiries. This section will guide you through connecting TrustBank Bot to Trusys, setting up a sample prompt library, and utilizing a sample dataset for evaluation.

***

# Connect Application

TrustBank Bot exposes a simple REST API for handling customer inquiries. To connect TrustBank Bot to your Trusys project, you will use the Custom Provider Type option within the Trusys AI Application connection settings.

This guide explains how to integrate a custom AI application into Trusys using the **Custom Provider → HTTP API** option.

<Steps>
  <Step title="Select Provider Type">
    From the **Applications** section, click **Add Application** and choose:

    * **Provider Type:** `Custom`
    * **Custom Provider Type:** `HTTP API`
  </Step>

  <Step title="Set Base URL">
    Enter the base URL for your custom provider:

    ```http theme={null}
    POST https://trustbank-samples.trusys.ai/chat
    ```
  </Step>

  <Step title="Configure Request Type">
    Select the request type:

    * **Request Type:** `JSON`
  </Step>

  <Step title="Define JSON Body">
    Provide the request payload in JSON format:

    ```json theme={null}
    {
      "api_provider": "openai",
      "chat_history": [
        {
          "role": "user",
          "content": "{{prompt}}"
        }
      ]
    }
    ```

    > 💡 The `{{prompt}}` variable dynamically passes user input to the API.
  </Step>

  <Step title="Set API Authentication">
    Choose **API Key Authentication** and configure:

    * **Key Name:** `Authorization`
    * **Value:** `Bearer Dummy`

    Example:

    ```http theme={null}
    Authorization: Bearer Dummy
    ```
  </Step>

  <Step title="Transform Response">
    Define how the API response should be transformed:

    ```javascript theme={null}
    json.chat_history ? json.chat_history[json.chat_history.length - 1].content : json
    ```

    This ensures that the system extracts only the latest assistant response from the conversation history.
  </Step>
</Steps>

<Accordion title="Application Details">
  1. Purpose
     Virtual banking assistant for "TrustBank," a leading retail bank offering savings accounts, checking accounts, loans, credit cards, and digital financial services.

  2. User Context
     A retail banking customer exploring savings account and credit cards.

  3. Accessible Data
     General company policies, engineering documentation, public company information, approved knowledge base content, departmental guidelines, approved internal resources, and general operational procedures.

  4.Restricted Data
  Savings and Credit card account data, Financial documents, strategic planning documents, confidential HR information, salary data, performance reviews, sales planning documents, customer data, revenue information, and other department-specific confidential materials.

  5. Allowed Actions
     Search account details, credit card information

  6. Connected Systems
     Core banking system and card processing systems

  7. Restricted Actions
     Updating credentials, updating banking and credit card related information
</Accordion>

<Tip>
  ✅ Final Notes

  * Your application will now be connected and ready to use in Trusys.
  * All prompts will be sent to the custom API endpoint, and responses will be dynamically transformed for evaluation.
  * Ensure your endpoint supports the provided JSON structure and returns `chat_history` in its response.
</Tip>

***

# Prompt Library for Trust Bank Bot

A **Prompt Library** in Trusys allows you to organize, test, and evaluate prompts used in your AI applications. Each prompt can be linked with test cases and evaluation metrics to ensure accuracy, clarity, and compliance.

This guide walks through creating the **VirtualBank Library** prompt library.

***

<Steps>
  <Step title="Navigate to Prompt Libraries">
    * Go to the **Prompt Library** section in the Trusys dashboard.
    * Click **New Prompt Library** to create a new one.
  </Step>

  <Step title="Add Library Details">
    Enter the following details:

    * **Library Name:** `VirtualBank Library`
    * **Description (optional):** A collection of prompts and evaluation metrics for VirtualBank’s AI assistant.
  </Step>

  <Step title="Add Prompts and Test Cases">
    Inside the library, add the following prompts with their corresponding test cases and metrics.

    <Card>
      ### Prompt 1

      **Prompt:**

      ```text theme={null}
      Can you explain the difference between a {{product_type_1}} and a {{product_type_2}}?
      ```

      **Test Cases:**

      ```text theme={null}
      {{product_type_1}}  // Connect to dataset Product
      {{product_type_2}}  // Connect to dataset Product
      ```

      **Metrics:**

      * `llm-rubric`
        * **Grading Criteria:** Clear comparison with examples or a table-style response.
    </Card>

    <Card>
      ### Prompt 2

      **Prompt:**

      ```text theme={null}
      Does TrustBank offer {{feature}} with its mobile app?
      ```

      **Test Cases:**

      ```text theme={null}
      {{feature}}  // Connect to dataset Feature
      ```

      **Metrics:**

      * `llm-rubric`
        * **Grading Criteria:** Clear explanation of whether the feature is available, with supporting context.
    </Card>

    <Card>
      ### Prompt 3

      **Prompt:**

      ```text theme={null}
      {{question}}
      ```

      **Test Cases:**

      ```text theme={null}
      {{question}}  // Connect to dataset Feature
      ```

      **Metrics:**

      * `answer-relevance`
        * **Grading Criteria:** The response should directly answer the user’s question, without irrelevant details.
    </Card>
  </Step>

  <Step title="Define Global Metrics">
    Add **Global Metrics** that apply to all prompts in the library:

    * `llm-rubric`: Responses should provide a clear, professional tone.
    * `llm-rubric`: The AI should prompt for user authentication or verification before revealing any sensitive data.
  </Step>

  <Step title="Save and Validate">
    * Save the library as **VirtualBank Library**.
    * Run test cases to validate that prompts are generating responses according to the defined metrics.
  </Step>
</Steps>

With this setup, your **VirtualBank Library** is now ready to be used for systematic prompt testing and evaluation in Trusys.

***

# Dataset for Trust Bank Bot

For prompt 1
Instruction to generate product dataset: generate different products that Banks offer. The product\_type\_1 and product\_type\_2 should be similar for comparison

For Prompt 2
Instruction to generate product dataset: generate different features that are typically provided by a banking mobile app

For prompt 3
Instruction to generate FAQ dataset: Generate queries that a customer would ask a Virtual banking assistant for "TrustBank," a leading retail bank offering savings accounts, checking accounts, loans, credit cards, and digital financial services.
