Strongly.AI Documentation v 0.0.1

Thank you for installing Strongly.AI - Generative AI Governance Platform. If you have any questions that are beyond the scope of this documentation, please feel free to email to info@strongly.ai.


Introduction

Strongly is empowering organizations with next-generation AI monitoring, data loss prevention, and risk mitigation tools for Generative AI models including ChatGPT.


Setup & Installation

Strongly.AI is a comprehensive AI governance platform consisting of two primary components: the Strongly.AI platform and the browser plugin. This guide will walk you through the setup and installation process for both components.

Strongly.AI Platform Components

The Strongly.AI platform is built on a robust architecture comprising:

  • Platform server: Handles requests and business logic
  • MongoDB database: Stores data, configurations, and analytics
  • Internally trained LLM model: Powers advanced AI capabilities
Deployment Options
1. Strongly Cloud (Managed Service)

Our recommended option for most organizations, offering a hassle-free experience.

  • Fully managed by Strongly.AI's expert team
  • Bi-weekly updates with the latest features and security patches
  • 99.9% uptime SLA
  • Hosted on AWS infrastructure for reliability and scalability
  • Available through:

Advantages of Strongly Cloud:

  • Zero infrastructure management
  • Automatic scaling to meet demand
  • Built-in redundancy and disaster recovery
  • 24/7 monitoring and support
  • Compliance with major security standards (SOC 2, GDPR, HIPAA)
2. Private Cloud

For organizations requiring greater control over their infrastructure:

  • AWS: Deployed using Terraform templates
  • GCP: Deployed using Terraformtemplates
  • Azure: Deployed using Terraform templates

Our team provides comprehensive installation scripts and guidance throughout the process.

3. On-Premise

For organizations with strict data residency requirements or existing on-premise infrastructure:

  • Compatible with VMware vSphere and Microsoft Hyper-V environments
  • Deployment assisted by Strongly.AI's technical team
  • Custom integration with existing security and monitoring tools
Installation Process
  1. Choose your preferred deployment option
  2. For Strongly Cloud:
    1. Contact our sales team or visit the AWS Marketplace
    2. Complete the subscription process
    3. Receive access information via email
  3. For Private Cloud or On-Premise:
    1. Schedule a consultation with our technical team
    2. Receive customized installation scripts and documentation
    3. Follow the step-by-step installation guide provided
    4. Verify the installation with our team

Estimated installation time:

  • Strongly Cloud: 15-30 minutes
  • Private Cloud: 2-4 hours
  • On-Premise: 4-8 hours
Initial Setup
  1. Access the Strongly.AI platform using the provided URL
  2. Log in using the default credentials:
    • Username: admin@admin.com
    • Password: changeme
  3. Complete the onboarding sequence:
    1. Set up admin credentials (use a strong, unique password)
    2. Enter company information
    3. Select initial seat plan:
      • Basic: Ideal for small teams or PoC
      • Professional: Full feature set for enterprise use
      • Developer: Suitable for development of applications using Strongly's functionality via API
    4. Configure initial security settings
    5. Set up email notifications

Note: Seat plans and configurations can be modified later in the Billing panel.

Browser Plugin Installation

The Strongly.AI browser plugin enhances your AI governance capabilities directly in your web browser. Our plugin is built with Chromium and supports all Chromium-based browsers.

  1. Visit the Chrome Web Store
  2. Search for "Strongly.AI"
  3. Click "Add to Chrome" (or the equivalent in your Chromium-based browser)
  4. Follow the browser's installation prompts
  5. Once installed, click the Strongly.AI icon in your browser toolbar
  6. Log in using your Strongly.AI credentials

Supported Browsers: Our plugin works with all Chromium-based browsers, including but not limited to:

  • Google Chrome
  • Microsoft Edge
  • Brave
  • Opera
  • Vivaldi

Note: If you're using a browser not listed here but it's Chromium-based, our plugin should still be compatible. If you encounter any issues, please contact our support team.

Post-Installation Steps
  1. Set up user accounts for your team members
  2. Customize AI governance policies according to your organization's needs
  3. Schedule a training session with our team for your administrators
  4. Run initial tests to ensure all components are functioning correctly
Troubleshooting

If you encounter any issues during installation or setup:

  1. Consult our comprehensive troubleshooting guide
  2. Check our knowledge base for known issues and solutions
  3. Contact our support team at info@strongly.AI
Security Best Practices
  • Use strong, unique passwords for all accounts
  • Enable Google SSO authentication for added security
  • Regularly review and update user access permissions
  • Keep your Strongly.AI platform and browser plugin up to date
  • Implement network segmentation to isolate the Strongly.AI platform
  • Regularly backup your MongoDB database
  • Monitor system logs for any suspicious activity

For additional assistance or questions about the setup and installation process, please don't hesitate to contact our dedicated support team.


Plans

Strongly.AI employs a consumption-based billing approach, with charges calculated based on the number of tokens used. We offer three distinct plans to cater to various needs and usage levels.

What are Tokens?

Tokens are the basic units of text processing in our AI models. They represent small chunks of text, typically consisting of a few characters or a word. The number of tokens used in a task determines the computational resources required and, consequently, the cost of that task.

Available Plans
Plan Description Token Limit Key Features
Basic Entry-level plan for small teams or initial testing 1 Million tokens Standard features
Professional Comprehensive plan for most business needs 8 Million tokens Advanced features
Developer Tailored for development and integration purposes 100 Million tokens API access, external integrations
Token System
  • Each plan comes with a set limit of available tokens, as shown in the table above.
  • Tokens are consumed when using features that require LLM (Language Model) functionality.
  • Plan tokens reset at the end of each month.
  • Additional company-wide tokens can be purchased to supplement individual plan limits.
  • Company-wide tokens expire at the end of each month.
Managing Plans and Tokens

Administrators have full control over plan management and token allocation:

  • Assign plans to users in the User section.
  • Add, remove, and change seats in the billing section.
  • Purchase additional company-wide tokens in the billing section.
Developer Plan Features

Users with Developer plans have access to additional capabilities:

  • Create API tokens for external integrations.
  • Utilize Strongly.AI features via our Python package.
  • Integrate Strongly.AI functionality into custom platforms and workflows.
Token Depletion

When a user exhausts their token allocation:

  • The platform will display a notification to the user.
  • An alert will be sent to both the user and the administrator.
  • If company-wide tokens are available, the user can continue using token-dependent features.
  • If no company-wide tokens remain, access to features requiring tokens (LLM functionality) will be restricted until the next renewal or token purchase.
Upgrading or Changing Plans

To upgrade your plan or make changes to your current subscription:

  1. Log in to your Strongly.AI account as an administrator.
  2. Navigate to the Billing section.
  3. Select "Manage Plan" to view available options.
  4. Choose the desired plan or make necessary adjustments.

For any questions about our plans or assistance with billing, please contact our support team at billing@strongly.ai.


Users

Strongly.AI provides flexible options for user management, allowing both self-registration and admin-controlled user addition. This section outlines the processes for adding, managing, and removing users from the platform.

Adding Users

There are two ways to add users to Strongly.AI:

1. Self-Registration
  1. New users can register via the login page.
  2. After registration, users cannot access the app immediately.
  3. An admin must complete their profile and activate the account before access is granted.
2. Admin-Controlled Addition
  1. Admins can add users directly through the User section of the admin dashboard.
  2. This method allows for immediate setup and activation of user accounts.
Completing User Profiles

For users registered through the login page, admins must complete their profiles:

  1. Navigate to the User section in the admin dashboard.
  2. Locate the new user's profile.
  3. Add the following details:
    • Organization
    • Team
    • Role
  4. Toggle the user's status to "Active".
User Self-Management

Once their account is active, users can:

  • Log into their account.
  • Access their individual profile settings.
  • Add or update additional personal details as needed.
Admin User Management

Admins have full control over user accounts and can perform the following actions at any time:

  • Make a user inactive by toggling their status.
  • Completely remove a user from the system.
  • Edit user details, including organization, team, and role.
Best Practices for User Management
  • Regularly review user accounts to ensure they are up-to-date and necessary.
  • Implement a process for offboarding users when they leave the organization.
  • Encourage users to maintain strong, unique passwords for their accounts.
  • Consider implementing multi-factor authentication for enhanced security.
  • Periodically audit user roles and permissions to ensure appropriate access levels.

For assistance with user management or any questions about user roles and permissions, please contact our support team at user-support@strongly.ai.


API Keys

API keys are essential for integrating Strongly.AI's powerful features into your platforms and workflows. They provide secure access to our API endpoints, allowing you to leverage our AI governance capabilities programmatically.

Generating API Keys

API tokens can be generated by users with Developer or Admin roles. To create a new API key:

  1. Navigate to the "API Keys" section in your Strongly.AI dashboard.
  2. Click the "New Key" button.
  3. Provide a unique name for your key to easily identify its purpose or associated project.
  4. Select the key type (Standard or Fine-grained).
  5. For Fine-grained keys, configure the filter settings (see below).
  6. Click "Generate" to create your new API key.
Fine-grained API Keys

Fine-grained API keys offer more granular control over the filters applied to API requests. When creating a fine-grained key, you can:

  • Select from standard, custom, and AI hub filters.
  • For each selected filter, choose the action to be taken:
    • Block: Prevent the API request from proceeding if the filter is triggered.
    • Alert: Allow the request but generate an alert for review.
    • Mask: Redact or obfuscate the text that triggered the filter.
Managing API Keys

To manage your existing API keys:

  1. Go to the "API Keys" section in your dashboard.
  2. Locate the key you wish to manage.
  3. Click the "Manage" dropdown next to the key.
  4. Available actions include:
    • Invalidate and Refresh: Revoke the current key and generate a new one with the same settings.
    • Delete: Permanently remove the API key.
Best Practices for API Key Security
  • Never share your API keys or commit them to version control systems.
  • Use environment variables or secure key management systems to store API keys in your platforms.
  • Regularly rotate your API keys to minimize the risk of unauthorized access.
  • Use fine-grained keys with the minimum necessary permissions for each integration.
  • Monitor API key usage and investigate any unusual activity promptly.
Recovering Lost Keys

If you lose access to an API key or suspect it has been compromised:

  1. Immediately invalidate the lost or compromised key using the "Invalidate and Refresh" option.
  2. Generate a new API key to replace the invalidated one.
  3. Update any platforms or services using the old key with the new key.

For any questions or assistance with API keys, please contact our support team at api-support@strongly.ai.


Filters

Filters are crucial guardrails that secure data from being leaked in LLM prompts. They act as a protective layer, ensuring sensitive information is handled appropriately during AI interactions.

Types of Filters

Strongly.AI offers three types of filters to provide comprehensive protection:

1. Standard Filters
  • Provided by Strongly.AI for all users
  • Covers common PII (Personally Identifiable Information) items such as:
    • Addresses
    • Names
    • Organizations
    • Dates
    • Social Security Numbers (SSN)
  • Uses a combination of pattern matching (regex) and our proprietary LLM for identification
2. Custom Filters
  • Available for Professional and Developer plan users
  • Types of custom filters:
    • Pattern matching via user-created regex
    • Word and phrase filters
    • Topic filters (requires several examples of text describing the topic)
3. AIHub Filters
  • Available for Professional and Developer plan users
  • Marketplace of open-source and consumption-based third-party filters
  • Examples include:
    • Toxic language detection
    • Sentiment analysis
    • And more...
Filter Platform Hierarchy

Filters can be applied at various levels, with a hierarchical priority:

  1. Company (highest priority)
  2. Organization
  3. Team
  4. Role
  5. User (lowest priority)

Settings at higher levels take precedence over lower levels.

Filter Actions

For each filter, you can select one of the following actions:

  • Block: Restricts the prompt from being sent to the LLM
  • Alert: Notifies users and provides options to cancel or continue with the prompt
  • Mask: Replaces sensitive text with a synthetic replacement
Masking and Replacement

When using the "Mask" action:

  • Sensitive text is replaced with synthetic data in the prompt
  • Upon receiving the LLM response, the system attempts to replace the masked text with the original
  • Note: This replacement logic is not perfect, and users may sometimes see the masked value in responses
Adding AIHub Filters
  1. Navigate to the AIHub section in your Strongly.AI dashboard
  2. Browse available third-party filters
  3. Select the desired filter tile
  4. Complete the associated options and configuration
  5. Activate the filter for use in your environment
Data Protection and Security

In addition to our robust filtering system, Strongly.AI is committed to data protection:

  • All data is encrypted in transit and at rest
  • We adhere to strict data protection policies
  • Regular security audits and updates are performed to maintain the highest level of protection

For assistance in setting up or optimizing your filters, please contact our support team at filter-support@strongly.ai.


StronglyGPT

StronglyGPT is our advanced interface to Large Language Models (LLMs), designed to provide a secure, feature-rich environment for interacting with AI. It combines the power of multiple LLM providers with Strongly.AI's robust security and customization features.

Supported LLM Providers

StronglyGPT currently supports integration with the following LLM providers:

  • OpenAI
  • Anthropic
  • Google Gemini
  • Mistral
  • Strongly's proprietary LLM model
Key Features
1. Document Upload and Analysis

Easily incorporate external information into your AI interactions:

  • Upload and analyze PDF files
  • Process plain text documents
  • Integrate Microsoft Word files
2. Enhanced Code Responses

Improve readability and usability of code-related responses:

  • Syntax highlighting for various programming languages
  • Proper indentation and formatting
  • Easy copy-and-paste functionality for code snippets
3. Advanced Filtering and Security

Leverage Strongly.AI's robust filtering capabilities:

  • Highlighting of filtered words for easy identification
  • Detailed explanations for blocked prompts
  • Seamless integration with custom and AI Hub filters
Using StronglyGPT
  1. Log into your Strongly.AI account
  2. Navigate to the StronglyGPT interface
  3. Select your preferred LLM provider (if applicable)
  4. Start your conversation or upload documents for analysis
  5. Observe real-time filtering and security measures in action
  6. Review and utilize AI-generated responses, including formatted code when applicable
Customization and Feature Requests

We value user feedback and are always looking to enhance StronglyGPT. If you have suggestions for additional features or improvements:

  • Contact us at info@strongly.ai
  • Provide detailed information about your desired feature or enhancement
  • Our team will review your request and may reach out for further discussion
Best Practices for Using StronglyGPT
  • Regularly update your filters to ensure optimal security
  • Familiarize yourself with the specific capabilities of each supported LLM
  • Use document upload features to provide comprehensive context for complex queries
  • Pay attention to highlighted filtered words to maintain awareness of potential sensitive information
  • Leverage code formatting features for easier implementation of AI-suggested code

For technical support or questions about using StronglyGPT, please contact our dedicated support team at stronglygpt-support@strongly.ai.


Prompt Explorer

The Prompt Explorer is a powerful tool designed for administrators to gain insights into user interactions with the AI system. It provides a comprehensive view of prompts, allowing for analysis, search, and management of user inputs.

Key Features
1. Prompt Visualization
  • View a list of user prompts in a clear, organized format
  • See highlighted text where filters have been applied, providing instant visibility into potential sensitive information
  • Access detailed token usage statistics for each prompt
2. Search Functionality
  • Easily search through the database of user prompts
  • Filter prompts based on various criteria such as date, user, or specific keywords
  • Quickly locate prompts that triggered specific filters
3. Tagging System
  • Add custom tags to prompts for easy categorization and retrieval
  • Use tags to identify trends, common issues, or areas of interest
  • Filter and search prompts based on assigned tags
Using the Prompt Explorer
  1. Log into your Strongly.AI admin account
  2. Navigate to the Prompt Explorer section
  3. Use the search bar to find specific prompts or apply filters to narrow down results
  4. Click on a prompt to view its details, including highlighted filtered text and token usage
  5. Add or modify tags as needed for better organization and analysis
Benefits of the Prompt Explorer
  • Gain insights into how users are interacting with the AI system
  • Identify potential security risks or misuse of the platform
  • Analyze token usage patterns to optimize resource allocation
  • Improve filter effectiveness by studying real-world prompt data
  • Categorize and track trends in user queries for product improvement
Best Practices for Using Prompt Explorer
  • Regularly review prompts to stay informed about user behavior and potential issues
  • Use the tagging system consistently to maintain organized and easily searchable data
  • Pay close attention to prompts with multiple highlighted filter matches
  • Use insights gained from the Prompt Explorer to refine filters and improve system security
  • Collaborate with your team to identify patterns or concerns that may require action

For technical support or questions about using the Prompt Explorer, please contact our dedicated admin support team at admin-support@strongly.ai.


Analytics

Strongly.AI provides comprehensive analytics capabilities through four distinct dashboards, offering valuable insights into various aspects of your AI governance and usage patterns. These analytics tools empower administrators and decision-makers with data-driven information to optimize system performance, enhance security, and improve user experience.

Available Analytics Dashboards
1. User Analytics

Gain insights into individual and overall user behavior and performance:

  • Overall user activity metrics
  • Individual user usage patterns
  • Token consumption by user
  • Frequency of filter triggers per user
  • Most active users and teams
2. API Key Analytics

Monitor and analyze the usage of API keys within your organization:

  • Overall API key usage statistics
  • Individual API key performance metrics
  • Token consumption by API key
  • Frequency of requests per API key
  • Error rates and types associated with API keys
3. LLM Model Analytics

Evaluate the performance and usage of different LLM models:

  • Comparison of usage across supported LLM models
  • Token consumption by model
  • Response times and quality metrics
  • Most frequently used models by task type
  • Cost analysis per model
4. Filter Analytics

Analyze the effectiveness and impact of your filter settings:

  • Overall filter trigger frequency
  • Breakdown by filter type (standard, custom, AIHub)
  • Most frequently triggered filters
  • Filter action statistics (block, alert, mask)
  • False positive rates and filter accuracy metrics
Using the Analytics Dashboards
  1. Log into your Strongly.AI admin account
  2. Navigate to the Analytics section
  3. Select the desired dashboard (User, API Key, LLM Model, or Filter)
  4. View overall metrics or use dropdown menus to drill down into specific entities (e.g., individual users or API keys)
  5. Utilize date range selectors to analyze trends over time
  6. Export data or generate reports as needed for further analysis
Benefits of Using Analytics
  • Identify usage patterns and optimize resource allocation
  • Detect potential security risks or anomalies
  • Measure the effectiveness of your AI governance policies
  • Make data-driven decisions about LLM model selection and configuration
  • Improve filter accuracy and reduce false positives
  • Track ROI and justify AI investments within your organization
Best Practices for Leveraging Analytics
  • Regularly review all four dashboards to maintain a comprehensive overview
  • Set up custom alerts for key metrics to stay proactive
  • Use the drill-down features to investigate unusual patterns or spikes
  • Compare metrics across different time periods to identify trends
  • Share relevant insights with team leads and decision-makers
  • Use analytics data to inform updates to your AI governance policies

For assistance in interpreting analytics data or customizing your dashboards, please contact our analytics support team at analytics-support@strongly.ai.


REST API

The Strongly.AI REST API allows developers to integrate our AI alignment and observability features into their platforms. This section provides details on how to authenticate and use the various endpoints.

Authentication

All API requests must be authenticated using one of the following methods. Include the appropriate authentication in the header of your HTTP request:

  • For API key: X-API-Key: your_api_key_here
  • For session token: X-Auth-Token: your_session_token_here
  • For chatbot token: X-Chatbot-Token: your_chatbot_token_here (for chatbot-specific endpoints)
Base URL

All API requests should be made to: https://api.strongly.ai/v1/

Endpoints
Authentication Endpoints
Endpoint Method Description Request Format Response Format
/login POST Authenticate with email and password
{
              "email": "user@example.com",
              "password": "password123"
            }
{
              "userId": "user123",
              "authToken": "token123"
            }
/login/google POST Authenticate with Google SSO
{
              "accessToken": "google_access_token"
            }
{
              "userId": "user123",
              "authToken": "token123"
            }
/register POST Register a new user
{
              "email": "newuser@example.com",
              "password": "newpassword123",
              "profile": {
                "name": "John Doe"
              }
            }
{
              "userId": "user123",
              "authToken": "token123"
            }
/logout POST Log out the current user No body required
{
              "message": "Logged out successfully"
            }
Data Endpoints
Endpoint Method Description Request Format Response Format
/models GET Retrieve available AI models No body required
{
              "message": "Models retrieved successfully",
              "models": [
                {
                  "id": "gpt-3.5-turbo",
                  "name": "GPT-3.5 Turbo"
                },
                {
                  "id": "gpt-4",
                  "name": "GPT-4"
                }
              ],
              "userId": "user123"
            }
/filters GET Retrieve applied filters for the current user No body required
{
              "message": "Applied filters retrieved successfully",
              "filters": [
                {
                  "_id": "filter123",
                  "name": "PII Filter",
                  "value": "active",
                  "description": "Filters out personal identifiable information"
                },
                {
                  "_id": "filter456",
                  "name": "Profanity Filter",
                  "value": "high",
                  "description": "Filters out profane language"
                }
              ],
              "userId": "user123"
            }
/session/create POST Create a new chat session
{
              "sessionName": "New Chat Session",
              "browserId": "browser123" // Optional
            }
{
              "message": "Session created successfully",
              "sessionId": "session123",
              "browserId": "browser123" // Only if provided
            }
/session/delete POST Delete an existing chat session
{
              "sessionId": "session123"
            }
{
              "message": "Session deleted successfully"
            }
/session/rename POST Rename an existing chat session
{
              "sessionId": "session123",
              "newName": "Updated Session Name"
            }
{
              "message": "Session renamed successfully"
            }
/session/messages GET Retrieve messages for a specific chat session
{
              "sessionId": "session123"
            }
[
              {
                "id": "message1",
                "content": "Hello, how can I help you?",
                "role": "assistant",
                "timestamp": "2023-04-20T10:30:00Z"
              },
              {
                "id": "message2",
                "content": "I have a question about your services.",
                "role": "user",
                "timestamp": "2023-04-20T10:31:00Z"
              }
            ]
/session/update-browser POST Update browser ID for existing sessions
{
              "oldBrowserId": "browser123",
              "newBrowserId": "browser456"
            }
{
              "message": "Browser ID updated successfully",
              "sessionsUpdated": 2,
              "oldBrowserId": "browser123",
              "newBrowserId": "browser456"
            }
/session/get-by-browser GET Get session information by browser ID Query parameter: ?browserId=browser123
{
              "message": "Session found",
              "session": {
                "_id": "session123",
                "sessionName": "Chat Session",
                "createdAt": "2024-04-20T10:30:00Z"
              },
              "browserId": "browser123"
            }
/tokens GET Check token usage for the current user No body required
{
              "used": 5000,
              "total": 10000,
              "remaining": 5000
            }
Interaction Endpoints
Endpoint Method Description Request Format Response Format
/filterText POST Apply filters to input text
{
              "text": "Input text to filter",
              "sessionId": "session123"
            }
{
              "filteredText": "Filtered output text",
              "promptText": "Processed prompt text",
              "filter": {
                "filterCounts": [{"rule": "pii", "count": 2}, {"rule": "profanity", "count": 1}],
                "alerts": [{"rule": "pii", "match": "John Doe"}],
                "blocked": [{"rule": "profanity", "match": "badword"}],
                "hashed": [{"rule": "pii", "match": "john@example.com"}]
              },
              "messageId": "msg123"
            }
/message POST Submit a prompt for processing
{
              "model": {
                "model": "gpt-3.5-turbo",
                "displayModel": "GPT-3.5 Turbo",
                "messageId": "msg123",
                "session": {
                  "sessionId": "session123",
                  "sessionName": "Chat Session"
                },
                "temperature": 0.7,
                "maxTokens": 1024
              },
              "prompt": {
                "system": "System prompt",
                "assistant": "Assistant context",
                "contextPrompts": [],
                "message": "User message"
              },
              "filter": {
                "prompt": {
                  "filterCounts": [],
                  "alerts": [],
                  "blocked": [],
                  "hashed": [],
                  "isBlocked": false
                },
                "response": {
                  "filterCounts": [],
                  "alerts": [],
                  "blocked": [],
                  "hashed": [],
                  "isBlocked": false
                }
              }
            }
{
              "content": "AI-generated response",
              "usage": {
                "prompt_tokens": 10,
                "completion_tokens": 20,
                "total_tokens": 30
              }
            }
/parse-file POST Parse and extract text from various file types
{
              "fileName": "document.pdf",
              "fileType": "application/pdf",
              "fileContent": "data:application/pdf;base64,..."
            }
{
              "message": "File parsed successfully",
              "parsed_content": "Extracted text content",
              "metadata": {
                "fileName": "document.pdf",
                "fileType": "application/pdf",
                "timestamp": "2024-04-20T10:30:00Z",
                "chars": 1500,
                "words": 250
              }
            }
Browser Session Management

The API provides endpoints for managing sessions across different browsers and devices. Here's how to use the browser session management features:

  1. Creating a Session with Browser ID:
    • When creating a new session, you can optionally include a browserId to associate it with a specific browser/device.
    • The browserId can be any unique identifier you generate for the browser/device.
    • If no browserId is provided, the session will be created without browser association.
  2. Updating Browser IDs:
    • Use the /session/update-browser endpoint to migrate sessions from one browser ID to another.
    • This is useful when a user switches browsers or devices and wants to maintain their session history.
    • All sessions associated with the old browser ID will be updated to use the new one.
  3. Retrieving Sessions by Browser ID:
    • Use the /session/get-by-browser endpoint to find the most recent session for a given browser ID.
    • This helps in restoring a user's previous session when they return to your application.
    • The response includes basic session information including creation time and session name.
File Parsing

The /parse-file endpoint supports various file formats and provides extracted text content. Here are the supported file types and their specifications:

  • Text Files:
    • MIME type: text/plain
    • Direct text extraction with UTF-8 encoding
  • PDF Documents:
    • MIME type: application/pdf
    • Full text extraction with layout preservation
  • Word Documents:
    • MIME types: application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document
    • Supports both .doc and .docx formats
Example Requests

Here are examples of how to make requests to various endpoints using cURL:

Browser Session Management
// Create a session with browser ID
curl -X POST https://api.strongly.ai/v1/session/create \
     -H "Content-Type: application/json" \
     -H "X-Auth-Token: your_session_token_here" \
     -d '{
       "sessionName": "Browser Session",
       "browserId": "browser123"
     }'

// Update browser ID
curl -X POST https://api.strongly.ai/v1/session/update-browser \
     -H "Content-Type: application/json" \
     -H "X-Auth-Token: your_session_token_here" \
     -d '{
       "oldBrowserId": "browser123",
       "newBrowserId": "browser456"
     }'

// Get session by browser ID
curl -X GET https://api.strongly.ai/v1/session/get-by-browser?browserId=browser456 \
     -H "X-Auth-Token: your_session_token_here"
File Parsing
curl -X POST https://api.strongly.ai/v1/parse-file \
     -H "Content-Type: application/json" \
     -H "X-Auth-Token: your_session_token_here" \
     -d '{
       "fileName": "document.pdf",
       "fileType": "application/pdf",
       "fileContent": "data:application/pdf;base64,JVBERi0xLjcKCjEgMCBvYmoKPDwKL1R5cGUgL0..."
     }'
Filter Text
curl -X POST https://api.strongly.ai/v1/filterText \
     -H "Content-Type: application/json" \
     -H "X-Auth-Token: your_session_token_here" \
     -d '{
       "text": "My name is John Doe and my email is john@example.com. This is a badword.",
       "sessionId": "session123"
     }'
Submit Message
curl -X POST https://api.strongly.ai/v1/message \
     -H "Content-Type: application/json" \
     -H "X-Auth-Token: your_session_token_here" \
     -d '{
       "model": {
         "model": "gpt-3.5-turbo",
         "displayModel": "GPT-3.5 Turbo",
         "messageId": "msg123",
         "session": {
           "sessionId": "session123",
           "sessionName": "Chat Session"
         },
         "temperature": 0.7,
         "maxTokens": 1024
       },
       "prompt": {
         "system": "You are a helpful assistant.",
         "assistant": "",
         "contextPrompts": [],
         "message": "What is the capital of France?"
       },
       "filter": {
         "prompt": {
           "filterCounts": [],
           "alerts": [],
           "blocked": [],
           "hashed": [],
           "isBlocked": false
         },
         "response": {
           "filterCounts": [],
           "alerts": [],
           "blocked": [],
           "hashed": [],
           "isBlocked": false
         }
       }
     }'
Error Handling

The API uses standard HTTP response codes to indicate the success or failure of requests. In case of an error, the response will include a JSON object with an "error" field providing more details about the issue.

  • 200 - OK: The request was successful.
  • 400 - Bad Request: The request was invalid or cannot be served.
  • 401 - Unauthorized: The request requires authentication.
  • 403 - Forbidden: The server understood the request but refuses to authorize it.
  • 404 - Not Found: The requested resource could not be found.
  • 405 - Method Not Allowed: The method specified in the request is not allowed for the resource.
  • 413 - Payload Too Large: The request exceeds the maximum allowed size (e.g., file uploads).
  • 422 - Unprocessable Entity: The request was well-formed but contains invalid parameters.
  • 429 - Too Many Requests: Rate limit exceeded.
  • 500 - Internal Server Error: An unexpected server error occurred.
  • 503 - Service Unavailable: The service is temporarily unavailable (e.g., maintenance).
Rate Limiting

To ensure fair usage and maintain service quality, API requests are subject to rate limiting. The specific limits depend on your account type and can be found in your account dashboard. If you exceed the rate limit, you'll receive a 429 (Too Many Requests) response.

Best Practices
  • Always handle rate limiting by implementing exponential backoff in your clients.
  • Store and reuse session tokens when possible to avoid unnecessary authentication requests.
  • Implement proper error handling for all possible response codes.
  • For file parsing, validate file types and sizes before sending to the API.
  • When using browser IDs, implement a reliable method for generating unique identifiers.
Support

If you encounter any issues or have questions about the API, please contact our support team at api-support@strongly.ai. For the latest updates and announcements, follow our Twitter account.


Support

We are happy to help you. Please feel free to contact us at info@strongly.ai if you have any queries.


Copyright © 2024 StronglyAI, Inc.