원클릭으로
python-sdk
Python SDK patterns for Opik. Use when working in sdks/python, on SDK APIs, integrations, or message processing.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Python SDK patterns for Opik. Use when working in sdks/python, on SDK APIs, integrations, or message processing.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when a developer wants to add, write, or create an end-to-end test for an Opik feature, page, or branch — e.g. "add an e2e test for the experiments comparison page", "write a test for the feature I just built", "e2e test for this branch", "cover the dataset items flow with a test". Runs the full loop in tests_end_to_end/e2e/ — analyze the feature and frontend code, explore the live UI with the Playwright MCP, write the Page Object Model + spec, and run it locally until green.
Use when an Opik E2E test has failed and a developer wants it investigated — e.g. "why did this e2e test fail?", "investigate the failing run on my PR", "is dataset-crud-smoke flaky?", "the nightly e2e suite went red". Takes a failure from a CI check, a TestOps launch, a test name, or a local run; gathers the trace and history, classifies regression vs. flake, and proposes a fix. Read-only — it diagnoses and proposes, it does not edit tests.
Use when building or extending a Page Object Model (POM) for the Opik E2E suite (under `tests_end_to_end/e2e/pom/`) and you need to choose stable selectors against the live UI. Walks through seeding required state, exploring the running page with the Playwright MCP (accessibility snapshot + data-testid enumeration), picking the most stable locator for each element, and verifying it before committing. Used as the discovery sub-step by the `writing-e2e-tests` skill.
Java backend patterns for Opik. Use when working in apps/opik-backend, designing APIs, database operations, or services.
React frontend patterns for Opik. Use when working in apps/opik-frontend, on components, state, or data fetching.
Generate self-contained HTML architecture diagrams. Use when creating visual diagrams for PRs, task plans, or architectural explanations.
| name | python-sdk |
| description | Python SDK patterns for Opik. Use when working in sdks/python, on SDK APIs, integrations, or message processing. |
Layer 1: Public API (opik.Opik, @opik.track)
↓
Layer 2: Message Processing (queue, batching, retry)
↓
Layer 3: REST Client (OpikApi, HTTP)
# ✅ REQUIRED for async operations
client = opik.Opik()
# ... tracing operations ...
client.flush() # Must call before exit!
Async (via message queue) - fire-and-forget:
trace(), span()log_traces_feedback_scores()experiment.insert()Sync (blocking, returns data):
create_dataset(), get_dataset()create_prompt(), get_prompt()search_traces(), search_spans()# ✅ GOOD - integration files assume dependency exists
import anthropic # Only imported when user uses integration
# ❌ BAD - importing at package level
from opik.integrations import anthropic # Would fail if not installed
Library has callbacks? → Pure Callback (LangChain, LlamaIndex)
No callbacks? → Method Patching (OpenAI, Anthropic)
Callbacks unreliable? → Hybrid (ADK)
from opik.integrations.anthropic import track_anthropic
client = anthropic.Anthropic()
tracked_client = track_anthropic(client) # Wraps methods
from opik.integrations.langchain import OpikTracer
tracer = OpikTracer()
chain.invoke(input, config={"callbacks": [tracer]})
@opik.track
def my_function(input: str) -> str:
# Auto-creates span, captures input/output
return process(input)
>=2.0.0,<3.0.0Messages batch together for efficiency:
# CRUD: create/get/list/update/delete
client.create_experiment(name="exp")
client.get_dataset(name="ds")
# Search for complex queries
client.search_spans(project_name="proj")
client.search_traces(project_name="proj")
# Batch for bulk operations
client.batch_create_items(...)