소스 검색

update py and js template

tumao 4 년 전
부모
커밋
f3843fb879
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      client/src/utils/code/Js.ts
  2. 1 1
      client/src/utils/code/Py.ts

+ 2 - 2
client/src/utils/code/Js.ts

@@ -7,8 +7,8 @@ export const getCreateIndexJSCode = (params: CreateIndexCodeParam) => {
 const client = new MilvusClient(milvus_address)
 
 client.indexManager.createIndex({
-  collection_name: ${collectionName},
-  field_name: ${fieldName},
+  collection_name: '${collectionName}',
+  field_name: '${fieldName}',
   extra_params: ${JSON.stringify(extraParams, null, 2)},
 });`;
 

+ 1 - 1
client/src/utils/code/Py.ts

@@ -17,7 +17,7 @@ export const getCreateIndexPYCode = (params: CreateIndexCodeParam) => {
     ...obj,
     params: parseValue(obj.params),
   };
-  const pyCode = `from pymilvus_orm import Collection,
+  const pyCode = `from pymilvus_orm import Collection
 
 collection = Collection('${collectionName}')
 index = ${JSON.stringify(index, replacer, 4)}