Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions js/ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@
"@genkit-ai/core": "workspace:*",
"@opentelemetry/api": "^1.7.0",
"@types/node": "^20.11.19",
"front-matter": "^4.0.2",
"json5": "^2.2.3",
"node-fetch": "^3.3.2",
"zod": "^3.22.4",
"zod-to-json-schema": "^3.21.4"
"zod": "^3.22.4"
},
"devDependencies": {
"npm-run-all": "^4.1.5",
Expand Down
8 changes: 1 addition & 7 deletions js/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"build:clean": "rm -rf ./lib",
"build": "npm-run-all build:clean check compile",
"build:watch": "tsup-node --watch",
"test": "node --import tsx --test tests/*_test.ts tests/**/*_test.ts"
"test": "node --import tsx --test tests/*_test.ts"
},
"repository": {
"type": "git",
Expand All @@ -25,10 +25,6 @@
"author": "genkit",
"license": "Apache-2.0",
"dependencies": {
"@google-cloud/firestore": "^7.5.0",
"@google-cloud/monitoring": "^4.0.0",
"@google-cloud/opentelemetry-cloud-monitoring-exporter": "^0.17.0",
"@google-cloud/trace-agent": "^7.1.2",
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/context-async-hooks": "^1.20.0",
"@opentelemetry/core": "^1.22.0",
Expand All @@ -38,9 +34,7 @@
"ajv": "^8.12.0",
"async-mutex": "^0.5.0",
"express": "^4.19.2",
"express-openapi-validator": "^5.1.3",
"json-schema": "^0.4.0",
"winston": "^3.12.0",
"zod": "^3.22.4",
"zod-to-json-schema": "^3.22.4"
},
Expand Down
1 change: 0 additions & 1 deletion js/core/src/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { TraceStoreExporter } from './tracing/exporter.js';
import { MultiSpanProcessor } from './tracing/multiSpanProcessor.js';

export * from './tracing/exporter.js';
export * from './tracing/firestoreTraceStore.js';
export * from './tracing/instrumentation.js';
export * from './tracing/localFileTraceStore.js';
export * from './tracing/processor.js';
Expand Down
3 changes: 1 addition & 2 deletions js/flow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
"firebase-admin": "^12.1.0",
"firebase-functions": "^4.3.1",
"uuid": "^9.0.1",
"zod": "^3.22.4",
"zod-to-json-schema": "^3.21.4"
"zod": "^3.22.4"
},
"devDependencies": {
"@types/express": "^4.17.21",
Expand Down
27 changes: 0 additions & 27 deletions js/plugins/dotprompt/examples/dir.ts

This file was deleted.

11 changes: 0 additions & 11 deletions js/plugins/dotprompt/examples/joke.prompt

This file was deleted.

30 changes: 0 additions & 30 deletions js/plugins/dotprompt/examples/joke.ts

This file was deleted.

10 changes: 0 additions & 10 deletions js/plugins/dotprompt/examples/prompts/joke.pirate.prompt

This file was deleted.

10 changes: 0 additions & 10 deletions js/plugins/dotprompt/examples/prompts/joke.prompt

This file was deleted.

10 changes: 0 additions & 10 deletions js/plugins/dotprompt/examples/prompts/joke.ultra.prompt

This file was deleted.

3 changes: 1 addition & 2 deletions js/plugins/dotprompt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"front-matter": "^4.0.2",
"handlebars": "^4.7.8",
"node-fetch": "^3.3.2",
"zod": "^3.22.4",
"zod-to-json-schema": "^3.22.4"
"zod": "^3.22.4"
},
"devDependencies": {
"@types/node": "^20.11.16",
Expand Down
11 changes: 7 additions & 4 deletions js/plugins/firebase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"compile": "tsup-node",
"build:clean": "rm -rf ./lib",
"build": "npm-run-all build:clean check compile",
"build:watch": "tsup-node --watch"
"build:watch": "tsup-node --watch",
"test": "node --import tsx --test tests/*_test.ts"
},
"repository": {
"type": "git",
Expand All @@ -33,13 +34,15 @@
"@genkit-ai/ai": "workspace:*",
"@genkit-ai/core": "workspace:*",
"@genkit-ai/flow": "workspace:*",
"@google-cloud/firestore": "^7.6.0",
"express": "^4.19.2",
"firebase-admin": "^12.1.0",
"firebase-functions": "^4.3.1",
"google-auth-library": "^9.6.3",
"zod": "^3.22.4"
},
"peerDependencies": {
"@google-cloud/firestore": "^7.6.0",
"firebase-admin": "^12.1.0",
"firebase-functions": "^4.3.1"
},
"devDependencies": {
"@types/node": "^20.11.16",
"npm-run-all": "^4.1.5",
Expand Down
13 changes: 9 additions & 4 deletions js/plugins/firebase/src/firestoreRetriever.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@
*/

import { embed, EmbedderArgument } from '@genkit-ai/ai/embedder';
import { defineRetriever, DocumentData, Part } from '@genkit-ai/ai/retriever';
import { VectorQuerySnapshot } from '@google-cloud/firestore';
import {
defineRetriever,
DocumentData,
Part,
RetrieverAction,
} from '@genkit-ai/ai/retriever';
import {
Firestore,
Query,
QueryDocumentSnapshot,
} from 'firebase-admin/firestore';
VectorQuerySnapshot,
} from '@google-cloud/firestore';
import z from 'zod';

function toContent(
Expand Down Expand Up @@ -95,7 +100,7 @@ export function defineFirestoreRetriever(config: {
metadataFields?:
| string[]
| ((snap: QueryDocumentSnapshot) => Record<string, any>);
}) {
}): RetrieverAction {
const {
name,
label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
* limitations under the License.
*/

import { Firestore } from '@google-cloud/firestore';
import { randomUUID } from 'crypto';
import { logger } from '../logging.js';
import { logger } from '@genkit-ai/core/logging';
import {
SpanData,
SpanDataSchema,
Expand All @@ -25,7 +23,9 @@ import {
TraceQuery,
TraceQueryResponse,
TraceStore,
} from './types.js';
} from '@genkit-ai/core/tracing';
import { Firestore } from '@google-cloud/firestore';
import { randomUUID } from 'crypto';

const DOC_MAX_SIZE = 1_000_000;

Expand Down
2 changes: 1 addition & 1 deletion js/plugins/firebase/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

import { genkitPlugin, Plugin } from '@genkit-ai/core';
import { FirestoreTraceStore } from '@genkit-ai/core/tracing';
import { FirestoreStateStore } from '@genkit-ai/flow';
import { FirestoreTraceStore } from './firestoreTraceStore';
export { defineFirestoreRetriever } from './firestoreRetriever.js';

interface FirestorePluginParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import assert from 'node:assert';
import { describe, it } from 'node:test';
import { rebatchSpans } from '../../src/tracing.js';
import { rebatchSpans } from '../src/firestoreTraceStore';

const TRACE_ID = '1234';
const SPAN_A = 'abc';
Expand Down
Loading