Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Failed to deserialize the JSON body into the target type: missing field metric at line 1 column 50 Status: 422 #5

Open
1 of 2 tasks
scenaristeur opened this issue Jan 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@scenaristeur
Copy link

scenaristeur commented Jan 4, 2024

Is this a new bug?

  • I believe this is a new bug
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Hi, i can not run this example

npm run index 

> langchain-ts-starter@1.0.0 index
> tsx -r dotenv/config src/index.ts

(node:331448) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///home/smag/dev/solid_pinecone/recommender-example-typescript/node_modules/tsx/dist/loader.js", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
╔════════════╤═══════════════════╤═══════════════════╤═══════════════════╤═══════════════════╤═══════════════════╤═══════════════════╤═══════════════════╤═══════════════════╤═══════════════════╤═══════════════════╗
║            │ date              │ year              │ month             │ day               │ author            │ title             │ article           │ url               │ section           │ publication       ║
╟────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢
║ 7          │ 2018-05-02 17:0…  │ 2018              │ 5                 │ 2                 │ Caroline Willia…  │ You Can Trick Y…  │ If only every d…  │ https://www.vic…  │ Health            │ Vice              ║
╟────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢
║ 11         │ 2019-06-23 00:0…  │ 2019              │ 6                 │ 23                │ Jessica DiNapol…  │ Hudson's Bay's …  │ (Reuters) - The…  │ https://www.reu…  │ Business News     │ Reuters           ║
╟────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢
║ 18         │ 2017-06-19 17:5…  │ 2017              │ 6                 │ 19                │ Linda Yang        │ Girl Scouts Are…  │  In the past, G…  │ https://www.vic…  │ Identity          │ Vice              ║
╟────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢
║ 22         │ 2018-12-28 00:0…  │ 2018              │ 12                │ 28                │ Imani Moise       │ Wells Fargo to …  │ NEW YORK (Reute…  │ https://www.reu…  │ Business News     │ Reuters           ║
╟────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢
║ 23         │ 2018-05-17 18:3…  │ 2018              │ 5                 │ 17                │ Paige Mehrer      │ 'Bendy Bone,' T…  │   Check out mor…  │ https://www.vic…  │ Comics!           │ Vice              ║
╚════════════╧═══════════════════╧═══════════════════╧═══════════════════╧═══════════════════╧═══════════════════╧═══════════════════╧═══════════════════╧═══════════════════╧═══════════════════╧═══════════════════╝

PineconeUnmappedHttpError: An unexpected error occured while calling the https://controller.###my-environment###.pinecone.io/databases endpoint.  Failed to deserialize the JSON body into the target type: missing field `metric` at line 1 column 50 Status: 422.
    at mapHttpStatusError (/home/smag/dev/solid_pinecone/recommender-example-typescript/node_modules/@pinecone-database/pinecone/dist/errors/http.js:137:19)
    at <anonymous> (/home/smag/dev/solid_pinecone/recommender-example-typescript/node_modules/@pinecone-database/pinecone/dist/errors/handling.js:80:66)
    at step (/home/smag/dev/solid_pinecone/recommender-example-typescript/node_modules/@pinecone-database/pinecone/dist/errors/handling.js:33:23)
    at Object.next (/home/smag/dev/solid_pinecone/recommender-example-typescript/node_modules/@pinecone-database/pinecone/dist/errors/handling.js:14:53)
    at fulfilled (/home/smag/dev/solid_pinecone/recommender-example-typescript/node_modules/@pinecone-database/pinecone/dist/errors/handling.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Expected Behavior

should insert to pinecone

Steps To Reproduce

npm install
npm run index

Relevant log output

No response

Environment

- **OS**:
- **Language version**:
- **Pinecone client version**:

Additional Context

seems to be quit similar to pinecone-io/semantic-search-example#6, adding metric: "cosine" in createIndex resolve this issue

No response

@scenaristeur scenaristeur added the bug Something isn't working label Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant