abhishekjoel commited on
Commit
725b4fe
·
verified ·
1 Parent(s): 05c91c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import streamlit as st
2
  import requests
3
  from groq import Groq
@@ -5,13 +6,15 @@ from groq import Groq
5
  # Function to scrape LinkedIn profile using Firecrawl API
6
  def scrape_linkedin_profile(linkedin_url):
7
  api_url = "https://api.firecrawl.dev/v1/scrape" # Endpoint for scraping
8
- headers = {"Authorization": "fc-123456789"} # Replace with your actual API key
 
 
9
  response = requests.post(api_url, json={"url": linkedin_url}, headers=headers)
10
 
11
  if response.status_code == 200:
12
  return response.json()['data'] # Adjust based on actual response structure
13
  else:
14
- return "Error scraping LinkedIn profile."
15
 
16
  # Function to generate email using Llama 3.2 from Groq with ReAct methodology
17
  def generate_email(name, email, phone, role, tokens, linkedin_url):
@@ -28,7 +31,7 @@ def generate_email(name, email, phone, role, tokens, linkedin_url):
28
  reasoning_trace.append(f"Obtained profile data: {profile_data}.")
29
 
30
  # Initialize Groq client
31
- client = Groq(api_key='YOUR_GROQ_API_KEY') # Replace with your actual API key
32
 
33
  # Prepare messages for Llama model
34
  messages = [
 
1
+
2
  import streamlit as st
3
  import requests
4
  from groq import Groq
 
6
  # Function to scrape LinkedIn profile using Firecrawl API
7
  def scrape_linkedin_profile(linkedin_url):
8
  api_url = "https://api.firecrawl.dev/v1/scrape" # Endpoint for scraping
9
+ firecrawl_api_key = "YOUR_FIRECRAWL_API_KEY" # Replace with your actual Firecrawl API key
10
+ headers = {"Authorization": firecrawl_api_key} # Set the API key without 'Bearer'
11
+
12
  response = requests.post(api_url, json={"url": linkedin_url}, headers=headers)
13
 
14
  if response.status_code == 200:
15
  return response.json()['data'] # Adjust based on actual response structure
16
  else:
17
+ return f"Error scraping LinkedIn profile: {response.text}" # Improved error message
18
 
19
  # Function to generate email using Llama 3.2 from Groq with ReAct methodology
20
  def generate_email(name, email, phone, role, tokens, linkedin_url):
 
31
  reasoning_trace.append(f"Obtained profile data: {profile_data}.")
32
 
33
  # Initialize Groq client
34
+ client = Groq(api_key='YOUR_GROQ_API_KEY') # Replace with your actual Groq API key
35
 
36
  # Prepare messages for Llama model
37
  messages = [