Skip to content

Commit ad1ed12

Browse files
authored
Merge pull request #7 from ngirard/yhcnk1-codex/fix-taskgist-word-separation-issue
Improve keyword extraction instructions
2 parents 10e9e54 + 55c02b5 commit ad1ed12

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The tool processes natural language task descriptions, extracts key actions and
1919
## Features
2020

2121
* **LLM-powered summarization**: Leverages Google's Gemini models via BAML for nuanced keyword extraction.
22-
* **Concise output**: Generates short, hyphenated phrases focusing on action verbs and essential terms.
22+
* **Concise output**: Generates short, hyphenated phrases focusing on action verbs and essential single-word terms.
2323
* **Flexible input**: Accepts task descriptions directly as a command-line argument or from a text file.
2424
* **BAML integration**: Utilizes BAML for defining LLM interactions, data structures, and tests.
2525
* **Modern Python tooling**: Uses `uv` for fast dependency management and `just` for task running.
@@ -29,7 +29,7 @@ The tool processes natural language task descriptions, extracts key actions and
2929

3030
1. You provide a task description (e.g., "Implement user login with two-factor authentication").
3131
2. Taskgist uses a BAML function (`ExtractKeywords` defined in `src/taskgist/baml_src/keywords.baml`) to send this description to the configured LLM (currently Google Gemini FlashLite, as defined in `src/taskgist/baml_src/clients.baml`).
32-
3. The BAML function instructs the LLM to extract an action verb and a concise keyword phrase, omitting common articles, prepositions, and pronouns.
32+
3. The BAML function instructs the LLM to extract an action verb and a concise keyword phrase, omitting common articles, prepositions, and pronouns. Each keyword is returned as a single word.
3333
4. The LLM returns a structured `KeywordPhrase` object (defined in BAML).
3434
5. Taskgist processes this object to create a hyphenated string (e.g., `implement-user-login-two-factor-authentication`).
3535
6. The tool is designed to output *only* the final generated gist to standard output, making it suitable for piping to other commands. All diagnostic messages, logs, or errors are directed to standard error.

src/taskgist/baml_src/keywords.baml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
class KeywordPhrase {
22
actionVerb string @description("The leading verb that describes the main action")
3-
phrase string[] @description("Complete keyword phrase with essential terms only")
3+
phrase string[] @description("Rest of the keyword phrase with essential terms only")
44
}
55

66
function ExtractKeywords(taskDescription: string) -> KeywordPhrase {
77
client FlashLite
88
prompt #"
99
Extract a concise keyword phrase from the given software engineering task description.
10-
The phrase must:
11-
- Start with an action verb
12-
- Consist of only only essential keywords
10+
Guidelines:
11+
- Return at most 5 keywords.
12+
- The first keyword must be a single-word action verb summarizing the task.
13+
- Each keyword MUST be a single word with NO SPACES.
1314
- Omit articles (the, a, an), common prepositions (in, on, to, for), and pronouns (it, this, that, etc.).
14-
- Be representative of the core task.
15-
- Not exceed 5 words
16-
- Each returned word must be a single token with no spaces
15+
- Keep only essential terms representing the core task.
1716

1817
{{ ctx.output_format }}
1918

0 commit comments

Comments
 (0)