Toolverse
All skills

python-sdk

by comet-ml

Python SDK patterns for Opik. Use when working in sdks/python, on SDK APIs, integrations, or message processing.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
comet-ml
Category
Backend
Views
22

About this skill

Python SDK patterns for Opik. Use when working in sdks/python, on SDK APIs, integrations, or message processing.

How to use

  1. Zainstaluj Opik SDK dla Pythona i upewnij się, że masz dostęp do repozytorium comet-ml/opik. Skill zawiera wzorce dla trzech warstw architektury: publicznego API (opik.Opik, @opik.track), przetwarzania wiadomości (queue, batching, retry) oraz REST client.
  2. Wybierz odpowiedni wzorzec integracji na podstawie biblioteki, którą używasz: jeśli biblioteka ma callbacks (LangChain, LlamaIndex), użyj wzorca callback-based; jeśli nie ma callbacks (OpenAI, Anthropic), zastosuj method patching; jeśli callbacks są zawodne, wybierz podejście hybrydowe.
  3. Dla method patchingu zaimportuj funkcję track z odpowiedniego modułu integracji (np. track_anthropic z opik.integrations.anthropic), a następnie opakowaj klienta: tracked_client = track_anthropic(client). To automatycznie będzie śledzić wywołania metod.
  4. Dla callback-based integracji utwórz instancję trackera (np. OpikTracer z opik.integrations.langchain) i przekaż go w konfiguracji: chain.invoke(input, config={"callbacks": [tracer]}).
  5. Jeśli używasz dekoratora @opik.track, opakowuj funkcje, które chcesz śledzić — automatycznie utworzy spany i przechwyci input/output bez dodatkowego kodu.
  6. Pamiętaj, że operacje takie jak trace(), span() i log_traces_feedback_scores() są asynchroniczne (fire-and-forget), podczas gdy create_dataset(), get_dataset(), search_traces() są synchroniczne i blokują. Zawsze wywołaj client.flush() przed wyjściem z programu, aby upewnić się, że wszystkie asynchroniczne operacje zostały przetworzone.

Related skills

fastapi-templates

by wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

Backend
327582

travel-planner

by ailabs-393

This skill should be used whenever users need help planning trips, creating travel itineraries, managing travel budgets, or seeking destination advice. On first use, collects comprehensive travel preferences including budget level, travel style, interests, and dietary

Backend
4379

scientific-writing

by K-Dense-AI

Write scientific manuscripts. IMRAD structure, citations (APA/AMA/Vancouver), figures/tables, reporting guidelines (CONSORT/STROBE/PRISMA), abstracts, for research papers and journal submissions.

Backend
47191

dotnet-backend

by anton-abyzov

.NET/C# backend developer for ASP.NET Core APIs with Entity Framework Core. Builds REST APIs, minimal APIs, gRPC services, authentication with Identity/JWT, authorization, database operations, background services, SignalR real-time features. Activates for: .NET, C#, ASP.NET

Backend
92296

fastapi-pro

by sickn33

Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROACTIVELY for FastAPI development, async optimization, or API architecture.

Backend
54128

youtube-transcript

by michalparkola

Download YouTube video transcripts when user provides a YouTube URL or asks to download/get/fetch a transcript from YouTube. Also use when user wants to transcribe or get captions/subtitles from a YouTube video.

Backend
53214