File size: 5,478 Bytes
71c959a
 
3eea5f6
71c959a
 
e238031
 
03ca12d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
02972af
 
03ca12d
 
 
20f1077
03ca12d
 
 
 
e238031
 
71c959a
e195977
 
e238031
 
ef3ea33
 
20f1077
 
e238031
71c959a
e238031
71c959a
e238031
71c959a
e238031
e195977
e238031
71c959a
e238031
 
 
71c959a
e238031
 
 
71c959a
e238031
71c959a
e238031
 
e195977
e238031
 
 
 
 
 
 
 
 
 
 
 
 
71c959a
e238031
 
 
 
 
 
 
71c959a
e238031
 
 
 
 
 
 
71c959a
 
e238031
 
71c959a
e238031
 
71c959a
e238031
 
 
 
 
7ed1600
 
 
 
71c959a
e238031
 
 
 
71c959a
e238031
 
 
 
 
e195977
e238031
1fe9a71
7ed1600
 
 
e238031
 
 
e195977
ef3ea33
e238031
 
71c959a
 
 
e238031
71c959a
 
 
 
e238031
1fe9a71
e238031
71c959a
 
 
e238031
 
71c959a
 
 
 
e238031
 
 
 
 
 
71c959a
e238031
 
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
import streamlit as st
import google.generativeai as genai
import os

# --- Configuration ---
GEMINI_API_KEY = os.environ.get('GEMINI_API_KEY')

# Check if API key is available
if not GEMINI_API_KEY:
    st.error("""
    🚨 GEMINI_API_KEY not found!
    
    Please make sure you've:
    1. Created an API key at https://aistudio.google.com/
    2. Added it to Hugging Face Secrets with the name 'GEMINI_API_KEY'
    """)
    st.stop()

# Configure Gemini
try:
    genai.configure(api_key=GEMINI_API_KEY)
    
    # Use the correct model name from your available list
    model = genai.GenerativeModel('models/gemini-2.0-flash-001')  # Using a stable model
    
    # Test the API
    test_response = model.generate_content("Say 'API test successful'")
    st.success(f"👋Welcome - I’m glad you’re here - By Sanjay PS" )
    
except Exception as e:
    st.error(f"❌ API configuration failed: {str(e)}")
    st.stop()

# Sample resume data - REPLACE WITH YOUR ACTUAL RESUME TEXT
RESUME_TEXT = """
SANJAY PANNERSELVAM(sanjaystarc or sanjay PS)
AI Specialist
📧 sanjaypannerselvam12@gmail.com
 | 📞 +91 63818 96958
📍 Tiruchengode,Namakkal, Tamil Nadu,pincode - 637 209
instagram id : @dale_sanjay_starc
date of birth : 17.01.2005
linkedIn : Sanjay Ps

Objective

To obtain a responsible position that utilizes my skills and provides opportunities for professional growth and career development.

Education

Bachelor’s in Commerce with Computer Applications  (B.Com CA) Degree
Sengunthar Arts and Science College
2022 – 2025 | Tiruchengode

Higher Secondary (HSC)
Sri Renga Vidhyalaya Matric Hr. Secondary School
2020 – 2022 | Tiruchengode

Secondary School (SSLC)
New Oxford Matriculation School
2019 – 2020 | Tiruchengode

Skills

Artificial Intelligence & Automation:
Prompt Engineering | Generative AI Tools | Business Process Automation |  AI Product Strategy | Responsible AI (Ethical & Safe AI Practices) | Large Language Models (LLMs) – Usage & Integration

Data & Office Tools:
MS Excel | MS Power BI | MS Word | MS PowerPoint

Soft Skills:
Communication | Teamwork | Consistency | Script Writing & Storytelling

Programming Languages:
Python | SQL

Languages Known:
English | Tamil

Projects

1. Intelligent Document Q&A with RAG System
Developed a conversational AI that allows users to ask questions and get instant answers from their own documents (PDFs, Word files). The system uses a Retrieval-Augmented Generation (RAG) architecture to fetch relevant information and generate accurate, source-based responses—minimizing AI hallucinations.

2. Context-Aware Document Analysis Chatbot
Created an AI chatbot that understands the context of uploaded documents. It enables users to interact naturally with their data to extract key points, summarize content, and obtain precise answers—all based solely on the uploaded source material.

Certificates

Python Certificate

Generative AI Certificate

AI & ML Certificate

Courses

Foundations of AI and ML – Microsoft (Coursera)
Successfully completed the Foundations of AI and ML course.

Generative AI for Everyone – DeepLearning.AI (Coursera)
Successfully completed the Generative AI for Everyone course.

Generative AI Applications with Python – Google (GUVI)
Successfully completed the Generative AI Applications course.

Practical Machine Learning – GUVI
Successfully completed the Practical Machine Learning course.
partners and friends :
Aadhithiya,Abishek,
Aniruth,Sameer,
Dhilip kumar,bhuvi MF.

Declaration

I hereby declare that all the details mentioned above are true and correct to the best of my knowledge and belief.
"""

# System Prompt
system_prompt = """
You are a professional AI assistant that answers questions about a candidate based ONLY on the provided resume text.

RULES:
1. Only use information from the resume text below and add extra words to increase his value .
2. Be brief and direct in your answers
3. If information isn't in the resume, say "That information is not available, Please only ask about his professional background ."
4. Only answer professional questions about skills, education, friends and partners, age, projects, and experience 
5. Buildup him like he is only who can do it .
6. Add your own extra fittings that match him .
"""

# Main App
st.title("🐦‍🔥 AI Assistant for Sanjay PS")
st.caption("Ask me anything about Sanjay PS professional background!")

# Initialize chat history
if "messages" not in st.session_state:
    st.session_state.messages = []

# Display chat messages
for message in st.session_state.messages:
    with st.chat_message(message["role"]):
        st.markdown(message["content"])

# Chat input
if prompt := st.chat_input("What would you like to know about sanjay PS in his profession ?"):
    # Display user message
    st.chat_message("user").markdown(prompt)
    st.session_state.messages.append({"role": "user", "content": prompt})
    
    # Prepare prompt for Gemini
    full_prompt = f"{system_prompt}\n\nRESUME TEXT:\n{RESUME_TEXT}\n\nQUESTION: {prompt}\n\nANSWER:"
    
    try:
        response = model.generate_content(full_prompt)
        answer = response.text
        
        # Display assistant response
        with st.chat_message("assistant"):
            st.markdown(answer)
        st.session_state.messages.append({"role": "assistant", "content": answer})
        
    except Exception as e:
        error_msg = f"Error generating response: {str(e)}"
        st.error(error_msg)