Relative Content

Tag Archive for langchain

How to use a token request in langchain retriever

I want to retrieve data from a database via a request call from as_retriever. In order to use all data from the database I have to authenticate.
In order to do that I have to first request a token with username and password and then use this token in the POST request.
How could I do that in langchain?

KeyError in SimpleSequentialChain

llm are created using WatsonxLLM class.
I’m getting error for the below code:
in validate_chains
for chain in values[“chains”]:
KeyError: ‘chains’

How to pass extra parameters to an LLM?

I want to pass some additional properties in the input object passed to the LLM model, beyond those produced by the ChatPromptTemplate. I need to call my LLM with a Json object, which in addition to the messages property needs some other properties. I could create a custom LLM but it seems the invoke method of an LLM expects a string parameter. Can I pass a serialized Json object which contains both messages (prompt) and my extra parameters?