Skip to main content

typescript-sdk

TypeScript SDK patterns for Opik. Use when working in sdks/typescript.

소스 정보

저장소
comet-ml/opik
최근 소스 활동
2026년 2월 24일 15:06
감지된 SKILL.md 언어
영어
스타
22,503
포크
1,846

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
typescript-sdk
description
TypeScript SDK patterns for Opik. Use when working in sdks/typescript.
# TypeScript SDK ## Architecture - Layered, non-blocking by default - Data buffered and flushed async to backend - Node >= 18, ESM + CJS builds ## Layer Flow ``` Public API → OpikClient → Domain (Trace/Span) → BatchQueues → REST Client → Backend ``` ## Critical Gotchas - When changing dependencies or minimum versions, update and verify version references in `README.md` and integration README files in the same PR. ### Flush Before Exit ```typescript // ✅ REQUIRED - especially in CLI/tests await client.flush(); // or globally: await flushAll(); ``` ### Domain Objects Don't Do HTTP ```typescript // ✅ GOOD - domain objects enqueue, not HTTP trace.update({ metadata: { key: 'value' } }); // Enqueues update trace.end(); // Enqueues update // ❌ BAD - don't call REST directly from domain ``` ### Never Leak rest_api ```typescript // ✅ GOOD - export from public API export { Opik, track, flushAll } from 'opik'; // ❌ BAD - don't expose generated clients import { TracesApi } from 'opik/rest_api'; // Internal! ``` ## Batching Semantics - Updates wait for pending creates - Deletes wait for creates and updates - `flush()` flushes all queues in order - Debounce window configurable via `OpikConfig` ## Error Handling - HTTP failures: `OpikApiError`, `OpikApiTimeoutError` - 404s translate to domain errors: `DatasetNotFoundError`, `ExperimentNotFoundError` - Never swallow errors, include context in logs ## Integration Guidelines - Integrations wrap public API only - Keep adapters thin, non-blocking - Provide `flush()` escape hatch if needed ## Reference Files - [testing.md](testing.md) - Vitest patterns, mocking, flush timing
GitHub에서 보기