Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Conversation

@marswen
Copy link

@marswen marswen commented Mar 21, 2024

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.

@marswen marswen force-pushed the python-langchain branch from bf37935 to b82fff7 Compare July 16, 2024 09:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant