Skip to content

Commit

Permalink
[Spelunker] Fix dramatic typo in selection prompt (#651)
Browse files Browse the repository at this point in the history
Also a few minor prompt tweaks.
  • Loading branch information
gvanrossum-ms authored Feb 1, 2025
1 parent 612b842 commit 1a5a07c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ts/packages/agents/spelunker/src/makeSelectorSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// Identifier for a chunk of code.
export type ChunkId = string;

// A chunk is a function/method, class or module.
// Nested chunks are elided from the chunk text (they are their own chunk).
// A chunk is a function/method, class, module/file, interface, type, etc.
// Nested chunks have been elided from the chunk text (they are their own chunk).
export type ChunkDescription = {
chunkId: ChunkId;
relevance: number; // Float between 0.0 and 1.0
Expand Down
6 changes: 3 additions & 3 deletions ts/packages/agents/spelunker/src/searchCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,11 @@ async function selectRelevantChunks(
const prompt = `\
Please select up to 30 chunks that are relevant to the user question.
Consider carefully how relevant each chunk is to the user question.
Provide a relevance scsore between 0 and 1 (float).
Provide a relevance score between 0 and 1 (float).
Report only the chunk ID and relevance for each selected chunk.
Omit irrelevant chunks. It's fine to select fewer than 30.
Omit irrelevant or empty chunks. It's fine to select fewer than 30.
User question: "{input}"
User question: "${input}"
Chunks:
${prepareChunks(chunks)}
Expand Down

0 comments on commit 1a5a07c

Please sign in to comment.