Open ajitesh123 opened 3 months ago
dede47c9cc
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
src/app.py
β https://github.com/ajitesh123/Perf-Review-AI/commit/503be8824ac1cb478550cc25f58fa8d3eb82d923 Edit
Modify src/app.py with contents:
β’ Update the `generate_prompt` function signature to accept an additional parameter: `user_questions`, which is a list of strings. Each string in the list represents a user-submitted question.
β’ Inside the `generate_prompt` function, replace the static text between `` and ` ` with the content of `user_questions`. This can be achieved by joining the list of questions into a single string, separated by newline characters, and inserting this string into the appropriate place in the prompt.
β’ Modify the `generate_review` function signature to also accept `user_questions` as an input parameter. This parameter should then be passed to the `generate_prompt` function call within `generate_review`.
β’ Update any calls to `generate_review` and `generate_prompt` within `src/app.py` to include the new `user_questions` parameter. For demonstration or testing purposes, if there are any, provide a sample list of questions to these calls.
β’ Ensure that the documentation/comments within `src/app.py` are updated to reflect the changes in function signatures and the new functionality.
--- +++ @@ -18,12 +18,12 @@ print(response.choices[0].message.content) return response.choices[0].message.content -def generate_review(your_role, candidate_role, your_review, your_openai_key): +def generate_review(your_role, candidate_role, your_review, user_questions, your_openai_key): prompt = generate_prompt(your_role, candidate_role, your_review) response = get_completion(prompt, your_openai_key) return response -def generate_prompt(your_role, candidate_role, your_review): +def generate_prompt(your_role, candidate_role, your_review, user_questions): delimiter = "####" prompt = f""" Iβm {your_role}. Youβre an expert at writing performance reviews. On my behalf, help answer the question for performance reviews below. @@ -39,9 +39,7 @@- - Describe example(s) of the topics selected. What was the context? What actions did they take? - - In your opinion, what impact did their actions have? - - What recommendations do you have for their growth and development? Your feedback can be about any area of their work. + " + '\n'.join(user_questions) + " {delimiter} Output in markdown format in following structure:{delimiter} @@ -64,6 +62,6 @@ your_review = st.text_area('Briefly describe your experience of working with the candidate including project, responsibility of candidate, unique things they did etc., in free flow writing') if st.button('Write Review'): - review = generate_review(your_role, candidate_role, your_review, your_openai_key) + review = generate_review(your_role, candidate_role, your_review, ['Sample question 1', 'Sample question 2'], your_openai_key) st.markdown(review) 2
src/app.py
β Edit
Check src/app.py with contents:
Ran GitHub Actions for 503be8824ac1cb478550cc25f58fa8d3eb82d923:
I have finished reviewing the code for completeness. I did not find errors for sweep/add_option_for_user_submit_questions_tha
.
π‘ To recreate the pull request edit the issue title or description. Something wrong? Let us know.
This is an automated message generated by Sweep AI.