Langchain with Bearer Token

Hi! Is there support for langchain to use with jwt token rather than api key? Just trying to automate the process through to create corpus and start indexing/querying without having the need to create an api key each time. Would rather use token.

No, Langchain support currently is working via API Key only. @ofermend correct me if I am wrong.

Do you want to create corpus “Every” time? It should normally be a less frequent operation.

No, however, I want to use Vectara for an MVP I’m building. I wanted users to have data silos so corpus wouldn’t get too large. Do you have a more preferable way of handling it.

It is fine to create and maintain corpus as a set of data that is logically grouped in some form.
So, the way you are doing it is good.

For your workflow, I would suggest writing a small python script that can create a corpus, index data and query that data (All three operations using JWT Tokens)

You can quickly experiment with these APIs in our API playground and if you want to see more detailed examples in different languages, then our documentation has some examples here

Perfect, thank you! Does the index function built take langchain Document type natively? I’m currently using their add_documents function, however not sure if you guys have that functionality of taking in Document type.

Langchain add_documents actually ends up calling Vectara upload API. See here

I am not exactly clear about your question but If you are asking about whether Vectara detects the document type itself, then yes, the upload API does it automatically for you and supports a lot of file types. Here is a full list of file types that are supported.

Got it! Thank you @aamir.