Artificial Intelligence Corporate Risk
  • Welcome
  • Getting Started
    • Inviting Users
    • Adding New Large Language Models
      • Azure OpenAI Service
      • OpenAI
      • Mistral
      • Google AI
      • LLaMA AI
      • AWS Bedrock
  • Chat
    • Initiating a Chat
    • Viewing Chat History
  • Dashboards
    • Creating Dashboards
    • Dashboard Elements
      • Top N
      • Charts and Graphs
      • Totals
      • Maps
  • Monitoring
    • Adding a User to the Monitor Role
    • Setting up alerts and issues
    • Editing Issues
  • Compliance
    • Adding a User to the Compliance Role
    • Creating a Search
    • Consuming the Results
  • Admin
    • AI Agents
      • Adding a New Agent
        • General Settings
        • Agent Engine Properties
          • Azure OpenAI
          • OpenAI
          • Mistral
          • Google AI
          • LLaMA AI
          • AWS Bedrock
        • Advanced Settings
          • Usage
            • Max Messages
            • LLM Temperature
          • Scanners
            • AI Scanners
            • General Scanners
          • API Keys
          • Files
      • Editing an Agent
      • Deleting an Agent
      • Adding from a Template
    • Company
      • General Information
      • External Agent Provider Settings
    • Custom APIs
      • OAuth2 API
      • Adding a New API
        • API Information
        • API Headers
        • API Endpoint Parameters
        • API Query Parameters
        • Body Parameters
      • Editing a Custom API
      • Deleting a Custom API
    • Custom Database
    • Users
      • Inviting a New User
      • Deleting a User
      • Roles
        • Accessing User Roles
      • Assigning an Agent
      • Setting a Default Agent
    • Groups
      • Adding a New Group
      • Deleting a Group
      • Assigning a User
      • Removing a User
      • Adding an Agent
      • Removing an Agent
    • Agent Scanner Defaults
      • Toxicity
      • Personal Information
      • Topic Scanner
      • Prompt Injection Detection
      • Regex Scanner
      • Geographic Gating
      • Language Detection
      • Allowed File Types
    • Logs
      • Interpreting Logs
  • Server Admin
    • Upgrade
    • Default Agents
      • Adding a New Agent
    • Data Archive
    • API Access
      • Chat
        • List Agents
        • Create Conversation
        • List of Conversations
        • Get Conversations
        • Ask Agent
        • Chat with Agent
        • Add File to Conversation
        • Add Files to Agent
        • Deleting a File
      • OAuth2
        • OAuth2
        • OAuth2 Token
      • Users
        • List Users
        • Create User
        • Add User to Group
        • Set User Token
        • Delete User
      • How to Launch Our API Example
        • How the Code Works
    • Configure OAuth2
    • Custom Secrets
  • API Overview
    • Authentication
    • Calling the Scanner
    • Consuming the Results
    • 📃Pagination
      • Understanding API Parameters
      • Pagination Helper
      • Example Page
      • Recap
    • AIRisk API OAuth2 Authentication
      • Authorization
      • Authorization Endpoint
        • Example Authorization URL
        • Error Responses
      • Tokens
        • Error Handling
        • Generic vs. User-Specific Tokens
          • Example Usage Flow / Reasons
        • Usage of the Access Token
      • Token Endpoint
        • Example Token Request
        • Error Responses
      • Summary of OAuth2 Authorization Flow
  • Managing Your Account
    • Personal Data
  • Support
    • Onboarding Check List
  • Internal Deployment
    • Outlook Plugin
    • Firewall Rules
    • Infrastructure
    • Graph Connection Requirements
    • Zoom Transcripts
  • Example Python Application
  • Release Notes
    • V4.65
    • V4.28
    • V4.12
    • V4.0
    • V3.71
    • V3.0 Beta
    • V2.23
    • V2.22
    • V2.120 HotFix
    • V2.103 June 1
Powered by GitBook
On this page
  1. Server Admin
  2. API Access
  3. How to Launch Our API Example

How the Code Works

  1. Within the ExampleAIRisk project → Pages folder when the project is first run, index.razor indexes the login url to navigate to the correct url where the project will be hosted.

  2. Then the callback.razor page will query the code by requesting an access token, then once given the access token it navigates to the users.razor page that is the first initial page seen once project is run.

  3. On the Users.razor page it lists out all the different users than you can login as, that once you select the user you want to login as it then logs you in as that user and navigates to the page where you choose the agent you want to chat with.

  4. Once choosing the agent you want to chat with you are redirected to the Chat.razor page where a conversation is created with the agent and there exists a stream of asks The AIRiskModels Project under the models page exists the AIRiskAPIService.cs where here all the code that is responsible for the token, Getting Client, Login URL, Ask Stream, Get Users, List Agents, and Create Conversation exists.

  1. Within the ExampleAIRisk project go to pages folder when the project is first run. Index.razor directs the login URL to the appropriate address where the project will be hosted.

  2. Then the callback.razor page will query the code by requesting an access token. After receiving the access token, it redirects to the users.razor page, which is the first page displayed when the project is launched.

  3. The Users.razor page displays a list of available users for login. After selecting a user, the system logs in as that user and redirects to the page where an agent can be selected for chat.

  4. After selecting the agent for the chat, the system redirects to the Chat.razor page, where a conversation is initiated with the agent, and there exists a stream of asks. The AIRiskModels Project under the model's page exists the AIRiskAPIService.cs. Here all the code that is responsible for the token, Getting Client, Login URL, Ask Stream, Get Users, List Agents, and Create Conversation exists.

PreviousHow to Launch Our API ExampleNextConfigure OAuth2

Last updated 2 months ago