Skip to content

Commit

Permalink
Revert "feat(js/plugins/ollama): Ollama embeddings (#807)"
Browse files Browse the repository at this point in the history
This reverts commit fb1c284.
  • Loading branch information
cabljac committed Sep 16, 2024
1 parent 34d495c commit 76ddebd
Show file tree
Hide file tree
Showing 33 changed files with 351 additions and 1,924 deletions.
22 changes: 0 additions & 22 deletions docs/errors/no_new_actions_at_runtime.md

This file was deleted.

2 changes: 1 addition & 1 deletion genkit-tools/cli/src/commands/eval-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const evalFlow = new Command('eval:flow')

const evalRun = {
key: {
actionRef: `/flow/${flowName}`,
actionId: flowName,
evalRunId,
createdAt: new Date().toISOString(),
},
Expand Down
7 changes: 1 addition & 6 deletions genkit-tools/common/src/eval/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* limitations under the License.
*/

import { DatasetStore, EvalStore } from '../types/eval';
import { LocalFileDatasetStore } from './localFileDatasetStore';
import { EvalStore } from '../types/eval';
import { LocalFileEvalStore } from './localFileEvalStore';
export { EvalFlowInput, EvalFlowInputSchema } from '../types/eval';
export * from './exporter';
Expand All @@ -25,7 +24,3 @@ export function getEvalStore(): EvalStore {
// TODO: This should provide EvalStore, based on tools config.
return LocalFileEvalStore.getEvalStore();
}

export function getDatasetStore(): DatasetStore {
return LocalFileDatasetStore.getDatasetStore();
}
222 changes: 0 additions & 222 deletions genkit-tools/common/src/eval/localFileDatasetStore.ts

This file was deleted.

24 changes: 17 additions & 7 deletions genkit-tools/common/src/eval/localFileEvalStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ export class LocalFileEvalStore implements EvalStore {
}

async save(evalRun: EvalRun): Promise<void> {
const fileName = this.generateFileName(evalRun.key.evalRunId);
const fileName = this.generateFileName(
evalRun.key.evalRunId,
evalRun.key.actionId
);

logger.info(
`Saving EvalRun ${evalRun.key.evalRunId} to ` +
Expand All @@ -82,10 +85,13 @@ export class LocalFileEvalStore implements EvalStore {
);
}

async load(evalRunId: string): Promise<EvalRun | undefined> {
async load(
evalRunId: string,
actionId?: string
): Promise<EvalRun | undefined> {
const filePath = path.resolve(
this.storeRoot,
this.generateFileName(evalRunId)
this.generateFileName(evalRunId, actionId)
);
if (!fs.existsSync(filePath)) {
return undefined;
Expand All @@ -111,8 +117,8 @@ export class LocalFileEvalStore implements EvalStore {

logger.debug(`Found keys: ${JSON.stringify(keys)}`);

if (query?.filter?.actionRef) {
keys = keys.filter((key) => key.actionRef === query?.filter?.actionRef);
if (query?.filter?.actionId) {
keys = keys.filter((key) => key.actionId === query?.filter?.actionId);
logger.debug(`Filtered keys: ${JSON.stringify(keys)}`);
}

Expand All @@ -121,8 +127,12 @@ export class LocalFileEvalStore implements EvalStore {
};
}

private generateFileName(evalRunId: string): string {
return `${evalRunId}.json`;
private generateFileName(evalRunId: string, actionId?: string): string {
if (!actionId) {
return `${evalRunId}.json`;
}

return `${actionId?.replace('/', '_')}-${evalRunId}.json`;
}

private getIndexFilePath(): string {
Expand Down
Loading

0 comments on commit 76ddebd

Please sign in to comment.