GuardrailRules
List GuardrailRules
Returns a paginated list of guardrail rules for the current project.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.guardrail_rules.list(limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of data
Show Properties of data
Create a GuardrailRule
Creates a new guardrail rule with expression, guardrails configuration, and timeout settings.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.guardrail_rules.create(display_name="Rosemarie_Wisoky")
# Handle response
print(res)
Show Parameters
Show Parameters
Optional project ID. If null/omitted, the entity is global (workspace-wide).
Show Response
Show Response
Delete a GuardrailRule
Deletes an existing guardrail rule by ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.guardrail_rules.delete(guardrail_rule_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
The request object to use for the request.
Retrieve a GuardrailRule
Retrieves the details of an existing guardrail rule by ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.guardrail_rules.retrieve(guardrail_rule_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
The request object to use for the request.
Show Response
Show Response
Update a GuardrailRule
Partially updates an existing guardrail rule. Only provided fields are updated.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.guardrail_rules.update(guardrail_rule_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
The ID of the guardrail rule
Show Response
Show Response