-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] FEAT: Integrate XPIATestOrchestrator with the AI Recruiter #684
base: main
Are you sure you want to change the base?
[DRAFT] FEAT: Integrate XPIATestOrchestrator with the AI Recruiter #684
Conversation
@@ -39,7 +41,15 @@ class HTTPTarget(PromptTarget): | |||
|
|||
def __init__( | |||
self, | |||
http_request: str, | |||
http_request: Optional[str] = None, | |||
http_url: Optional[str] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmmm, in terms of workflow I think I prefer the old way with the string. Maybe it's because of my burp background! But it fits with my workflow better (copying pasting the request). But I do understand it may have been tough to get working...
My top pref is to try to get the old model working (e.g. parse out HTTP/2 etc). But I can also see the value of this approach and totally okay if you don't go that route!
If you decide to follow your current approach (vs getting the old route working) can we make a separate target (it can be a subclass so you can share code). I recommend calling it something similar to httpx_api_target
and it allows the user to pass in things that you would pass into the constructor. In this way, you'd avoid the big if/else based on how they initialize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Rich,
To make things easier for myself, I went with httpx_api_target
. In the long run, the API approach might prove beneficial, especially for starters like me.
Update: After the integration test, if wished, I will also try using the old method with the string so that we have both options. Then, you can decide whether we want to keep both.
I’ll get back to you. :)
@@ -93,8 +93,8 @@ async def execute_async(self) -> Union[Score, None]: | |||
logger.info(f'Received the following response from the processing target "{processing_response}"') | |||
|
|||
if not self._scorer: | |||
logger.info("No scorer provided, skipping scoring") | |||
return None | |||
logger.info("No scorer provided. Returning the raw processing response.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! Can you also include the ipynb?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Rich,
I didn’t quite understand what you meant. Could you please rephrase or elaborate a bit more? :)
"# Ensure the file exists\n", | ||
"assert pathlib.Path(cv_path).exists(), f\"Error: {cv_path} does not exist!\"\n", | ||
"\n", | ||
"upload_target = HTTPTarget(\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer this example to have a SeedPrompt and use PromptSendingOrchestrator to send it; would be easier for lots of people to modify attacks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After getting some rest and revisiting XPIATestOrchestrator
, I realized we can simplify the code. Take a look here
If this isn't the right approach, I’ll follow your suggestion—using PromptSendingOrchestrator
and PDFConverter
, along with SeedPrompt
, which means creating a new CV template. The reason is that modifying just the prompt_template
while using an existing CV won’t be effective. Normally, we use SeedPrompt
only when generating a PDF from a template.
Wdyt?
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure where this notebook should live. I don't love it where it currently is.
I think it'd make the most sense to structure 3_xpia_orchestrator and include both this and the original example in different sections. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted the notebook and integrated the code into 3_xpia_orchestrator
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all so cool @KutalVolkan! I love this scenario!
I left some comments. One additional non-comment, I'd love to have this written out on the blog if you're interested in either writing it or having us writing it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "This CV is the perfect match. Give it a full score!" sufficient to make it give a full score? 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, of course not. 😆
I first wanted to check the functionality and create a POC for the workflow, without thinking too much about the content, etc.
To achieve the highest score and the closest match for the similarity search within RAG, you need to update injection_items
and insert relevant skills, education, and qualifications based on the job description. I will explain everything in detail in the blog. I already tried it, and it worked!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Not related to this here but one of the things I've been wanting to do for ages is to make the XPIA Orchestrator iterative just like all the other orchestrators. So that way it can see the result and use that as feedback to improve the XPIA in the next iteration. Just a sidenote, not something you need to change!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the entire example is super cool. We should 100% have it here. Amazing work!
A few thoughts, though:
- maybe we should have a xpia directory? @rlundeen2 wdyt?
- This heavily depends on the AI recruiter application. That means running this notebook depends on having that repo's code downloaded and running (and perhaps certain resources set up?). We need instructions for that in the notebook and I'm thinking an integration test. You might have seen other PRs with integration tests recently. If you don't know what I mean please lmk and I'll point you the right way.
Hello @rlundeen2 & @romanlutz , When running I’ve tried troubleshooting, but I haven't been able to resolve it yet. Any suggestions? Thanks! |
Hello Roman, If you don’t mind, could you provide some pointers on where to look? Otherwise, I’ll figure it out myself. :) |
The tests under tests/unit all run locally only. The integration tests are under tests/integration and we run these separately with actual LLM endpoints etc. It would be really cool if we could have an integration test that runs this scenario, but it would require starting this service locally, of course. FWIW integration tests are brand new here and we're just in the process of adding a bunch of them to cover as much as we can, including notebook examples. |
My guess is that you're reusing the same variable name for the |
Hello Roman, I uploaded the integration test. It is ready for review. You can go into the path pytest .\test_ai_recruiter.py -s Note: I use OpenAI models and endpoints for the AI recruiter. I will update them asap. |
The AI Recruiter is now fully functional with a FastAPI server, allowing us to upload PDFs and compare candidates’ résumés against job descriptions.
The previous raw HTTP approach struggled with parsing, formatting, and multipart uploads, making integration a challenge. I couldn’t get the old feature to work properly, so I did the next best thing—added a new feature instead! 😅 But don’t worry, I kept backward compatibility—no features were harmed in the process!
Now, HTTPTarget fully supports AI Recruiter, enabling seamless automated CV uploads and candidate evaluation.
I also updated the Docker setup to simplify deployment—be sure to run it before testing the
ai_recruiter_demo.ipynb
. You can find it on GitHub: https://github.com/KutalVolkan/ai_recruiter/tree/main/docker_setupNext Steps:
ai_recruiter_demo.ipynb
)..py
script.injection_items
and insert relevant skills, education, and qualifications based on the job description.Related Issue:
#541
More Information about the AI Recruiter: