To support more online/local models and vector stores, it will be more convenient to pass into langchain components, so that we don't need to handle initiation of various models and vector stores in Rebuff, as well as different invoking methods.
Main changes:
Add a new python api RebuffDetectionWithLangchain besides RebuffSdk, which requires langchain LanguageModel and VectorStore as inputs.
Reformat prompt template to reuse examples.
Initiate vector store with positive examples.
Change calling of openai to langchain llm.
Add feature of log positive outcome in detection.
Use similarity_search_with_relevance_scores instead of similarity_search_with_scores in detect_pi_vectorbase.py, because the output should be the similarity score other than distance.
Add corresponding unit test and usage example notebook.
To support more online/local models and vector stores, it will be more convenient to pass into langchain components, so that we don't need to handle initiation of various models and vector stores in Rebuff, as well as different invoking methods.
Main changes: