Opik icon

Opik

Interact with the Opik API

Actions6

Overview

The Opik node integrates with the Opik API to perform various operations related to datasets, feedback, guardrails, prompts, spans, and traces. Specifically, the 'Check Guardrails' operation under the 'Guardrail' resource validates text content against defined guardrails such as PII detection or topic moderation. This is useful for ensuring content compliance with privacy or content policies by detecting or redacting sensitive information or moderating topics.

Use Case Examples

  1. A user inputs text to check for PII entities like names, emails, or credit card numbers to ensure no sensitive data is exposed.
  2. A user validates text content against allowed or disallowed topics to moderate content before publishing.

Properties

Name Meaning
Project Name or ID Selects the project context for the guardrail check, either by choosing from a list or specifying an ID via expression.
Text The content text to be validated against the guardrails.
Guardrail Type Specifies the type of guardrail validation to perform, either PII detection or topic moderation.
Allowed Topics Specifies topics that are permitted when using topic moderation guardrail type.
Disallowed Topics Specifies topics that are blocked when using topic moderation guardrail type.
PII Entities Lists the types of PII entities to detect or redact, such as name, email, phone, address, SSN, and credit card.
Request Options Additional request settings including batching, SSL certificate validation, proxy configuration, and timeout settings.

Output

JSON

  • result - The response from the Opik API containing the guardrail check results, such as detected PII entities or topic moderation status.

Dependencies

  • Requires an API key credential for authenticating with the Opik API.

Troubleshooting

  • Common issues include invalid project ID or name, resulting in failed API calls. Verify the project selection or expression used.
  • Incorrect or missing guardrail type or configuration may cause validation errors. Ensure the guardrail type matches the provided configuration fields.
  • Network issues or SSL certificate problems can cause request failures. Use the 'Ignore SSL Issues' option cautiously if needed.
  • Timeouts may occur if the server is slow to respond; adjust the timeout setting accordingly.

Links

Discussion