Skip to main content

Evaluation Framework SDK

Project description

DeepEvalClient

A lightweight Python client for interacting with the Evaluation API. It provides convenient wrappers for text and schema evaluation endpoints, with support for background jobs and probabilistic execution.


Features

  • 🔹 Text Evaluation – Run evaluations on plain text inputs.
  • 🔹 Schema Evaluation – Evaluate structured inputs against schema-based metrics.
  • 🔹 Background Jobs – Submit jobs asynchronously and process later.
  • 🔹 Probabilistic Execution – Run evaluations with a configurable chance (e.g., A/B testing scenarios).
  • 🔹 Robust Error Handling – Handles network errors and invalid JSON gracefully.
  • 🔹 Configurable – Configure via constructor args, environment variables, or external settings module.

Installation

pip install rakam-eval-sdk

Usage

  1. Basic Setup
from deepeval.client import DeepEvalClient
from deepeval.schema import TextInputItem, MetricConfig

client = DeepEvalClient(
    base_url="http://localhost:8080",
    api_token="your-api-key"
)
  1. Text Evaluation
    client.maybe_text_eval_background(
                component="ocr",
                data=[
                    TextInputItem(

                        id="runtime evaluation", # identifiar (that can be unique). use same id in case you want to follow performance over time
                        input="...", # input given to ai component
                        output="...", # output of the ai component
                        # optional args/ condtional based on metrics passed
                        expected_output=["..."],
                        retrieval_context=[
                            ["..."]
                        ]

                    )
                ],
                metrics=[
                    ToxicityConfig(
                        # model="gpt-4.1",
                        threshold=0.2,
                        include_reason=False
                    ),
                    CorrectnessConfig(
                        steps=[
                            "You are evaluating text extracted from resumes and job descriptions using OCR.",
                            "1. Verify that the extracted text is coherent and free of major corruption (e.g., broken words, random characters).",
                            "2. Check whether key resume/job-related fields are preserved correctly (e.g., name, job title, skills, education, experience, company name, job requirements).",
                            "3. Ensure that important details are not missing or replaced with irrelevant content.",
                            "4. Ignore minor formatting issues (line breaks, spacing) as long as the information is readable and accurate.",
                            "5. Consider the output correct if it faithfully represents the resume or job description’s main information."
                        ],
                        params=["actual_output"],

                    )
                ],
                chance=.3
            )
  1. Schema Evaluation
    client.maybe_text_eval_background(
                component="ocr",
                data=[
                    TextInputItem(

                        id="runtime evaluation", # identifiar (that can be unique). use same id in case you want to follow performance over time
                        input="...", # input given to ai component
                        output="...", # output of the ai component
                        # optional args/ condtional based on metrics passed
                        expected_output=["..."],
                        retrieval_context=[
                            ["..."]
                        ]

                    )
                ],
                metrics=[
                    ToxicityConfig(
                        # model="gpt-4.1",
                        threshold=0.2,
                        include_reason=False
                    ),
                    CorrectnessConfig(
                        steps=[
                            "You are evaluating text extracted from resumes and job descriptions using OCR.",
                            "1. Verify that the extracted text is coherent and free of major corruption (e.g., broken words, random characters).",
                            "2. Check whether key resume/job-related fields are preserved correctly (e.g., name, job title, skills, education, experience, company name, job requirements).",
                            "3. Ensure that important details are not missing or replaced with irrelevant content.",
                            "4. Ignore minor formatting issues (line breaks, spacing) as long as the information is readable and accurate.",
                            "5. Consider the output correct if it faithfully represents the resume or job description’s main information."
                        ],
                        params=["actual_output"],

                    )
                ],
                chance=.3
            )

Configuration

The client can be configured in multiple ways:

Directly via constructor arguments

DeepEvalClient(base_url="http://api", api_token="123")

Environment variables

export EVALFRAMWORK_URL=http://api
export EVALFRAMWORK_API_KEY=123

Settings module

import settings # it can be django settings e.g.: from django.conf import settings
client = DeepEvalClient(settings_module=settings)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rakam_eval_sdk-0.1.16.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rakam_eval_sdk-0.1.16-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file rakam_eval_sdk-0.1.16.tar.gz.

File metadata

  • Download URL: rakam_eval_sdk-0.1.16.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.6

File hashes

Hashes for rakam_eval_sdk-0.1.16.tar.gz
Algorithm Hash digest
SHA256 5d620abc6abb7bd7e927fab86e0b227cf0cb232bfde031e7cc86bfb8ae98d46c
MD5 5eec6cfaec7b635773ad8f5f8fc0bb78
BLAKE2b-256 6f338c871a7c54e3ef4f4a862034f4cc92bff691dd5c0a3ffe7c1e752bcbcf11

See more details on using hashes here.

File details

Details for the file rakam_eval_sdk-0.1.16-py3-none-any.whl.

File metadata

File hashes

Hashes for rakam_eval_sdk-0.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 91d95a63f693aae41f4f3ed8567540e85283b2cd1f7047f142bc670e6d22a83b
MD5 389c6ea56f3d097c1679c8d752a33caf
BLAKE2b-256 74ec398fc2ea0e475f0f99f9f909c4e810f0130f55281c118b7ede3a333e6759

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page