Skip to content

Commit

Permalink
Merge pull request #11 from bakaburg1/Dev
Browse files Browse the repository at this point in the history
Hot fix: Manage > 1 length vectors as inputs for output, summary structure and diarization instructions.

They are all collapsed before the prompt is built.
  • Loading branch information
bakaburg1 authored Jan 29, 2024
2 parents d7836e3 + 1e4591c commit 5f6fcef
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: minutemaker
Title: GenAI-based meeting and conferences minutes generator
Version: 0.5.1
Version: 0.5.2
Authors@R:
person("Angelo", "D'Ambrosio", , "a.dambrosioMD@gmail.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-2045-5155"))
Expand Down
30 changes: 30 additions & 0 deletions R/prompts.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ generate_summarisation_prompt <- function(
args$extra_output_instructions
)

# Remove extra_output_instructions since it would trigger the length check
# later
args$extra_output_instructions <- NULL

# Collapse output instruction into a bullet point list
args$output_instructions <- paste0(
"- ",
args$output_instructions,
Expand All @@ -270,6 +275,19 @@ generate_summarisation_prompt <- function(
args$output_length <- "3"
}

# Aggregate arguments if length > 1 vectors
if (length(args$extra_diarization_instructions) > 1) {
args$extra_diarization_instructions <- paste(
args$extra_diarization_instructions, collapse = "\n"
)
}

if (length(args$summary_structure) > 1) {
args$summary_structure <- paste(
args$summary_structure, collapse = "\n"
)
}

prompt <- paste(

get_prompts("base_task"),
Expand Down Expand Up @@ -355,6 +373,11 @@ generate_rolling_aggregation_prompt <- function(
args$extra_output_instructions
)

# Remove extra_output_instructions since it would trigger the length check
# later
args$extra_output_instructions <- NULL

# Collapse output instruction into a bullet point list
args$output_instructions <- paste0(
"- ",
args$output_instructions,
Expand All @@ -365,6 +388,13 @@ generate_rolling_aggregation_prompt <- function(
args$output_length <- "3"
}

# Aggregate arguments if length > 1 vectors
if (length(args$summary_structure) > 1) {
args$summary_structure <- paste(
args$summary_structure, collapse = "\n"
)
}

summary_seq <- seq_along(summaries)

summaries <- stringr::str_glue(
Expand Down

0 comments on commit 5f6fcef

Please # to comment.