adds Claude 3 Vision support

This commit is contained in:
nai-degen
2024-03-05 18:34:10 -06:00
parent ea3aae5da6
commit ddf34685df
5 changed files with 102 additions and 41 deletions
+1 -5
View File
@@ -99,13 +99,9 @@ export async function countTokens({
const time = process.hrtime();
switch (service) {
case "anthropic-chat":
return {
...getClaudeTokenCount(prompt ?? completion),
tokenization_duration_ms: getElapsedMs(time),
};
case "anthropic-text":
return {
...getClaudeTokenCount(prompt ?? completion),
...(await getClaudeTokenCount(prompt ?? completion)),
tokenization_duration_ms: getElapsedMs(time),
};
case "openai":