Skip to content

Commit

Permalink
Merge pull request #23 from nihadtz/weaviate-local
Browse files Browse the repository at this point in the history
Enable usage of the local WeaviateDB without a secure connection.
  • Loading branch information
adhityan authored May 9, 2024
2 parents deb2694 + d6d4e92 commit f965536
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ npm install weaviate-ts-client
```TS
import { WeaviateDb } from '@llm-tools/embedjs/vectorDb/weaviate';

.setVectorDb(new WeaviateDb({ host: '...', apiKey: '...', className: '...' }))
.setVectorDb(new WeaviateDb({ host: '...', apiKey: '...', className: '...', scheme: '...' }))
```

## Qdrant
Expand Down
4 changes: 2 additions & 2 deletions src/vectorDb/weaviate-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export class WeaviateDb implements BaseDb {
private readonly className: string;
private readonly client: WeaviateClient;

constructor({ host, apiKey, className }: { host: string; apiKey: string; className: string }) {
constructor({ host, apiKey, className, scheme = 'https' }: { host: string; apiKey: string; className: string; scheme: 'http' | 'https' }) {
// @ts-ignore
this.client = weaviate.client({ scheme: 'https', host, apiKey: new ApiKey(apiKey) });
this.client = weaviate.client({ scheme, host, apiKey: new ApiKey(apiKey) });
this.className = toTitleCase(className); // Weaviate translates the className during create to title case and errors at other places
}

Expand Down

0 comments on commit f965536

Please sign in to comment.