Skip to content

Commit 50ee7f5

Browse files
committed
update create/drop table with cloud;
1 parent 15a4eec commit 50ee7f5

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "epsillajs",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "A JS library to connect Epsilla vector database",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/cloud.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface CloudClientConfig {
66
apiKey: string;
77
}
88

9+
const dispatchDomain = 'https://dispatch.epsilla.com';
910
const projectHost = 'https://dispatch.epsilla.com/api/v3/project';
1011
const vectordbPath = 'api/v3/project/${projectID}/vectordb';
1112
/**
@@ -59,8 +60,9 @@ export class VectorDB {
5960

6061
async createTable(tableName: string, fields: TableField[]) {
6162
try {
63+
const domain = this.host || dispatchDomain;
6264
const response = await axios.post(
63-
`${projectHost}/${this.projectID}/vectordb/${this.dbID}/table/create`,
65+
`${domain}/api/v3/project/${this.projectID}/vectordb/${this.dbID}/table/create`,
6466
{
6567
table_name: tableName,
6668
fields
@@ -75,8 +77,9 @@ export class VectorDB {
7577

7678
async dropTable(tableName: string) {
7779
try {
80+
const domain = this.host || dispatchDomain;
7881
const response = await axios.delete(
79-
`${projectHost}/${this.projectID}/vectordb/${this.dbID}/table/delete`,
82+
`${domain}/api/v3/project/${this.projectID}/vectordb/${this.dbID}/table/delete`,
8083
{
8184
params: {
8285
table_name: tableName

0 commit comments

Comments
 (0)