Spaces:
Configuration error
Configuration error
Switched to Claude 3.5 Haiku for both agent and job call summary, seemes to be the best so far
Browse files- .github/workflows/python_ci.yml +1 -1
- configuration.py +11 -11
- functions/job_call.py +7 -8
.github/workflows/python_ci.yml
CHANGED
@@ -25,7 +25,7 @@ jobs:
|
|
25 |
- name: Test with unittest
|
26 |
env:
|
27 |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
28 |
-
|
29 |
run: |
|
30 |
python -m unittest tests/test_gradio.py
|
31 |
python -m unittest tests/test_linkedin_resume.py
|
|
|
25 |
- name: Test with unittest
|
26 |
env:
|
27 |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
28 |
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
29 |
run: |
|
30 |
python -m unittest tests/test_gradio.py
|
31 |
python -m unittest tests/test_linkedin_resume.py
|
configuration.py
CHANGED
@@ -6,30 +6,30 @@ from smolagents import OpenAIServerModel
|
|
6 |
|
7 |
DEFAULT_GITHUB_PROFILE = "https://github.com/gperdrizet"
|
8 |
|
9 |
-
# AGENT_MODEL = OpenAIServerModel(
|
10 |
-
# model_id="gpt-4.1",
|
11 |
-
# max_tokens=8000
|
12 |
-
# )
|
13 |
-
|
14 |
# Will be used for single shot summarization with no-frills prompting
|
15 |
# (e.g. job call extraction). It needs to output JSON formatted text,
|
16 |
# but this task does not require any complex reasoning or planning.
|
17 |
-
|
18 |
-
base_url="https://
|
19 |
-
api_key=os.environ[
|
20 |
)
|
21 |
|
|
|
|
|
22 |
# Will be used for resume resume writing agent via HuggingFace smolagents
|
23 |
# Including selection of relevant projects from GitHub profile
|
24 |
#
|
25 |
# Notes:
|
26 |
# - DeepSeek-R1-Distill-Qwen-32B does not seem to work well with smolagents,
|
27 |
# has trouble correctly formatting responses as code.
|
|
|
|
|
|
|
28 |
|
29 |
AGENT_MODEL = OpenAIServerModel(
|
30 |
-
model_id="
|
31 |
-
api_base="https://
|
32 |
-
api_key=os.environ["
|
33 |
)
|
34 |
|
35 |
INSTRUCTIONS = """
|
|
|
6 |
|
7 |
DEFAULT_GITHUB_PROFILE = "https://github.com/gperdrizet"
|
8 |
|
|
|
|
|
|
|
|
|
|
|
9 |
# Will be used for single shot summarization with no-frills prompting
|
10 |
# (e.g. job call extraction). It needs to output JSON formatted text,
|
11 |
# but this task does not require any complex reasoning or planning.
|
12 |
+
SUMMARIZER_CLIENT = OpenAI(
|
13 |
+
base_url="https://api.anthropic.com/v1/",
|
14 |
+
api_key=os.environ["ANTHROPIC_API_KEY"]
|
15 |
)
|
16 |
|
17 |
+
SUMMARIZER_MODEL = "claude-3-5-haiku-20241022"
|
18 |
+
|
19 |
# Will be used for resume resume writing agent via HuggingFace smolagents
|
20 |
# Including selection of relevant projects from GitHub profile
|
21 |
#
|
22 |
# Notes:
|
23 |
# - DeepSeek-R1-Distill-Qwen-32B does not seem to work well with smolagents,
|
24 |
# has trouble correctly formatting responses as code.
|
25 |
+
# - Qwen2.5-Coder-14B-Instruct works OK, but is not great at markdown formatting
|
26 |
+
# and tends to get some details wrong.
|
27 |
+
# - Claude-3-5-Haiku is the best model for this task so far.
|
28 |
|
29 |
AGENT_MODEL = OpenAIServerModel(
|
30 |
+
model_id="claude-3-5-haiku-20241022", # Same as HF model string
|
31 |
+
api_base="https://api.anthropic.com/v1/",
|
32 |
+
api_key=os.environ["ANTHROPIC_API_KEY"],
|
33 |
)
|
34 |
|
35 |
INSTRUCTIONS = """
|
functions/job_call.py
CHANGED
@@ -4,7 +4,11 @@ import json
|
|
4 |
import logging
|
5 |
from pathlib import Path
|
6 |
from datetime import datetime
|
7 |
-
from configuration import
|
|
|
|
|
|
|
|
|
8 |
|
9 |
# pylint: disable=broad-exception-caught
|
10 |
|
@@ -57,11 +61,6 @@ def summarize_job_call(job_call: str) -> str:
|
|
57 |
|
58 |
logger.info("Summarizing job call (%d characters)", len(job_call))
|
59 |
|
60 |
-
# Default to first available model
|
61 |
-
model = SUMMARIZER_MODEL.models.list().data[0]
|
62 |
-
model_id = model.id
|
63 |
-
print(f"Using model: {model_id}")
|
64 |
-
|
65 |
messages = [
|
66 |
{
|
67 |
'role': 'system',
|
@@ -70,12 +69,12 @@ def summarize_job_call(job_call: str) -> str:
|
|
70 |
]
|
71 |
|
72 |
completion_args = {
|
73 |
-
'model':
|
74 |
'messages': messages,
|
75 |
}
|
76 |
|
77 |
try:
|
78 |
-
response =
|
79 |
|
80 |
except Exception as e:
|
81 |
response = None
|
|
|
4 |
import logging
|
5 |
from pathlib import Path
|
6 |
from datetime import datetime
|
7 |
+
from configuration import (
|
8 |
+
JOB_CALL_EXTRACTION_PROMPT,
|
9 |
+
SUMMARIZER_MODEL,
|
10 |
+
SUMMARIZER_CLIENT
|
11 |
+
)
|
12 |
|
13 |
# pylint: disable=broad-exception-caught
|
14 |
|
|
|
61 |
|
62 |
logger.info("Summarizing job call (%d characters)", len(job_call))
|
63 |
|
|
|
|
|
|
|
|
|
|
|
64 |
messages = [
|
65 |
{
|
66 |
'role': 'system',
|
|
|
69 |
]
|
70 |
|
71 |
completion_args = {
|
72 |
+
'model': SUMMARIZER_MODEL,
|
73 |
'messages': messages,
|
74 |
}
|
75 |
|
76 |
try:
|
77 |
+
response = SUMMARIZER_CLIENT.chat.completions.create(**completion_args)
|
78 |
|
79 |
except Exception as e:
|
80 |
response = None
|