Skip to content

Instantly share code, notes, and snippets.

@ben1one
Last active August 12, 2025 07:16
Show Gist options
  • Select an option

  • Save ben1one/00c047463991ddf9cc4d67ceb824e530 to your computer and use it in GitHub Desktop.

Select an option

Save ben1one/00c047463991ddf9cc4d67ceb824e530 to your computer and use it in GitHub Desktop.
flowchart TD
title File Parser API Workflow
A[User Input Prompt] --> B{Has Document Upload?}
B -->|Yes| C[Call File Parser API]
B -->|No| D{Need KB Data?}
D -->|Yes| E[Call Azure AI Search API]
D -->|No| G
C --> |Normalized data| D
E --> |Chunks| G[LLM]
G --> H[Output Response]
draw a sequence diag for the File Parser API
Choose File type (e.g. brochure, proposal)
File upload (Azure blob storage)
Azure Document intellence
Azure Language PII
Load predefined file type schema (From CosmoDB)
LLM (secureGPT)
Nomalised data
sequenceDiagram
title File Parser API Workflow
participant User
participant API as File Parser API
participant Blob as Blob Storage
participant DI as Document Intelligence
participant PII as Language PII
participant DB as CosmosDB
participant LLM as SecureGPT
User->>API: Choose File Type (brochure/proposal)
User->>API: Upload File
API->>Blob: Store File
Blob-->>API: File URL
API->>DI: Submit File for Analysis
DI-->>API: Raw Document Data
API->>PII: Submit for PII Redaction
PII-->>API: Redacted Content
API->>DB: Request Schema for File Type
DB-->>API: Predefined Schema
API->>LLM: Send Content + Schema for Normalization
LLM-->>API: Normalized Data
API->>User: Return Normalized Data
Title: Azure AI search API
User send a prompt to api
LLM product name extraction (secureGpt)
AI search using product name
sequenceDiagram
title Azure AI Search API Workflow
participant User
participant API as Search API
participant LLM as SecureGPT
participant AIS as Azure AI Search
participant DB as Knowledge Base
User->>API: 1. Send Search Prompt
API->>LLM: 2. Extract Product Name
LLM-->>API: 3. Product Name
API->>AIS: 4. Query with Product Name
AIS->>DB: 5. Retrieve Relevant Documents
DB-->>AIS: 6. Search Results
AIS-->>API: 7. Ranked Results
API->>User: 8. Return Formatted Response
sequenceDiagram
participant User
participant System
participant FileParserAPI
participant AIS as Azure AI Search
participant LLM as SecureGPT
participant Blob as Blob Storage
participant DI as Document Intelligence
participant PII as Language PII
participant DB as CosmosDB
participant KB as Knowledge Base
User->>System: Input Prompt
alt Has Document Upload?
User->>FileParserAPI: Choose File Type (brochure/proposal)
User->>FileParserAPI: Upload File
FileParserAPI->>Blob: Store File
Blob-->>FileParserAPI: File URL
FileParserAPI->>DI: Submit File for Analysis
DI-->>FileParserAPI: Raw Document Data
FileParserAPI->>PII: Submit for PII Redaction
PII-->>FileParserAPI: Redacted Content
FileParserAPI->>DB: Request Schema for File Type
DB-->>FileParserAPI: Predefined Schema
FileParserAPI->>LLM: Send Content + Schema for Normalization
LLM-->>FileParserAPI: Normalized Data
FileParserAPI-->>System: Normalized Data
else No Document Upload
System->>LLM: Send Prompt (Check if KB Data needed)
LLM-->>System: Response (File Name if needed)
alt Need KB Data?
System->>AIS: Query with File Name
AIS->>LLM: Extract Product Name
LLM-->>AIS: Product Name
AIS->>KB: Retrieve Relevant Documents
KB-->>AIS: Search Results
AIS-->>System: Ranked Data Chunks
end
end
System->>LLM: Process Prompt with Context
LLM-->>System: Generated Response
System-->>User: Output Response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment