Skip to content

Commit

Permalink
lint: milvus
Browse files Browse the repository at this point in the history
  • Loading branch information
MarleneJiang committed Nov 1, 2023
1 parent c05d266 commit e1db948
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
24 changes: 24 additions & 0 deletions docs/api/llm-ops.milvusvectordb.delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [milvusVectorDB](./llm-ops.milvusvectordb.md) &gt; [delete](./llm-ops.milvusvectordb.delete.md)

## milvusVectorDB.delete() method

**Signature:**

```typescript
delete(params: {
expr: string;
}): Promise<import("@zilliz/milvus2-sdk-node").MutationResult>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| params | { expr: string; } | |
**Returns:**
Promise&lt;import("@zilliz/milvus2-sdk-node").MutationResult&gt;
1 change: 1 addition & 0 deletions docs/api/llm-ops.milvusvectordb.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export declare class milvusVectorDB
| Method | Modifiers | Description |
| --- | --- | --- |
| [createCollection(params)](./llm-ops.milvusvectordb.createcollection.md) | | |
| [delete(params)](./llm-ops.milvusvectordb.delete.md) | | |
| [generatePromptTemplate(params)](./llm-ops.milvusvectordb.generateprompttemplate.md) | | |
| [generateVector(data)](./llm-ops.milvusvectordb.generatevector.md) | | |
| [query(params)](./llm-ops.milvusvectordb.query.md) | | |
Expand Down
4 changes: 2 additions & 2 deletions docs/api/llm-ops.milvusvectordb.upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
**Signature:**

```typescript
upload(params: milvusVectorDBUploadSchema): Promise<import("@zilliz/milvus2-sdk-node").ResStatus>;
upload(params: milvusVectorDBUploadSchema): Promise<import("@zilliz/milvus2-sdk-node").MutationResult | import("@zilliz/milvus2-sdk-node").ResStatus>;
```

## Parameters
Expand All @@ -18,5 +18,5 @@ upload(params: milvusVectorDBUploadSchema): Promise<import("@zilliz/milvus2-sdk-

**Returns:**

Promise&lt;import("@zilliz/milvus2-sdk-node").ResStatus&gt;
Promise&lt;import("@zilliz/milvus2-sdk-node").MutationResult \| import("@zilliz/milvus2-sdk-node").ResStatus&gt;

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "llm-ops",
"version": "0.0.11",
"version": "0.0.12",
"description": "高效制作llm workflow的低代码框架",
"main": "package/index.js",
"author": "Marlene && IdeaLeap",
Expand Down
6 changes: 3 additions & 3 deletions package/db/milvus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ export class milvusVectorDB {
}
return upsert;
}
async delete(params: {expr:string}) {
async delete(params: { expr: string }) {
const { expr } = params;
console.time("Upsert time");
const res = await this.milvusClient.deleteEntities({
collection_name: this.COLLECTION_NAME,
expr
expr,
});
console.timeEnd("Upsert time");
// if (res.status.error_code != "Success") {
Expand Down Expand Up @@ -203,7 +203,7 @@ export class milvusVectorDB {
this.llm = new LLM({});
}
const vector = await this.llm?.embedding(data);
if (!vector|| !vector?.data[0] || !vector?.data[0]?.embedding) {
if (!vector || !vector?.data[0] || !vector?.data[0]?.embedding) {
throw new Error("生成向量失败");
}
return vector?.data[0]?.embedding;
Expand Down

0 comments on commit e1db948

Please sign in to comment.