Skip to content

[bug] Guards that dont exist in settings.use_remote = True dont error and openAI api error for guard not found not helpful #1015

@dtam

Description

@dtam

Describe the bug
A clear and concise description of what the bug is.
no guard when using the server should be easier to figure out

To Reproduce

from guardrails import settings

settings.use_remote = True
Guard(name="basic")(
    model="gpt-4o-mini",
    messages=[{
        "role": "system",
        "content": "Welcome to the OpenAI chatbot! How can I help you today?"
    }]
)

should error if the guard isnt found

# Next, we created a Guarded endpoint that uses the hallucination validator:
guarded_client = OpenAI(
    api_key=openai_api_key,
    base_url="http://127.0.0.1:8000/guards/basic/openai/v1/"
)

guarded_client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{
        "role": "system",
        "content": "Welcome to the OpenAI chatbot! How can I help you today?"
    }]
)

errors in an arcane server 500

Expected behavior
should be easier to figure out

Library version:
Version (0.5.X)

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions