Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix: add openai model for auto tokenisation (#745)

Max Deichmannd421c1e1062d
diff --git a/src/__tests__/generations.servertest.ts b/src/__tests__/generations.servertest.ts
index 06526fde10..531c5c6bda 100644
--- a/src/__tests__/generations.servertest.ts
+++ b/src/__tests__/generations.servertest.ts
@@ -6,7 +6,6 @@ import { v4 as uuidv4 } from "uuid";
describe("/api/public/generations API Endpoint", () => {
beforeEach(async () => await pruneDatabase());
- afterEach(async () => await pruneDatabase());
[
{
diff --git a/src/__tests__/usage.servertest.ts b/src/__tests__/usage.servertest.ts
index 5e8fedad61..14c00e5053 100644
--- a/src/__tests__/usage.servertest.ts
+++ b/src/__tests__/usage.servertest.ts
@@ -8,6 +8,7 @@ describe("Token Count Functions", () => {
{ model: "gpt-4-vision-preview", tokens: 114 },
{ model: "claude", tokens: 118 },
{ model: "claude-instant-1.2", tokens: 118 },
+ { model: "gpt-3.5-turbo-1106", tokens: 114 },
].forEach(({ model, tokens }) => {
it(`should return token count ${tokens} for ${model}`, () => {
const result = tokenCount({
diff --git a/src/features/ingest/lib/usage.ts b/src/features/ingest/lib/usage.ts
index 1571f81f4d..cdd7e869fb 100644
--- a/src/features/ingest/lib/usage.ts
+++ b/src/features/ingest/lib/usage.ts
@@ -190,6 +190,7 @@ function isOpenAiModel(model: string): model is TiktokenModel {
"gpt-3.5-turbo-0613",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-16k-0613",
+ "gpt-3.5-turbo-1106",
].find((m) => m === model) !== undefined
);
}