bhancockio / langchain-crash-course

258 stars 222 forks source link

Input to RunnableBranch is not the feedback #6

Open rezan21 opened 1 month ago

rezan21 commented 1 month ago

the input to the branches is not actually the initial feedback, but the output of previous chain, which would be the classification. hence, the chain is not behaving as expected

imsalik commented 6 days ago

I changed the classification_template as below: classification_template= ChatPromptTemplate.from_messages([ ("system", "You are helpful assistant that classify sentiments of the feedback"), ("human", "Classify the sentiment of this feedback as positive, negative, neutral or escalte.\ No explanation. Only answer from given keywords in lower case. Feedback: {feedback}.\ Include the original feedback in your answer after the classification.") ])

This keeps the original feedback in response.