Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEID-1867 LLM Wrapper #25

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

DEID-1867 LLM Wrapper #25

wants to merge 5 commits into from

Conversation

mrplt-pai
Copy link
Contributor

@mrplt-pai mrplt-pai commented Sep 12, 2023

What's Changed?

An LLM wrapper is added. It takes a string as a prompt that is then deidentified. It then gets sent to the LLM, and the response (alongside the original message) is reidentified. Returns a list of strings as a response. Supports OpenAI, Cohere and VertexAI.

Sample commands to test
llm_response = pai_client.send_redacted_prompt(prompt="My sample name is John Smith", llm_model="openai", model="gpt-3.5-turbo", model_api_key="ADD_MODEL_KEY_HERE")

llm_response = pai_client.send_redacted_prompt(prompt="My sample name is John Smith", llm_model="cohere", model_api_key="ADD_MODEL_KEY_HERE")

llm_response = pai_client.send_redacted_prompt(prompt="My sample name is John Smith", llm_model="vertexai", chat_model_name="chat-bison@001") -- needs to be configured beforehand if I understand correctly.

PR Checklist

  • Updated unit tests
  • Ran unit tests

@mrplt-pai
Copy link
Contributor Author

I tested this with Cohere and OpenAI. Working on VertexAI still.
@koryf I'd love your opinion on whether this is what we're looking for. It takes a string as an input, deidentifies it, passes it through the LLM and then reidentifies the incoming message as well as the deidentified prompt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant