Skip to content

Commit

Permalink
Merge pull request #880 from guardrails-ai/validator_versioning_hack
Browse files Browse the repository at this point in the history
Validator versioning hack
  • Loading branch information
CalebCourier authored Jul 2, 2024
2 parents 8668971 + b2f0a15 commit b3780b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions guardrails/cli/server/hub_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
from importlib.metadata import version
from string import Template
from typing import Any, Dict, Optional

Expand All @@ -18,6 +19,7 @@
TOKEN_INVALID_MESSAGE = f"""Your token is invalid. Please run `guardrails configure`\
to update your token.
{FIND_NEW_TOKEN}"""
GUARDRAILS_VERSION = version("guardrails-ai")

validator_hub_service = "https://so4sg4q4pb.execute-api.us-east-1.amazonaws.com"
validator_manifest_endpoint = Template(
Expand Down Expand Up @@ -49,6 +51,7 @@ def fetch(url: str, token: Optional[str], anonymousUserId: Optional[str]):
headers = {
"Authorization": f"Bearer {token}",
"x-anonymous-user-id": anonymousUserId,
"x-guardrails-version": GUARDRAILS_VERSION,
}
req = requests.get(url, headers=headers)
body = req.json()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "guardrails-ai"
version = "0.5.0a10"
version = "0.5.0a11"
description = "Adding guardrails to large language models."
authors = ["Guardrails AI <[email protected]>"]
license = "Apache License 2.0"
Expand Down

0 comments on commit b3780b6

Please sign in to comment.