Skip to content

Commit

Permalink
some prompt engineering to provide better output (more concise) and a…
Browse files Browse the repository at this point in the history
…dd a header to message
  • Loading branch information
FredrikAugust committed Apr 24, 2024
1 parent 04dba60 commit 2ee8f01
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/chat/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ use anyhow::Result;
use log::info;

pub async fn generate_brief_summary_of_pull_requests(client: ChatGPT, pull_requests: &Vec<octocrab::models::pulls::PullRequest>) -> Result<String> {
let mut prompt = "Please add emojis to all subsequent bullet points to make it a bit more appealing to read. \
You will be provided with a set of pull requests that have been completed the last 24 hours. \
let mut prompt = "Please add emojis to all subsequent bullet points based on what type of change it is. \
You will be provided with a set of pull requests that have been completed the working day. \
I want you to aggregate this into a bullet list highlighting the main changes. \
You can be a bit technical, but preferably not very. \
Avoid using technical language where possible. \
This will be posted to Slack so use the appropriate formatting. \
Group into sensible categories such as bug fixes, new features, etc. \
You do not need to include any other text such as 'Here are the changes'. \
Keep the summary to at most 6 bullet points. \
Each bullet point should be at most one sentence to keep it concise. \
Each bullet point should be a human readable sentence. \
Do not include links to the pull requests, just a brief summary. \
Do not include these instructions in the output. \
Expand Down
7 changes: 7 additions & 0 deletions src/delivery/slack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ impl DeliveryMechanism for SlackDelivery {
.json(&ChatPostMessageBody {
channel: slack_channel,
blocks: vec![
Block {
r#type: "header".to_string(),
text: Text {
r#type: "plain_text".to_string(),
text: "Your daily digest 📜".to_string(),
}
},
Block {
r#type: "section".to_string(),
text: Text {
Expand Down

0 comments on commit 2ee8f01

Please sign in to comment.