Skip to content

Prompt Clean up before it passing to query_str? #25942

Answered by dosubot bot
mraguth asked this question in Q&A
Discussion options

You must be logged in to vote

To create embeddings for multiple columns (e.g., 'country_names' and 'city_names') in a DataFrame, incorporate those embeddings into a vector database, and call them for a query, you can follow these steps:

  1. Collect Unique String Values from Multiple Columns:
  2. Create Embeddings for These Values:
  3. Update the Vector Store:

Here is the updated code:

import pandas as pd
from langchain_chroma import Chroma
from langchain_openai import OpenAIEmbeddings
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_core.runnables import RunnablePassthrough, chain
from langchain_openai import ChatOpenAI
from langchain_core.pydantic_v1 import BaseModel, Field
import uuid
f…

Replies: 6 comments 17 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@dosubot
Comment options

@mraguth
Comment options

@dosubot
Comment options

@mraguth
Comment options

@dosubot
Comment options

Comment options

You must be logged in to vote
5 replies
@mraguth
Comment options

@dosubot
Comment options

@mraguth
Comment options

@dosubot
Comment options

Answer selected by mraguth
Comment options

You must be logged in to vote
1 reply
@dosubot
Comment options

Comment options

You must be logged in to vote
3 replies
@dosubot
Comment options

@mraguth
Comment options

@dosubot
Comment options

Comment options

You must be logged in to vote
1 reply
@dosubot
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant