From 6f5a50c8c6f46487b2fea1fb3907f5f7af407417 Mon Sep 17 00:00:00 2001 From: Kenan Yildirim Date: Thu, 3 Oct 2024 12:17:45 -0400 Subject: [PATCH] fix: mention that the user may not be authorized --- .github/workflows/ci.yml | 6 +++++- README.md | 2 +- langchain_rag_authz/__main__.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 900a03e..69de0bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,4 +87,8 @@ jobs: if: ${{ matrix.os == 'macos-latest' }} - name: Print help text - run: uv run python -m langchain_rag_authz --help + uses: nick-fields/retry@v2.9.0 + with: + timeout_seconds: 30 + max_attempts: 10 + command: uv run python -m langchain_rag_authz --help diff --git a/README.md b/README.md index 1c8e548..438e7ce 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ But they cannot query finance information: ``` $ python -m langchain_rag_authz --user alice "What is the top salary in the Engineering department?" -I don't know. +I don't know the answer to that question, and you may not be authorized to know the answer. ``` And vice versa for "bob", who is in finance but not engineering. diff --git a/langchain_rag_authz/__main__.py b/langchain_rag_authz/__main__.py index 51a38fc..1404a92 100644 --- a/langchain_rag_authz/__main__.py +++ b/langchain_rag_authz/__main__.py @@ -19,7 +19,7 @@ [ ( "human", - """You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question. If you don't know the answer, just say that you don't know. Use three sentences maximum and keep the answer concise. + """You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question. If you don't know the answer, just say that you don't know and that the user may not be authorized to know the answer. Use three sentences maximum and keep the answer concise. Question: {input} Context: {context} Answer:""",