HamaWhiteGG / langchain-java

Java version of LangChain, while empowering LLM for Big Data.
Apache License 2.0
545 stars 106 forks source link

pls help me!!!!A 400 exception occurred while transferring data to pinecone Exception in thread "main" retrofit2.adapter.rxjava2.HttpException: HTTP 400 #73

Closed 2662007798 closed 1 year ago

2662007798 commented 1 year ago

// upsert to Pinecone
var response = index.upsert(new UpsertRequest(vectors, namespace));
In this line of code, I have an anomaly of 400.

var client = PineconeClient.builder().pineconeApiKey("").pineconeEnv("").projectName("").requestTimeout(30).build().init(); createPineconeIndex(client);

I have set these. What is the problem? pls help me

HamaWhiteGG commented 1 year ago

Please provide the complete error information, as well as the code you were running.

2662007798 commented 1 year ago

Please provide the complete error information, as well as the code you were running.

Connected to the target VM, address: '127.0.0.1:58936', transport: 'socket' SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Users/Administrator/.m2/org/apache/logging/log4j/log4j-slf4j-impl/2.17.1/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Users/Administrator/.m2/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] 2023-08-08 10:35:27 org.nd4j.linalg.factory.Nd4jBackend load INFO: Loaded [CpuBackend] backend 2023-08-08 10:35:28 org.nd4j.nativeblas.NativeOpsHolder initOps INFO: Number of threads used for linear algebra: 8 2023-08-08 10:35:28 org.nd4j.linalg.cpu.nativecpu.CpuNDArrayFactory createBlas INFO: Binary level Generic x86 optimization level AVX/AVX2 2023-08-08 10:35:28 org.nd4j.nativeblas.Nd4jBlas INFO: Number of threads used for OpenMP BLAS: 8 2023-08-08 10:35:28 org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner printEnvironmentInformation INFO: Backend used: [CPU]; OS: [Windows 10] 2023-08-08 10:35:28 org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner printEnvironmentInformation INFO: Cores: [8]; Memory: [8.0GB]; 2023-08-08 10:35:28 org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner printEnvironmentInformation INFO: Blas vendor: [OPENBLAS] 2023-08-08 10:35:28 org.nd4j.linalg.cpu.nativecpu.CpuBackend logBackendInit INFO: Backend build information: GCC: "12.1.0" STD version: 201103L DEFAULT_ENGINE: samediff::ENGINE_CPU HAVE_FLATBUFFERS HAVE_OPENBLAS Exception in thread "main" retrofit2.adapter.rxjava2.HttpException: HTTP 400 at retrofit2.adapter.rxjava2.BodyObservable$BodyObserver.onNext(BodyObservable.java:57) at retrofit2.adapter.rxjava2.BodyObservable$BodyObserver.onNext(BodyObservable.java:38) at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:48) at io.reactivex.Observable.subscribe(Observable.java:10151) at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:35) at io.reactivex.Observable.subscribe(Observable.java:10151) at io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:35) at io.reactivex.Single.subscribe(Single.java:2517) at io.reactivex.Single.blockingGet(Single.java:2001) at com.hw.pinecone.IndexClient.upsert(IndexClient.java:76) at com.hw.langchain.vectorstores.pinecone.Pinecone.fromTexts(Pinecone.java:207) at com.hw.langchain.vectorstores.base.VectorStore.fromDocuments(VectorStore.java:195) at com.hw.langchain.examples.vectorstores.PineconeExample.initializePineconeIndex(PineconeExample.java:69) at com.hw.langchain.examples.chains.RetrievalQaExample.main(RetrievalQaExample.java:51) Disconnected from the target VM, address: '127.0.0.1:58936', transport: 'socket'

2662007798 commented 1 year ago

com.hw.langchain.vectorstores.pinecone.Pinecone 207line Mistake of

HamaWhiteGG commented 1 year ago

Sorry for the delay in my response. I've been busy with work.

I've added the log4j.properties file and resolved the package conflict issue in the langchain-example directory.

The default level is set to INFO, but you can change it to DEBUG to view more detailed logs.

log4j.rootLogger=DEBUG, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d %5p %t %-20c.%M:%L - %m%n
HamaWhiteGG commented 1 year ago

Has your problem been resolved?

2662007798 commented 1 year ago

Has your problem been resolved?

Has your problem been resolved?

Thank you very much, I have solved this problem, the current problem through log4j, found to be the Pinecone index library length problem, set to 1536 can be solved very much!!!!!!

HamaWhiteGG commented 1 year ago

Welcome to contribute code to this project.