Skip to content

Commit

Permalink
add basic claude bot logic
Browse files Browse the repository at this point in the history
  • Loading branch information
fegloff committed Apr 2, 2024
1 parent 33e6fa8 commit a00a6da
Show file tree
Hide file tree
Showing 2 changed files with 470 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/modules/claude/helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export enum SupportedCommands {
claudeOpus = 'claude',
opus = 'opus',
claudeSonnet = 'claudes',
opusShort = 'c',
sonnet = 'sonnet',
sonnetShort = 's',
claudeHaiku = 'haiku',
haikuShort = 'h',
}

const CLAUDE_OPUS_PREFIX_LIST = ['c. ']

export const hasClaudeOpusPrefix = (prompt: string): string => {
const prefixList = CLAUDE_OPUS_PREFIX_LIST
for (let i = 0; i < prefixList.length; i++) {
if (prompt.toLocaleLowerCase().startsWith(prefixList[i])) {
return prefixList[i]
}
}
return ''
}

export const hasPrefix = (prompt: string): string => {
return (
hasClaudeOpusPrefix(prompt)
)
}
Loading

0 comments on commit a00a6da

Please sign in to comment.