diff --git a/packages/semantic-search/package.json b/packages/semantic-search/package.json index 25d8735..944c2cc 100644 --- a/packages/semantic-search/package.json +++ b/packages/semantic-search/package.json @@ -24,7 +24,6 @@ "postinstall": "pnpm build:stub" }, "devDependencies": { - "@payloadcms/db-mongodb": "^3.0.0-beta.107", "@payloadcms/db-postgres": "^3.0.0-beta.107", "dockerode": "^4.0.2", diff --git a/packages/semantic-search/src/components/lancedb/index.ts b/packages/semantic-search/src/components/lancedb/index.ts index 11e0e4b..4a081f5 100644 --- a/packages/semantic-search/src/components/lancedb/index.ts +++ b/packages/semantic-search/src/components/lancedb/index.ts @@ -1,8 +1,8 @@ -import {connect, type Table} from '@lancedb/lancedb' -import {getRegistry, LanceSchema} from '@lancedb/lancedb/embedding' -import {Utf8} from 'apache-arrow' -import type {Identifier, InsertFields, VectorDB} from '../../types' -import {OllamaEmbeddings, register} from '../ollama' +import { type Table, connect } from '@lancedb/lancedb' +import { LanceSchema, getRegistry } from '@lancedb/lancedb/embedding' +import { Utf8 } from 'apache-arrow' +import type { Identifier, InsertFields, VectorDB } from '../../types' +import { OllamaEmbeddings, register } from '../ollama' register() @@ -25,7 +25,6 @@ export class LanceDB implements VectorDB { } static async create(path = './lancedb') { - const func = new OllamaEmbeddings({ host: 'http://100.67.29.127:11434', model: 'nomic-embed-text', diff --git a/packages/semantic-search/src/components/ollama/index.ts b/packages/semantic-search/src/components/ollama/index.ts index 5256cb3..6225153 100644 --- a/packages/semantic-search/src/components/ollama/index.ts +++ b/packages/semantic-search/src/components/ollama/index.ts @@ -1,6 +1,6 @@ -import {getRegistry, TextEmbeddingFunction,} from '@lancedb/lancedb/embedding' -import type {Float} from 'apache-arrow' -import {Ollama} from 'ollama' +import { TextEmbeddingFunction, getRegistry } from '@lancedb/lancedb/embedding' +import type { Float } from 'apache-arrow' +import { Ollama } from 'ollama' interface Options { model: string diff --git a/packages/semantic-search/src/hooks/afterChangeHook.ts b/packages/semantic-search/src/hooks/afterChangeHook.ts index c430f55..1257203 100644 --- a/packages/semantic-search/src/hooks/afterChangeHook.ts +++ b/packages/semantic-search/src/hooks/afterChangeHook.ts @@ -1,6 +1,6 @@ -import type {FieldHook, FieldHookArgs} from 'payload' -import {isObject, isString} from 'radash' -import {getSemanticSearchCustom} from '../utils/customContext' +import type { FieldHook, FieldHookArgs } from 'payload' +import { isObject, isString } from 'radash' +import { getSemanticSearchCustom } from '../utils/customContext' export const afterChangeHook: FieldHook = (args) => { if (args.operation === 'create' || args.operation === 'update') { diff --git a/packages/semantic-search/src/index.ts b/packages/semantic-search/src/index.ts index 254d235..b877e0e 100644 --- a/packages/semantic-search/src/index.ts +++ b/packages/semantic-search/src/index.ts @@ -1,9 +1,9 @@ import defu from 'defu' -import type {Config, FieldBase} from 'payload' -import {afterChangeHook} from './hooks/afterChangeHook' -import type {SemanticSearchPluginConfig} from './types' -import {setupSemanticSearchCustom} from './utils/customContext' -import {getField, parseFields} from './utils/fields' +import type { Config, FieldBase } from 'payload' +import { afterChangeHook } from './hooks/afterChangeHook' +import type { SemanticSearchPluginConfig } from './types' +import { setupSemanticSearchCustom } from './utils/customContext' +import { getField, parseFields } from './utils/fields' export const semanticSearchPlugin = (incomingPluginConfig: SemanticSearchPluginConfig) => diff --git a/packages/semantic-search/src/utils/customContext.ts b/packages/semantic-search/src/utils/customContext.ts index 5d97096..ac9cf61 100644 --- a/packages/semantic-search/src/utils/customContext.ts +++ b/packages/semantic-search/src/utils/customContext.ts @@ -1,6 +1,6 @@ -import type {Config} from 'payload' -import {isObject} from 'radash' -import type {VectorDB} from '../types' +import type { Config } from 'payload' +import { isObject } from 'radash' +import type { VectorDB } from '../types' export type SemanticSearchCustomObject = { vectorDB: VectorDB diff --git a/packages/semantic-search/src/utils/fields.ts b/packages/semantic-search/src/utils/fields.ts index aaf68d2..e7120b4 100644 --- a/packages/semantic-search/src/utils/fields.ts +++ b/packages/semantic-search/src/utils/fields.ts @@ -1,4 +1,9 @@ -import type {CollectionConfig, Config, TextareaField, TextField,} from 'payload' +import type { + CollectionConfig, + Config, + TextField, + TextareaField, +} from 'payload' export interface FieldEntry { collectionConfig: CollectionConfig