guardrails-ai / guardrails

Adding guardrails to large language models.

Home Page:https://www.guardrailsai.com/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] Ctrl+V does not work in guardrails cli on Windows

CalebCourier opened this issue · comments

Describe the bug
When a user runs guardrails configure part of the prompt is pasting in their token. On Windows specifically, the command line behaviour within the cli differs from the command line outside of this process where pasting via Ctrl+V does not work. If the user right-clicks then the value is pasted and the process can move forward, but the arguable more normal interaction of using Ctrl-V does not.

This behaviour has been witnessed in Command Prompt on Windows 11, as well as in Command Prompt, PowerShell, and Git BASH on a virtual environment running Windows 10 (Server 2022 based) (WSP).

To Reproduce
Steps to reproduce the behavior:

  1. RAIL spec
  2. Runtime arguments (e.g. guard(...))

Expected behavior
A clear and concise description of what you expected to happen.

Library version:
Version (e.g. 0.1.5)
0.4.2+

Additional context
Add any other context about the problem here.

Prerequisites

  1. Windows machine (Windows 10 or 11)
  2. Open Command Prompt (cmd.exe)

To reproduce

  1. Install guardrails-ai as per the Getting Started guide: pip install guardrails-ai.
  2. Run guardrails configure as per the same.
  3. Guardrails Hub responds with it own Token: prompt, awaiting user response
  4. Pasting the Guardrails Hub token via Ctrl+V and then Enter causes an error cascade that starts with:
--- Logging error ---
Traceback (most recent call last):
  File "C:\Users\<userName>\AppData\Local\Programs\Python\Python312\Lib\site-packages\jwt\jws.py", line 76, in _decode_segments
    signing_message, signature_b64 = message.rsplit('.', 1)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)

Expected behavior:

Pasting the Guardrails Hub token with Ctrl+V and then Enter should accept the token and allow the user to continue with the configuration.

Library Version

0.4.3

Additional context

Pasting the token value via a right mouse click, followed by Enter behaves as expected and allows the configuration to finish.