Spaces:
Runtime error
Runtime error
File size: 6,306 Bytes
153cdd5 098a530 153cdd5 098a530 153cdd5 098a530 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | ---
title: talentum-score
app_file: testing_app.py
sdk: gradio
sdk_version: 5.39.0
---
# Talentum Score
A Python-based job evaluation system that helps job seekers identify red flags about companies and analyze job postings using AI-powered web search and analysis.
## Overview
Talentum Score is designed to assist job seekers in making informed career decisions by analyzing companies for potential red flags such as layoffs, poor management, toxic culture, financial instability, or legal issues. The system uses advanced AI models to search and analyze publicly available information about companies and provide comprehensive evaluations.
## Features
- **Company Red Flag Analysis**: Automatically searches for and identifies potential red flags about companies
- **Job Posting Evaluation**: Analyzes job descriptions for concerning patterns
- **AI-Powered Research**: Uses Perplexity AI for comprehensive web search and analysis
- **Modular Architecture**: Built with a flexible node-based system for extensible functionality
- **Structured Output**: Provides scored evaluations with detailed analysis and source citations
## Technology Stack
- **Python 3.12+**: Modern Python with type hints
- **LangChain**: Framework for building LLM applications
- **Perplexity AI**: Advanced AI search and analysis capabilities
- **LangGraph**: State management for complex AI workflows
- **Pydantic**: Data validation and serialization
- **Pydantic Settings**: Configuration management
## Architecture
The system is built using a flow-based architecture with the following key components:
### Core Components
- **Domain Models** (`src/domain.py`): Pydantic models defining data structures
- **Flows** (`src/flows/`): Orchestrate complex multi-step processes
- **Nodes** (`src/nodes/`): Individual processing units that can be combined
- **Prompts** (`src/prompts/`): AI prompt templates for different analysis tasks
### Key Classes
- `JobPosting`: Represents a job posting with company name, position, and description
- `TalentumScoreResponse`: Final evaluation with score and analysis
- `CompanyEvaluation`: Company analysis with score, analysis text, and sources
- `PostEvaluation`: Job posting analysis with red flags and additional notes
- `WebSearchNode`: Performs AI-powered web searches using Perplexity
- `JobEvaluatorFlow`: Main flow orchestrating the complete evaluation process
## Installation
This project uses [uv](https://github.com/astral-sh/uv) for dependency management.
```bash
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies
uv sync
# Activate the virtual environment
source .venv/bin/activate # On Unix/macOS
# or
.venv\Scripts\activate # On Windows
```
## Usage
### Basic Example
```python
from src.domain import JobPosting
from src.flows.job_evaluator import JobEvaluatorFlow
# Create a job posting to evaluate
job_posting = JobPosting(
company_name="Example Corp",
position="Software Engineer",
description="We are looking for a software engineer with 3 years of experience in Python and Django."
)
# Create and run the evaluation flow
evaluator = JobEvaluatorFlow()
result = evaluator.run(job_posting)
print(f"Score: {result.score}")
print(f"Analysis: {result.analysis}")
```
### Web Search Node Example
```python
from pathlib import Path
from src.nodes.web_search import WebSearchNode
# Create a web search node for company analysis
node = WebSearchNode(
system_prompt_path=Path("src/prompts/search_company_info_system.txt"),
query="Company Name: Google",
model="sonar" # Perplexity model
)
# Execute the search
state = {"flow_input": job_posting}
result_state = node.execute(state)
```
## Configuration
The system uses environment variables for configuration. Create a `.env` file in the project root:
```env
PERPLEXITY_API_KEY=your_perplexity_api_key_here
```
## Project Structure
```
talentum-score/
βββ app.py # Main application entry point
βββ pyproject.toml # Project configuration and dependencies
βββ src/
β βββ domain.py # Pydantic models and data structures
β βββ flows/ # Processing flows
β β βββ __init__.py
β β βββ base.py # Base flow classes and interfaces
β β βββ job_evaluator.py # Main job evaluation flow
β βββ nodes/ # Processing nodes
β β βββ base.py # Base node class
β β βββ web_search.py # Web search functionality
β βββ prompts/ # AI prompt templates
β β βββ search_company_info_system.txt # Company analysis prompt
β βββ README.md # This file
βββ uv.lock # Dependency lock file
```
## Development
### Adding New Nodes
To create a new processing node:
1. Inherit from the `Node` base class
2. Implement the `execute` method
3. Define `name` and `description` attributes
```python
from src.nodes.base import Node
from src.flows.base import FlowState
class CustomNode(Node):
name: str = "CustomNode"
description: str = "Description of what this node does"
def execute(self, state: FlowState) -> FlowState:
# Your processing logic here
return state
```
### Adding New Flows
To create a new flow:
1. Inherit from the `Flow` base class
2. Define input and output types
3. Implement the `get_state_graph` method
```python
from src.flows.base import Flow, FlowState
from langgraph.graph import StateGraph
class CustomFlow(Flow[InputType, OutputType]):
def get_state_graph(self) -> StateGraph:
graph_builder = StateGraph(self.state)
# Add your nodes and connections
return graph_builder.compile()
```
## Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request
## License
This project is part of the Talentum Core ecosystem. Please refer to the main repository for licensing information.
## Support
For support and questions, please refer to the main Talentum Core project documentation or create an issue in the repository.
|