Policies
List Policies
Returns a paginated list of policies 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.policies.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 Policy
Creates a new router policy with model configuration, evaluators, retry settings, and limits.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.policies.create(display_name="Zelda80")
# 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 Policy
Deletes an existing policy by ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.policies.delete(policy_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
The request object to use for the request.
Retrieve a Policy
Retrieves the details of an existing policy by ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.policies.retrieve(policy_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
The request object to use for the request.
Show Response
Show Response
Update a Policy
Partially updates an existing policy. 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.policies.update(policy_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
The ID of the policy
Show Response
Show Response