Questions tagged [langchain]

LangChain is an open-source framework for developing applications powered by language models. Use [py-langchain] for the python-specific package.

LangChain is an open-source framework for developing applications powered by language models. Use [py-langchain] for the python-specific package.

672 questions
0
votes
4 answers

What does `pip install unstructured[local-inference]` do?

I was following a tutorial on langchain, and after using loader.load() to load a PDF file, it gave me an error and suggested that some dependencies are missing and I should install them using pip install unstructured[local-inference]. So, I did. But…
user1720897
  • 1,216
  • 3
  • 12
  • 27
0
votes
1 answer

How to deploy python code to azure function using vs code

My python code uses API call and data path from where it takes the file and convert it into json index file. Then while making the query it returns the answer from that index file. I have tried to deploy the on Azure function using VS code but…
Sam
  • 21
  • 2
0
votes
1 answer

How to add question and GPT Api response variables to Gradio chatbot()?

I have a program that extracts the information form a previously-created and working json file, and then uses chatGPT API to query this document. I need to input the initial user input and then the response to his input all within the bot scrolling…
skeitel
  • 271
  • 2
  • 6
  • 17
0
votes
0 answers

I never get embedded files loaded with from langchain.document_loaders import DirectoryLoader

My code with from langchain.document_loaders import TextLoader, with a single .txt file it works but with DirectoryLoader nothing. Attach image of the code:(https://i.stack.imgur.com/VAKxn.png) Attach image of contect of the texts:enter image…
0
votes
0 answers

Importing ESM library removes last character of the index.js file

I am importing the langchain library using the command: import { OpenAI } from "langchain"; For some reason, I am getting an error from the browser saying: Uncaught SyntaxError: '' literal not terminated before end of script where it references…
0
votes
0 answers

How to pass a prompt template to GPT Index Method

I am trying to connect huggingface model with external data using GPTListIndex. GPTListIndex(documents,llm_predictor=llm_predictor) I want to use a prompt also. Here is prompt template. example_prompt = PromptTemplate( input_variables=["Query",…
Talha Anwar
  • 2,699
  • 4
  • 23
  • 62
-1
votes
0 answers

Security of database credentials connecting Langchain with OpenAI

In LangChain you define the connection credentials to the database. Finally the "connection string" is passed to the OpenAI models. I consider it dangerous to share with OpenAI. server = 'server-name' database = 'db-name' username =…
Pool Nolasco
  • 93
  • 1
  • 6
-1
votes
0 answers

Custom chatbot built using langchain+Flowise+Pinecone+Render is super slow

I've built a chatbot using Flowise and Pinecone and using render to run my chatbot. I have it embedded on a mockup site I build to test the chatbot on. The response time when I ask questions is very slow. I have one flow (Flow 1) to upsert the…
3dots
  • 1
-1
votes
0 answers

Langchain token exceeded issue

I am building a chatbot using langchain and in side, openAi model I chose the text-davinci-003 model my input token size is 1596 and the output is never be completed because the token limit exceeded how to fix the problem this issue is neve come if…
-1
votes
0 answers

How do we create GPT prompt using openai in which we can get result from api

For example we have weather api, we have url https://weather.org/city=berlin and want to know weather news of 'berlin', so it hit the api, api has data like (Temperature: 14°C (57°F),Precipitation: 7% Humidity: 90%, Wind Speed: 11 km/h) and get…
-1
votes
0 answers

Open API key throwing error on google colab

--------------------------------------------------------------------------- AuthenticationError Traceback (most recent call last) \ in \() \----\> 1 llms = llm.predict("hi!") 2…
-1
votes
0 answers

I had a functional gpt-4 model using only data from a chroma duckdb, now it no longer works and just functions as a regular chat model

Here is the code import os import constants import chromadb import PySimpleGUI as sg from langchain.chat_models import ChatOpenAI from langchain.chains import ConversationalRetrievalChain from langchain.vectorstores import Chroma from…
-1
votes
0 answers

Langchain Chatbot validation Error with custom template

I am trying to create simpl chatbot with Langchain and want to store conversation history as well but it's throwing error while reading data.json while using qa_chain to render chain conversation. instance of VectorStore expected…
BJ Coder
  • 350
  • 5
  • 16
-1
votes
0 answers

How Can I Upsert Freshdesk Ticket Data into Pinecone and Query It Using Sentence Transformers?

I am trying to upsert Freshdesk ticket data into Pinecone and then query that data. Despite trying multiple approaches, I'm still struggling with what seems to be a simple task. Upserting Data I have the following code to upsert Freshdesk ticket…
-1
votes
1 answer

How to connect to postgreSQL in langchain and make schema

I want to use langchain's SQLAgent with my database PostgreSQL, the default schema is public, I want to use my schema like 'my_schema', what should I do? I've tried splicing search_path=my_schema after the connection address but I get an error…
blackzzz
  • 1
  • 1