Skip to content

Commit

Permalink
Tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Dec 2, 2024
1 parent 505bfe3 commit 4873e8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/example/src/basics.eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { generateText } from "ai";
import { evalite, Levenshtein } from "evalite";
import { createStorage } from "unstorage";
import fsDriver from "unstorage/drivers/fs";
import { cacheLanguageModel } from "./cacheLanguageModel.js";
import { cacheModel } from "./cache-model.js";

const storage = createStorage({
driver: (fsDriver as any)({
Expand Down Expand Up @@ -36,7 +36,7 @@ evalite("Test basics", {
],
task: async (input) => {
const result = await generateText({
model: cacheLanguageModel(openai("gpt-3.5-turbo"), storage),
model: cacheModel(openai("gpt-3.5-turbo"), storage),
system: `
Answer the question concisely, in as few words as possible.
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ const createResultFromCachedObject = (
return obj as any;
};

export const cacheLanguageModel = (
model: LanguageModelV1,
storage: Storage
) => {
export const cacheModel = (model: LanguageModelV1, storage: Storage) => {
return experimental_wrapLanguageModel({
model,
middleware: {
Expand Down

0 comments on commit 4873e8a

Please sign in to comment.