Skip to content

Commit

Permalink
VS-197: Fix Vectorize List MetadataIndex Http Method (#6502)
Browse files Browse the repository at this point in the history
* VS-197: Fix Vectorize List MetadataIndex Http Method

* Update .changeset/stale-moles-give.md

---------

Co-authored-by: Carmen Popoviciu <carmen.popoviciu@gmail.com>
  • Loading branch information
garvit-gupta and CarmenPopoviciu committed Aug 16, 2024
1 parent 56a3de2 commit a9b4f25
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/stale-moles-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

fix: Fix Vectorize List MetadataIndex Http Method
4 changes: 2 additions & 2 deletions packages/wrangler/src/__tests__/vectorize/vectorize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ function mockVectorizeV2Request() {
},
{ once: true }
),
http.post(
http.get(
"*/accounts/:accountId/vectorize/v2/indexes/test-index/metadata_index/list",
() => {
return HttpResponse.json(
Expand Down Expand Up @@ -1163,7 +1163,7 @@ function mockVectorizeV2RequestError() {
},
{ once: true }
),
http.post(
http.get(
"*/accounts/:accountId/vectorize/v2/indexes/test-index/metadata_index/list",
() => {
return HttpResponse.json(
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/vectorize/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export async function listMetadataIndex(
return await fetchResult(
`/accounts/${accountId}/vectorize/v2/indexes/${indexName}/metadata_index/list`,
{
method: "POST",
method: "GET",
}
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/vectorize/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function options(yargs: CommonYargsArgv) {
type: "array",
demandOption: true,
describe:
"Vector to query the Vectorize Index. Example: `--vector 1 2 3 0.5 1.25 6`",
"Vector to query the Vectorize Index. Example: `--vector 1 2 3 0.5 1.25 6`. To read from a json file that contains data in the format [1, 2, 3], you could use a command like `--vector $(jq -r '.[]' data.json | xargs)`",
coerce: (arg: unknown[]) =>
arg
.map((value) =>
Expand Down

0 comments on commit a9b4f25

Please sign in to comment.