How joe-hireable/hireablecvparser works
Main components
• Cloud Function Endpoint: The front door of the service, represented by main.py that handles incoming HTTP requests.
• Configuration Module: The config.py file that holds sensitive settings like project IDs, bucket names, and allowed domains.
• Document Processing Component: Modules such as DocumentProcessor (located in utils/document_processor.py) for downloading and processing CVs and job descriptions.
• Gemini Client: The util gemini_client.py that interfaces with the Gemini AI model.
• Google Cloud Storage (GCS): Although not a code module, storage.py in the utils folder and config settings indicate integration with GCS for caching and document storage.
• Prompt and Schema Management: The data directories that host various prompt templates and JSON output schemas for different tasks (parsing, personal statement, core skills, achievements, role analysis, and scoring).
Relationships and interactions
• Client Request → Cloud Function Endpoint: Incoming requests (with CV and JD URLs and task type) are received by the cloud function.
• Cloud Function → Document Processor: Once a request is received, the DocumentProcessor downloads the documents (possibly validates URLs, content type, etc.).
• Document Processor ↔ GCS: Documents are uploaded and retrieved from Google Cloud Storage, with the caching mechanism to improve performance.
• Cloud Function → Gemini Client: Depending on the task (extraction, analysis, scoring), appropriate prompt templates (from data/prompts) and few-shot examples (from data/few_shot_examples) are loaded and the Gemini API is called.
• Gemini Client → AI Model (Gemini 2.0 Flash): The actual analysis and optimization is performed by the Gemini AI. The response is structured as per the JSON schema specifications (data/schemas).
• Cloud Function → Client Response: Finally, the cloud function sends a structured JSON response (including status, errors if any, and processed data).
Key architectural/design principles
• Modular Architecture: Separation of concerns is evident with distinct modules for configuration, document processing, cloud storage interaction, and external API integration.
• API-oriented Design: The system exposes a RESTful API endpoint designed to handle various tasks through well-defined JSON request and response formats.
• External Service Integration: The design shows a clear integration with Google Cloud services (Cloud Functions, GCS, OpenTelemetry for tracing) and external AI services.
• Extensibility: With separate directories for prompts, schemas, and examples, it is easy to extend the functionality for additional CV optimization features.
• Security & Observability: URL validation, caching, and logging (structured JSON logs plus OpenTelemetry integration) are key aspects.
Relevant technologies and frameworks
• Python 3.11 (runtime environment)
• Google Cloud Functions and Google Cloud Storage integration
• Gemini 2.0 Flash AI model via the API
• OpenTelemetry for tracing and structured logging
Specific elements
– Cloud Function (main.py) as the central entry point.
– Config : (config.py) showing global settings.
– Data Components: Prompts, Schemas, Few-shot Examples.
– External Components: Google Cloud Storage and Gemini AI service.
– Show interaction between the Cloud Function and each internal component (document processing, storage, AI processing).
– Indicate bidirectional communication where needed (e.g., caching mechanism with GCS).
• Annotations:
• Visual Differentiation:
– Consider grouping the related components (like all document processing steps) together for clarity.