diff --git a/apps/opik-documentation/documentation/docs/cookbook/evaluate_hallucination_metric.ipynb b/apps/opik-documentation/documentation/docs/cookbook/evaluate_hallucination_metric.ipynb index f2ecdf6f77..90a057444a 100644 --- a/apps/opik-documentation/documentation/docs/cookbook/evaluate_hallucination_metric.ipynb +++ b/apps/opik-documentation/documentation/docs/cookbook/evaluate_hallucination_metric.ipynb @@ -26,7 +26,7 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install opik pyarrow fsspec huggingface_hub --upgrade" + "%pip install opik pyarrow fsspec huggingface_hub --upgrade --quiet" ] }, { @@ -51,7 +51,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -98,8 +98,8 @@ " {\n", " \"input\": x[\"question\"],\n", " \"context\": [x[\"passage\"]],\n", - " \"output\": x[\"answer\"],\n", - " \"expected_output\": x[\"label\"],\n", + " \"llm_output\": x[\"answer\"],\n", + " \"expected_hallucination_label\": x[\"label\"],\n", " }\n", " for x in df.to_dict(orient=\"records\")\n", "]\n", @@ -139,7 +139,7 @@ " metric = Hallucination()\n", " try:\n", " metric_score = metric.score(\n", - " input=x[\"input\"], context=x[\"context\"], output=x[\"output\"]\n", + " input=x[\"input\"], context=x[\"context\"], output=x[\"llm_output\"]\n", " )\n", " hallucination_score = metric_score.value\n", " hallucination_reason = metric_score.reason\n", @@ -149,9 +149,8 @@ " hallucination_reason = str(e)\n", "\n", " return {\n", - " \"output\": \"FAIL\" if hallucination_score == 1 else \"PASS\",\n", + " \"hallucination_score\": \"FAIL\" if hallucination_score == 1 else \"PASS\",\n", " \"hallucination_reason\": hallucination_reason,\n", - " \"reference\": x[\"expected_output\"],\n", " }\n", "\n", "\n", @@ -174,6 +173,10 @@ " task=evaluation_task,\n", " scoring_metrics=[check_hallucinated_metric],\n", " experiment_config=experiment_config,\n", + " scoring_key_mapping={\n", + " \"reference\": \"expected_hallucination_label\",\n", + " \"output\": \"hallucination_score\",\n", + " },\n", ")" ] }, diff --git a/apps/opik-documentation/documentation/docs/cookbook/evaluate_hallucination_metric.md b/apps/opik-documentation/documentation/docs/cookbook/evaluate_hallucination_metric.md index a5978a2894..c8c9d46902 100644 --- a/apps/opik-documentation/documentation/docs/cookbook/evaluate_hallucination_metric.md +++ b/apps/opik-documentation/documentation/docs/cookbook/evaluate_hallucination_metric.md @@ -10,7 +10,7 @@ For this guide we will be evaluating the Hallucination metric included in the LL ```python -%pip install opik pyarrow fsspec huggingface_hub --upgrade +%pip install opik pyarrow fsspec huggingface_hub --upgrade --quiet ``` @@ -60,8 +60,8 @@ dataset_records = [ { "input": x["question"], "context": [x["passage"]], - "output": x["answer"], - "expected_output": x["label"], + "llm_output": x["answer"], + "expected_hallucination_label": x["label"], } for x in df.to_dict(orient="records") ] @@ -92,7 +92,7 @@ def evaluation_task(x: Dict): metric = Hallucination() try: metric_score = metric.score( - input=x["input"], context=x["context"], output=x["output"] + input=x["input"], context=x["context"], output=x["llm_output"] ) hallucination_score = metric_score.value hallucination_reason = metric_score.reason @@ -102,9 +102,8 @@ def evaluation_task(x: Dict): hallucination_reason = str(e) return { - "output": "FAIL" if hallucination_score == 1 else "PASS", - "hallucination_reason": hallucination_reason, - "reference": x["expected_output"], + "hallucination_score": "FAIL" if hallucination_score == 1 else "PASS", + "hallucination_reason": hallucination_reason } @@ -127,6 +126,7 @@ res = evaluate( task=evaluation_task, scoring_metrics=[check_hallucinated_metric], experiment_config=experiment_config, + scoring_key_mapping={"reference": "expected_hallucination_label", "output": "hallucination_score"}, ) ``` diff --git a/apps/opik-documentation/documentation/docs/cookbook/evaluate_moderation_metric.ipynb b/apps/opik-documentation/documentation/docs/cookbook/evaluate_moderation_metric.ipynb index d866945044..526d9d2a77 100644 --- a/apps/opik-documentation/documentation/docs/cookbook/evaluate_moderation_metric.ipynb +++ b/apps/opik-documentation/documentation/docs/cookbook/evaluate_moderation_metric.ipynb @@ -51,7 +51,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -142,6 +142,7 @@ "from opik.evaluation.metrics.llm_judges.moderation.template import generate_query\n", "from typing import Dict\n", "\n", + "\n", "# Define the evaluation task\n", "def evaluation_task(x: Dict):\n", " metric = Moderation()\n", @@ -157,10 +158,8 @@ " moderation_score = \"moderated\" if metric_score.value > 0.5 else \"not_moderated\"\n", "\n", " return {\n", - " \"output\": moderation_score,\n", " \"moderation_score\": moderation_score,\n", " \"moderation_reason\": moderation_reason,\n", - " \"reference\": x[\"expected_output\"],\n", " }\n", "\n", "\n", @@ -181,6 +180,7 @@ " task=evaluation_task,\n", " scoring_metrics=[moderation_metric],\n", " experiment_config=experiment_config,\n", + " scoring_key_mapping={\"reference\": \"expected_output\", \"output\": \"moderation_score\"},\n", ")" ] }, diff --git a/apps/opik-documentation/documentation/docs/cookbook/evaluate_moderation_metric.md b/apps/opik-documentation/documentation/docs/cookbook/evaluate_moderation_metric.md index 8d5c23bf82..15e6b94bf8 100644 --- a/apps/opik-documentation/documentation/docs/cookbook/evaluate_moderation_metric.md +++ b/apps/opik-documentation/documentation/docs/cookbook/evaluate_moderation_metric.md @@ -110,10 +110,8 @@ def evaluation_task(x: Dict): moderation_score = "moderated" if metric_score.value > 0.5 else "not_moderated" return { - "output": moderation_score, "moderation_score": moderation_score, "moderation_reason": moderation_reason, - "reference": x["expected_output"], } @@ -134,6 +132,7 @@ res = evaluate( task=evaluation_task, scoring_metrics=[moderation_metric], experiment_config=experiment_config, + scoring_key_mapping={"reference": "expected_output", "output": "moderation_score"}, ) ``` diff --git a/apps/opik-documentation/documentation/docs/cookbook/langchain.ipynb b/apps/opik-documentation/documentation/docs/cookbook/langchain.ipynb index 86d50225a3..b9798ec2c7 100644 --- a/apps/opik-documentation/documentation/docs/cookbook/langchain.ipynb +++ b/apps/opik-documentation/documentation/docs/cookbook/langchain.ipynb @@ -28,18 +28,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.3.1\u001b[0m\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", + "Note: you may need to restart the kernel to use updated packages.\n" + ] + } + ], "source": [ "%pip install --upgrade --quiet opik langchain langchain-community langchain-openai" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "OPIK: Opik is already configured. You can check the settings by viewing the config file at /Users/jacquesverre/.opik.config\n" + ] + } + ], "source": [ "import opik\n", "\n", @@ -57,7 +76,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -72,7 +91,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -113,9 +132,47 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "OPIK: Started logging traces to the \"langchain-integration-demo\" project at https://www.comet.com/opik/jacques-comet/redirect/projects?name=langchain-integration-demo.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\n", + " \"result\": [\n", + " \"Which customer has made the largest total purchases in terms of dollar amount?\",\n", + " \"How many unique genres are available in the Chinook database?\",\n", + " \"What is the average total number of tracks in an album?\",\n", + " \"Which employee has the highest total sales amount and how does it compare to other employees?\",\n", + " \"What is the average revenue generated by each genre in the database?\",\n", + " \"Which customer has spent the most money on individual tracks instead of full albums?\",\n", + " \"What percentage of total sales does each customer account for?\",\n", + " \"How many unique artists are featured in the database?\",\n", + " \"Which genre has the highest average track length?\",\n", + " \"How does the average track length vary between different artists?\",\n", + " \"What is the average track length for each genre?\",\n", + " \"What is the average number of tracks purchased per invoice?\",\n", + " \"Which customer has the most diverse taste in music based on the number of unique genres purchased?\",\n", + " \"What is the average time between purchases for each customer?\",\n", + " \"How does the average purchase amount change over time?\",\n", + " \"Which customers have purchased from all genres available in the database?\",\n", + " \"What is the total revenue generated from each playlist?\",\n", + " \"What is the most popular track based on total number of purchases?\",\n", + " \"How does the average number of tracks in an album differ between different artists?\",\n", + " \"What is the distribution of sales by country?\"\n", + " ]\n", + "}\n" + ] + } + ], "source": [ "from opik.integrations.openai import track_openai\n", "from openai import OpenAI\n", @@ -152,7 +209,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -180,9 +237,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "OPIK: Started logging traces to the \"langchain-integration-demo\" project at https://www.comet.com/opik/jacques-comet/redirect/projects?name=langchain-integration-demo.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "SELECT COUNT(\"EmployeeId\") AS \"TotalEmployees\" FROM \"Employee\"\n" + ] + } + ], "source": [ "# Use langchain to create a SQL query to answer the question\n", "from langchain.chains import create_sql_query_chain\n", @@ -212,9 +284,70 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Evaluation: 100%|██████████| 20/20 [00:03<00:00, 5.39it/s]\n" + ] + }, + { + "data": { + "text/html": [ + "
╭─ synthetic_questions (20 samples) ─╮\n", + "│ │\n", + "│ Total time: 00:00:03 │\n", + "│ Number of samples: 20 │\n", + "│ │\n", + "│ valid_sql_query: 0.9500 (avg) │\n", + "│ │\n", + "╰────────────────────────────────────╯\n", + "\n" + ], + "text/plain": [ + "╭─ synthetic_questions (20 samples) ─╮\n", + "│ │\n", + "│ \u001b[1mTotal time: \u001b[0m 00:00:03 │\n", + "│ \u001b[1mNumber of samples:\u001b[0m 20 │\n", + "│ │\n", + "│ \u001b[1;32mvalid_sql_query: 0.9500 (avg)\u001b[0m │\n", + "│ │\n", + "╰────────────────────────────────────╯\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
Uploading results to Opik ... \n",
+ "
\n"
+ ],
+ "text/plain": [
+ "Uploading results to Opik \u001b[33m...\u001b[0m \n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "View the results in your Opik dashboard.\n", + "\n" + ], + "text/plain": [ + "View the results \u001b]8;id=611380;https://www.comet.com/opik/jacques-comet/experiments/0191e8b3-9c3c-7998-b5af-01e4a3e5e2c7/compare?experiments=%5B%2206740861-c1e7-7f5e-8000-b22ad440a7c3%22%5D\u001b\\in your Opik dashboard\u001b]8;;\u001b\\.\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "from opik import Opik, track\n", "from opik.evaluation import evaluate\n", @@ -255,7 +388,7 @@ "def evaluation_task(item):\n", " response = llm_chain(item[\"question\"])\n", "\n", - " return {\"reference\": \"hello\", \"output\": response}\n", + " return {\"output\": response}\n", "\n", "\n", "res = evaluate(\n", diff --git a/apps/opik-documentation/documentation/docs/cookbook/langchain.md b/apps/opik-documentation/documentation/docs/cookbook/langchain.md index 1ecb2c5eb2..e7b403c938 100644 --- a/apps/opik-documentation/documentation/docs/cookbook/langchain.md +++ b/apps/opik-documentation/documentation/docs/cookbook/langchain.md @@ -19,6 +19,12 @@ We will highlight three different parts of the workflow: %pip install --upgrade --quiet opik langchain langchain-community langchain-openai ``` + + [1m[[0m[34;49mnotice[0m[1;39;49m][0m[39;49m A new release of pip is available: [0m[31;49m24.2[0m[39;49m -> [0m[32;49m24.3.1[0m + [1m[[0m[34;49mnotice[0m[1;39;49m][0m[39;49m To update, run: [0m[32;49mpip install --upgrade pip[0m + Note: you may need to restart the kernel to use updated packages. + + ```python import opik @@ -26,6 +32,9 @@ import opik opik.configure(use_local=False) ``` + OPIK: Opik is already configured. You can check the settings by viewing the config file at /Users/jacquesverre/.opik.config + + ## Preparing our environment First, we will download the Chinook database and set up our different API keys. @@ -99,6 +108,35 @@ completion = openai_client.chat.completions.create( print(completion.choices[0].message.content) ``` + OPIK: Started logging traces to the "langchain-integration-demo" project at https://www.comet.com/opik/jacques-comet/redirect/projects?name=langchain-integration-demo. + + + { + "result": [ + "Which customer has made the largest total purchases in terms of dollar amount?", + "How many unique genres are available in the Chinook database?", + "What is the average total number of tracks in an album?", + "Which employee has the highest total sales amount and how does it compare to other employees?", + "What is the average revenue generated by each genre in the database?", + "Which customer has spent the most money on individual tracks instead of full albums?", + "What percentage of total sales does each customer account for?", + "How many unique artists are featured in the database?", + "Which genre has the highest average track length?", + "How does the average track length vary between different artists?", + "What is the average track length for each genre?", + "What is the average number of tracks purchased per invoice?", + "Which customer has the most diverse taste in music based on the number of unique genres purchased?", + "What is the average time between purchases for each customer?", + "How does the average purchase amount change over time?", + "Which customers have purchased from all genres available in the database?", + "What is the total revenue generated from each playlist?", + "What is the most popular track based on total number of purchases?", + "How does the average number of tracks in an album differ between different artists?", + "What is the distribution of sales by country?" + ] + } + + Now that we have our synthetic dataset, we can create a dataset in Comet and insert the questions into it. Since the insert methods in the SDK deduplicates items, we can insert 20 items and if the items already exist, Opik will automatically remove them. @@ -139,6 +177,12 @@ response print(response) ``` + OPIK: Started logging traces to the "langchain-integration-demo" project at https://www.comet.com/opik/jacques-comet/redirect/projects?name=langchain-integration-demo. + + + SELECT COUNT("EmployeeId") AS "TotalEmployees" FROM "Employee" + + ## Automating the evaluation In order to ensure our LLM application is working correctly, we will test it on our synthetic dataset. @@ -186,7 +230,7 @@ def llm_chain(input: str) -> str: def evaluation_task(item): response = llm_chain(item["question"]) - return {"reference": "hello", "output": response} + return {"output": response} res = evaluate( @@ -198,6 +242,34 @@ res = evaluate( ) ``` + Evaluation: 100%|██████████| 20/20 [00:03<00:00, 5.39it/s] + + + +
╭─ synthetic_questions (20 samples) ─╮ +│ │ +│ Total time: 00:00:03 │ +│ Number of samples: 20 │ +│ │ +│ valid_sql_query: 0.9500 (avg) │ +│ │ +╰────────────────────────────────────╯ ++ + + + +
Uploading results to Opik ...
+
+
+
+
+
+View the results in your Opik dashboard. ++ + + The evaluation results are now uploaded to the Opik platform and can be viewed in the UI. ![LangChain Evaluation](https://raw.githubusercontent.com/comet-ml/opik/main/apps/opik-documentation/documentation/static/img/cookbook/langchain_cookbook.png) diff --git a/apps/opik-documentation/documentation/docs/cookbook/quickstart_notebook.ipynb b/apps/opik-documentation/documentation/docs/cookbook/quickstart_notebook.ipynb index f2fec09d63..7ee87f6658 100644 --- a/apps/opik-documentation/documentation/docs/cookbook/quickstart_notebook.ipynb +++ b/apps/opik-documentation/documentation/docs/cookbook/quickstart_notebook.ipynb @@ -29,19 +29,16 @@ "name": "stdout", "output_type": "stream", "text": [ - "Requirement already satisfied: opik in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (1.1.4)\n", - "Collecting opik\n", - " Downloading opik-1.1.6-py3-none-any.whl.metadata (18 kB)\n", - "Requirement already satisfied: openai in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (1.52.1)\n", + "Requirement already satisfied: opik in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (1.1.10)\n", + "Requirement already satisfied: openai in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (1.54.4)\n", "Collecting openai\n", - " Downloading openai-1.54.4-py3-none-any.whl.metadata (24 kB)\n", + " Downloading openai-1.55.0-py3-none-any.whl.metadata (24 kB)\n", "Requirement already satisfied: requests in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (2.32.3)\n", "Requirement already satisfied: PyPDF2 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (3.0.1)\n", "Requirement already satisfied: click in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (8.1.7)\n", "Requirement already satisfied: httpx<1.0.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (0.27.2)\n", "Requirement already satisfied: levenshtein~=0.25.1 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (0.25.1)\n", "Requirement already satisfied: litellm in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (1.51.2)\n", - "Requirement already satisfied: pandas<3.0.0,>=2.0.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (2.2.2)\n", "Requirement already satisfied: pydantic-settings<3.0.0,>=2.0.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (2.4.0)\n", "Requirement already satisfied: pydantic<3.0.0,>=2.0.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (2.8.2)\n", "Requirement already satisfied: pytest in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (8.3.2)\n", @@ -60,10 +57,6 @@ "Requirement already satisfied: httpcore==1.* in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from httpx<1.0.0->opik) (1.0.5)\n", "Requirement already satisfied: h11<0.15,>=0.13 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from httpcore==1.*->httpx<1.0.0->opik) (0.14.0)\n", "Requirement already satisfied: rapidfuzz<4.0.0,>=3.8.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from levenshtein~=0.25.1->opik) (3.9.6)\n", - "Requirement already satisfied: numpy>=1.26.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pandas<3.0.0,>=2.0.0->opik) (1.26.4)\n", - "Requirement already satisfied: python-dateutil>=2.8.2 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pandas<3.0.0,>=2.0.0->opik) (2.9.0)\n", - "Requirement already satisfied: pytz>=2020.1 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pandas<3.0.0,>=2.0.0->opik) (2024.1)\n", - "Requirement already satisfied: tzdata>=2022.7 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pandas<3.0.0,>=2.0.0->opik) (2024.1)\n", "Requirement already satisfied: annotated-types>=0.4.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pydantic<3.0.0,>=2.0.0->opik) (0.7.0)\n", "Requirement already satisfied: pydantic-core==2.20.1 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pydantic<3.0.0,>=2.0.0->opik) (2.20.1)\n", "Requirement already satisfied: python-dotenv>=0.21.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pydantic-settings<3.0.0,>=2.0.0->opik) (1.0.1)\n", @@ -85,7 +78,6 @@ "Requirement already satisfied: referencing>=0.28.4 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from jsonschema<5.0.0,>=4.22.0->litellm->opik) (0.35.1)\n", "Requirement already satisfied: rpds-py>=0.7.1 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from jsonschema<5.0.0,>=4.22.0->litellm->opik) (0.20.0)\n", "Requirement already satisfied: mdurl~=0.1 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from markdown-it-py>=2.2.0->rich->opik) (0.1.2)\n", - "Requirement already satisfied: six>=1.5 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas<3.0.0,>=2.0.0->opik) (1.16.0)\n", "Requirement already satisfied: regex>=2022.1.18 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from tiktoken>=0.7.0->litellm->opik) (2024.7.24)\n", "Requirement already satisfied: aiohappyeyeballs>=2.3.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from aiohttp->litellm->opik) (2.3.5)\n", "Requirement already satisfied: aiosignal>=1.1.2 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from aiohttp->litellm->opik) (1.3.1)\n", @@ -97,20 +89,15 @@ "Requirement already satisfied: fsspec>=2023.5.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers->litellm->opik) (2024.10.0)\n", "Requirement already satisfied: pyyaml>=5.1 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers->litellm->opik) (6.0.2)\n", "Requirement already satisfied: propcache>=0.2.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from yarl<2.0,>=1.12.0->aiohttp->litellm->opik) (0.2.0)\n", - "Downloading opik-1.1.6-py3-none-any.whl (240 kB)\n", - "Downloading openai-1.54.4-py3-none-any.whl (389 kB)\n", - "Installing collected packages: openai, opik\n", + "Downloading openai-1.55.0-py3-none-any.whl (389 kB)\n", + "Installing collected packages: openai\n", " Attempting uninstall: openai\n", - " Found existing installation: openai 1.52.1\n", - " Uninstalling openai-1.52.1:\n", - " Successfully uninstalled openai-1.52.1\n", - " Attempting uninstall: opik\n", - " Found existing installation: opik 1.1.4\n", - " Uninstalling opik-1.1.4:\n", - " Successfully uninstalled opik-1.1.4\n", + " Found existing installation: openai 1.54.4\n", + " Uninstalling openai-1.54.4:\n", + " Successfully uninstalled openai-1.54.4\n", "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", "predibase 2024.9.3 requires urllib3==1.26.12, but you have urllib3 2.2.3 which is incompatible.\u001b[0m\u001b[31m\n", - "\u001b[0mSuccessfully installed openai-1.54.4 opik-1.1.6\n", + "\u001b[0mSuccessfully installed openai-1.55.0\n", "\n", "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.3.1\u001b[0m\n", "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", @@ -119,7 +106,7 @@ } ], "source": [ - "%pip install -U opik openai requests PyPDF2" + "%pip install -U opik openai requests PyPDF2 --quiet" ] }, { @@ -134,7 +121,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -167,7 +154,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -209,7 +196,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -296,7 +283,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -310,8 +297,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Sure! Please provide the current summary and the instruction you'd like me to\n", - "focus on, and I'll create the concise final summary for you.\n" + "Please provide the current summary and the specific instruction you would like\n", + "me to focus on for the final summary.\n" ] } ], @@ -357,7 +344,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -430,13 +417,76 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ "from opik.evaluation.metrics import base_metric, score_result\n", "import json\n", "\n", + "# We will define the response format so the output has the correct schema. You can also use structured outputs with Pydantic models for this.\n", + "json_schema = {\n", + " \"type\": \"json_schema\",\n", + " \"json_schema\": {\n", + " \"name\": \"summary_evaluation_schema\",\n", + " \"schema\": {\n", + " \"type\": \"object\",\n", + " \"properties\": {\n", + " \"relevance\": {\n", + " \"type\": \"object\",\n", + " \"properties\": {\n", + " \"score\": {\n", + " \"type\": \"integer\",\n", + " \"minimum\": 1,\n", + " \"maximum\": 5,\n", + " \"description\": \"Score between 1-5 for how well the summary addresses the instruction\",\n", + " },\n", + " \"explanation\": {\n", + " \"type\": \"string\",\n", + " \"description\": \"Brief explanation of the relevance score\",\n", + " },\n", + " },\n", + " \"required\": [\"score\", \"explanation\"],\n", + " },\n", + " \"conciseness\": {\n", + " \"type\": \"object\",\n", + " \"properties\": {\n", + " \"score\": {\n", + " \"type\": \"integer\",\n", + " \"minimum\": 1,\n", + " \"maximum\": 5,\n", + " \"description\": \"Score between 1-5 for how concise the summary is while retaining key information\",\n", + " },\n", + " \"explanation\": {\n", + " \"type\": \"string\",\n", + " \"description\": \"Brief explanation of the conciseness score\",\n", + " },\n", + " },\n", + " \"required\": [\"score\", \"explanation\"],\n", + " },\n", + " \"technical_accuracy\": {\n", + " \"type\": \"object\",\n", + " \"properties\": {\n", + " \"score\": {\n", + " \"type\": \"integer\",\n", + " \"minimum\": 1,\n", + " \"maximum\": 5,\n", + " \"description\": \"Score between 1-5 for how accurately the summary conveys technical details\",\n", + " },\n", + " \"explanation\": {\n", + " \"type\": \"string\",\n", + " \"description\": \"Brief explanation of the technical accuracy score\",\n", + " },\n", + " },\n", + " \"required\": [\"score\", \"explanation\"],\n", + " },\n", + " },\n", + " \"required\": [\"relevance\", \"conciseness\", \"technical_accuracy\"],\n", + " \"additionalProperties\": False,\n", + " },\n", + " },\n", + "}\n", + "\n", "\n", "# Custom Metric: One template/prompt to extract 4 scores/results\n", "class EvaluateSummary(base_metric.BaseMetric):\n", @@ -476,7 +526,10 @@ " \"\"\"\n", "\n", " response = openai_client.chat.completions.create(\n", - " model=model, max_tokens=1000, messages=[{\"role\": \"user\", \"content\": prompt}]\n", + " model=model,\n", + " max_tokens=1000,\n", + " messages=[{\"role\": \"user\", \"content\": prompt}],\n", + " response_format=json_schema,\n", " )\n", "\n", " eval_dict = json.loads(response.choices[0].message.content)\n", @@ -516,7 +569,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ @@ -559,7 +612,7 @@ " density_iterations=density_iterations,\n", " )\n", "\n", - " return {\"summary\": result, \"instruction\": instruction}" + " return {\"summary\": result}" ] }, { @@ -578,82 +631,14 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "Evaluation: 11%|█ | 2/18 [00:09<01:00, 3.77s/it]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed.\n", - "Traceback (most recent call last):\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py\", line 29, in _score_test_case\n", - " result = metric.score(**score_kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py\", line 46, in score\n", - " eval_dict = json.loads(response.choices[0].message.content)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py\", line 346, in loads\n", - " return _default_decoder.decode(s)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 337, in decode\n", - " obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 355, in raw_decode\n", - " raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n", - "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n", - "Evaluation: 22%|██▏ | 4/18 [00:09<00:21, 1.50s/it]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed.\n", - "Traceback (most recent call last):\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py\", line 29, in _score_test_case\n", - " result = metric.score(**score_kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py\", line 46, in score\n", - " eval_dict = json.loads(response.choices[0].message.content)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py\", line 346, in loads\n", - " return _default_decoder.decode(s)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 337, in decode\n", - " obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 355, in raw_decode\n", - " raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n", - "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n", - "Evaluation: 61%|██████ | 11/18 [00:12<00:03, 1.76it/s]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed.\n", - "Traceback (most recent call last):\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py\", line 29, in _score_test_case\n", - " result = metric.score(**score_kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py\", line 46, in score\n", - " eval_dict = json.loads(response.choices[0].message.content)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py\", line 346, in loads\n", - " return _default_decoder.decode(s)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 337, in decode\n", - " obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 355, in raw_decode\n", - " raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n", - "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n", - "Evaluation: 78%|███████▊ | 14/18 [00:13<00:01, 2.06it/s]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed.\n", - "Traceback (most recent call last):\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py\", line 29, in _score_test_case\n", - " result = metric.score(**score_kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py\", line 46, in score\n", - " eval_dict = json.loads(response.choices[0].message.content)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py\", line 346, in loads\n", - " return _default_decoder.decode(s)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 337, in decode\n", - " obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 355, in raw_decode\n", - " raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n", - "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n", - "Evaluation: 100%|██████████| 18/18 [00:31<00:00, 1.73s/it]\n" + "Evaluation: 100%|██████████| 18/18 [00:25<00:00, 1.44s/it]\n" ] }, { @@ -661,14 +646,13 @@ "text/html": [ "
╭─ arXiv Papers (18 samples) ──────────────╮\n", "│ │\n", - "│ Total time: 00:00:31 │\n", + "│ Total time: 00:00:26 │\n", "│ Number of samples: 18 │\n", "│ │\n", - "│ summary_relevance: 2.2857 (avg) │\n", - "│ summary_conciseness: 3.8571 (avg) │\n", - "│ summary_technical_accuracy: 1.7143 (avg) │\n", - "│ summary_average_score: 2.6179 (avg) │\n", - "│ summary-metrics: None (avg) - 4 failed │\n", + "│ summary_relevance: 1.1111 (avg) │\n", + "│ summary_conciseness: 3.0000 (avg) │\n", + "│ summary_technical_accuracy: 1.0000 (avg) │\n", + "│ summary_average_score: 1.7028 (avg) │\n", "│ │\n", "╰──────────────────────────────────────────╯\n", "\n" @@ -676,14 +660,13 @@ "text/plain": [ "╭─ arXiv Papers (18 samples) ──────────────╮\n", "│ │\n", - "│ \u001b[1mTotal time: \u001b[0m 00:00:31 │\n", + "│ \u001b[1mTotal time: \u001b[0m 00:00:26 │\n", "│ \u001b[1mNumber of samples:\u001b[0m 18 │\n", "│ │\n", - "│ \u001b[1;32msummary_relevance: 2.2857 (avg)\u001b[0m │\n", - "│ \u001b[1;32msummary_conciseness: 3.8571 (avg)\u001b[0m │\n", - "│ \u001b[1;32msummary_technical_accuracy: 1.7143 (avg)\u001b[0m │\n", - "│ \u001b[1;32msummary_average_score: 2.6179 (avg)\u001b[0m │\n", - "│ \u001b[1;32msummary-metrics: None (avg)\u001b[0m\u001b[31m - 4 failed\u001b[0m │\n", + "│ \u001b[1;32msummary_relevance: 1.1111 (avg)\u001b[0m │\n", + "│ \u001b[1;32msummary_conciseness: 3.0000 (avg)\u001b[0m │\n", + "│ \u001b[1;32msummary_technical_accuracy: 1.0000 (avg)\u001b[0m │\n", + "│ \u001b[1;32msummary_average_score: 1.7028 (avg)\u001b[0m │\n", "│ │\n", "╰──────────────────────────────────────────╯\n" ] @@ -707,11 +690,11 @@ { "data": { "text/html": [ - "
View the results in your Opik dashboard.\n", + "View the results in your Opik dashboard.\n", "\n" ], "text/plain": [ - "View the results \u001b]8;id=101485;https://www.comet.com/opik/jacques-comet/experiments/0192ba83-4a5c-779b-bf51-48562b767f33/compare?experiments=%5B%220673a117-287d-7fa0-8000-ff425976bd5e%22%5D\u001b\\in your Opik dashboard\u001b]8;;\u001b\\.\n" + "View the results \u001b]8;id=136665;https://www.comet.com/opik/jacques-comet/experiments/0192ba83-4a5c-779b-bf51-48562b767f33/compare?experiments=%5B%2206740816-d7fa-7051-8000-806a033848a8%22%5D\u001b\\in your Opik dashboard\u001b]8;;\u001b\\.\n" ] }, "metadata": {}, @@ -762,7 +745,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ @@ -788,133 +771,14 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 24, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "Evaluation: 11%|█ | 2/18 [00:05<00:41, 2.62s/it]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed.\n", - "Traceback (most recent call last):\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py\", line 29, in _score_test_case\n", - " result = metric.score(**score_kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py\", line 46, in score\n", - " eval_dict = json.loads(response.choices[0].message.content)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py\", line 346, in loads\n", - " return _default_decoder.decode(s)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 337, in decode\n", - " obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 355, in raw_decode\n", - " raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n", - "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n", - "Evaluation: 17%|█▋ | 3/18 [00:06<00:27, 1.81s/it]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed.\n", - "Traceback (most recent call last):\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py\", line 29, in _score_test_case\n", - " result = metric.score(**score_kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py\", line 46, in score\n", - " eval_dict = json.loads(response.choices[0].message.content)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py\", line 346, in loads\n", - " return _default_decoder.decode(s)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 337, in decode\n", - " obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 355, in raw_decode\n", - " raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n", - "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n", - "Evaluation: 22%|██▏ | 4/18 [00:07<00:17, 1.28s/it]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed.\n", - "Traceback (most recent call last):\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py\", line 29, in _score_test_case\n", - " result = metric.score(**score_kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py\", line 46, in score\n", - " eval_dict = json.loads(response.choices[0].message.content)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py\", line 346, in loads\n", - " return _default_decoder.decode(s)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 337, in decode\n", - " obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 355, in raw_decode\n", - " raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n", - "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n", - "Evaluation: 39%|███▉ | 7/18 [00:07<00:05, 1.94it/s]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed.\n", - "Traceback (most recent call last):\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py\", line 29, in _score_test_case\n", - " result = metric.score(**score_kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py\", line 46, in score\n", - " eval_dict = json.loads(response.choices[0].message.content)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py\", line 346, in loads\n", - " return _default_decoder.decode(s)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 337, in decode\n", - " obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 355, in raw_decode\n", - " raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n", - "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n", - "Evaluation: 56%|█████▌ | 10/18 [00:10<00:06, 1.22it/s]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed.\n", - "Traceback (most recent call last):\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py\", line 29, in _score_test_case\n", - " result = metric.score(**score_kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py\", line 46, in score\n", - " eval_dict = json.loads(response.choices[0].message.content)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py\", line 346, in loads\n", - " return _default_decoder.decode(s)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 337, in decode\n", - " obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 355, in raw_decode\n", - " raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n", - "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n", - "Evaluation: 78%|███████▊ | 14/18 [00:11<00:01, 2.58it/s]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed.\n", - "Traceback (most recent call last):\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py\", line 29, in _score_test_case\n", - " result = metric.score(**score_kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py\", line 46, in score\n", - " eval_dict = json.loads(response.choices[0].message.content)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py\", line 346, in loads\n", - " return _default_decoder.decode(s)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 337, in decode\n", - " obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 355, in raw_decode\n", - " raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n", - "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n", - "Evaluation: 83%|████████▎ | 15/18 [00:11<00:01, 2.45it/s]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed.\n", - "Traceback (most recent call last):\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py\", line 29, in _score_test_case\n", - " result = metric.score(**score_kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py\", line 46, in score\n", - " eval_dict = json.loads(response.choices[0].message.content)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py\", line 346, in loads\n", - " return _default_decoder.decode(s)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 337, in decode\n", - " obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py\", line 355, in raw_decode\n", - " raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n", - "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n", - "Evaluation: 100%|██████████| 18/18 [00:23<00:00, 1.33s/it]\n" + "Evaluation: 100%|██████████| 18/18 [00:24<00:00, 1.37s/it]\n" ] }, { @@ -922,14 +786,13 @@ "text/html": [ "╭─ arXiv Papers (18 samples) ──────────────╮\n", "│ │\n", - "│ Total time: 00:00:24 │\n", + "│ Total time: 00:00:25 │\n", "│ Number of samples: 18 │\n", "│ │\n", - "│ summary_relevance: 1.5455 (avg) │\n", - "│ summary_conciseness: 4.5455 (avg) │\n", - "│ summary_technical_accuracy: 1.4545 (avg) │\n", - "│ summary_average_score: 2.5136 (avg) │\n", - "│ summary-metrics: None (avg) - 7 failed │\n", + "│ summary_relevance: 1.0000 (avg) │\n", + "│ summary_conciseness: 2.8333 (avg) │\n", + "│ summary_technical_accuracy: 1.0000 (avg) │\n", + "│ summary_average_score: 1.6094 (avg) │\n", "│ │\n", "╰──────────────────────────────────────────╯\n", "\n" @@ -937,14 +800,13 @@ "text/plain": [ "╭─ arXiv Papers (18 samples) ──────────────╮\n", "│ │\n", - "│ \u001b[1mTotal time: \u001b[0m 00:00:24 │\n", + "│ \u001b[1mTotal time: \u001b[0m 00:00:25 │\n", "│ \u001b[1mNumber of samples:\u001b[0m 18 │\n", "│ │\n", - "│ \u001b[1;32msummary_relevance: 1.5455 (avg)\u001b[0m │\n", - "│ \u001b[1;32msummary_conciseness: 4.5455 (avg)\u001b[0m │\n", - "│ \u001b[1;32msummary_technical_accuracy: 1.4545 (avg)\u001b[0m │\n", - "│ \u001b[1;32msummary_average_score: 2.5136 (avg)\u001b[0m │\n", - "│ \u001b[1;32msummary-metrics: None (avg)\u001b[0m\u001b[31m - 7 failed\u001b[0m │\n", + "│ \u001b[1;32msummary_relevance: 1.0000 (avg)\u001b[0m │\n", + "│ \u001b[1;32msummary_conciseness: 2.8333 (avg)\u001b[0m │\n", + "│ \u001b[1;32msummary_technical_accuracy: 1.0000 (avg)\u001b[0m │\n", + "│ \u001b[1;32msummary_average_score: 1.6094 (avg)\u001b[0m │\n", "│ │\n", "╰──────────────────────────────────────────╯\n" ] @@ -968,11 +830,11 @@ { "data": { "text/html": [ - "View the results in your Opik dashboard.\n", + "View the results in your Opik dashboard.\n", "\n" ], "text/plain": [ - "View the results \u001b]8;id=452780;https://www.comet.com/opik/jacques-comet/experiments/0192ba83-4a5c-779b-bf51-48562b767f33/compare?experiments=%5B%220673a118-c1f0-7bd0-8000-f8cd077598dd%22%5D\u001b\\in your Opik dashboard\u001b]8;;\u001b\\.\n" + "View the results \u001b]8;id=766195;https://www.comet.com/opik/jacques-comet/experiments/0192ba83-4a5c-779b-bf51-48562b767f33/compare?experiments=%5B%2206740853-e93a-7fea-8000-c9487836fcbc%22%5D\u001b\\in your Opik dashboard\u001b]8;;\u001b\\.\n" ] }, "metadata": {}, diff --git a/apps/opik-documentation/documentation/docs/cookbook/quickstart_notebook.md b/apps/opik-documentation/documentation/docs/cookbook/quickstart_notebook.md index 9d1cab0c80..305e5bb1bc 100644 --- a/apps/opik-documentation/documentation/docs/cookbook/quickstart_notebook.md +++ b/apps/opik-documentation/documentation/docs/cookbook/quickstart_notebook.md @@ -10,22 +10,19 @@ We will first install the required dependencies and configure both Opik and Open ```python -%pip install -U opik openai requests PyPDF2 +%pip install -U opik openai requests PyPDF2 --quiet ``` - Requirement already satisfied: opik in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (1.1.4) - Collecting opik - Downloading opik-1.1.6-py3-none-any.whl.metadata (18 kB) - Requirement already satisfied: openai in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (1.52.1) + Requirement already satisfied: opik in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (1.1.10) + Requirement already satisfied: openai in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (1.54.4) Collecting openai - Downloading openai-1.54.4-py3-none-any.whl.metadata (24 kB) + Downloading openai-1.55.0-py3-none-any.whl.metadata (24 kB) Requirement already satisfied: requests in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (2.32.3) Requirement already satisfied: PyPDF2 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (3.0.1) Requirement already satisfied: click in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (8.1.7) Requirement already satisfied: httpx<1.0.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (0.27.2) Requirement already satisfied: levenshtein~=0.25.1 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (0.25.1) Requirement already satisfied: litellm in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (1.51.2) - Requirement already satisfied: pandas<3.0.0,>=2.0.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (2.2.2) Requirement already satisfied: pydantic-settings<3.0.0,>=2.0.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (2.4.0) Requirement already satisfied: pydantic<3.0.0,>=2.0.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (2.8.2) Requirement already satisfied: pytest in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from opik) (8.3.2) @@ -44,10 +41,6 @@ We will first install the required dependencies and configure both Opik and Open Requirement already satisfied: httpcore==1.* in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from httpx<1.0.0->opik) (1.0.5) Requirement already satisfied: h11<0.15,>=0.13 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from httpcore==1.*->httpx<1.0.0->opik) (0.14.0) Requirement already satisfied: rapidfuzz<4.0.0,>=3.8.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from levenshtein~=0.25.1->opik) (3.9.6) - Requirement already satisfied: numpy>=1.26.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pandas<3.0.0,>=2.0.0->opik) (1.26.4) - Requirement already satisfied: python-dateutil>=2.8.2 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pandas<3.0.0,>=2.0.0->opik) (2.9.0) - Requirement already satisfied: pytz>=2020.1 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pandas<3.0.0,>=2.0.0->opik) (2024.1) - Requirement already satisfied: tzdata>=2022.7 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pandas<3.0.0,>=2.0.0->opik) (2024.1) Requirement already satisfied: annotated-types>=0.4.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pydantic<3.0.0,>=2.0.0->opik) (0.7.0) Requirement already satisfied: pydantic-core==2.20.1 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pydantic<3.0.0,>=2.0.0->opik) (2.20.1) Requirement already satisfied: python-dotenv>=0.21.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from pydantic-settings<3.0.0,>=2.0.0->opik) (1.0.1) @@ -69,7 +62,6 @@ We will first install the required dependencies and configure both Opik and Open Requirement already satisfied: referencing>=0.28.4 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from jsonschema<5.0.0,>=4.22.0->litellm->opik) (0.35.1) Requirement already satisfied: rpds-py>=0.7.1 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from jsonschema<5.0.0,>=4.22.0->litellm->opik) (0.20.0) Requirement already satisfied: mdurl~=0.1 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from markdown-it-py>=2.2.0->rich->opik) (0.1.2) - Requirement already satisfied: six>=1.5 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas<3.0.0,>=2.0.0->opik) (1.16.0) Requirement already satisfied: regex>=2022.1.18 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from tiktoken>=0.7.0->litellm->opik) (2024.7.24) Requirement already satisfied: aiohappyeyeballs>=2.3.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from aiohttp->litellm->opik) (2.3.5) Requirement already satisfied: aiosignal>=1.1.2 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from aiohttp->litellm->opik) (1.3.1) @@ -81,20 +73,15 @@ We will first install the required dependencies and configure both Opik and Open Requirement already satisfied: fsspec>=2023.5.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers->litellm->opik) (2024.10.0) Requirement already satisfied: pyyaml>=5.1 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers->litellm->opik) (6.0.2) Requirement already satisfied: propcache>=0.2.0 in /opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages (from yarl<2.0,>=1.12.0->aiohttp->litellm->opik) (0.2.0) - Downloading opik-1.1.6-py3-none-any.whl (240 kB) - Downloading openai-1.54.4-py3-none-any.whl (389 kB) - Installing collected packages: openai, opik + Downloading openai-1.55.0-py3-none-any.whl (389 kB) + Installing collected packages: openai Attempting uninstall: openai - Found existing installation: openai 1.52.1 - Uninstalling openai-1.52.1: - Successfully uninstalled openai-1.52.1 - Attempting uninstall: opik - Found existing installation: opik 1.1.4 - Uninstalling opik-1.1.4: - Successfully uninstalled opik-1.1.4 + Found existing installation: openai 1.54.4 + Uninstalling openai-1.54.4: + Successfully uninstalled openai-1.54.4 [31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. predibase 2024.9.3 requires urllib3==1.26.12, but you have urllib3 2.2.3 which is incompatible.[0m[31m - [0mSuccessfully installed openai-1.54.4 opik-1.1.6 + [0mSuccessfully installed openai-1.55.0 [1m[[0m[34;49mnotice[0m[1;39;49m][0m[39;49m A new release of pip is available: [0m[31;49m24.2[0m[39;49m -> [0m[32;49m24.3.1[0m [1m[[0m[34;49mnotice[0m[1;39;49m][0m[39;49m To update, run: [0m[32;49mpip install --upgrade pip[0m @@ -261,8 +248,8 @@ print("\n".join(textwrap.wrap(summary, width=80))) OPIK: Started logging traces to the "Default Project" project at https://www.comet.com/opik/jacques-comet/redirect/projects?name=Default%20Project. - Sure! Please provide the current summary and the instruction you'd like me to - focus on, and I'll create the concise final summary for you. + Please provide the current summary and the specific instruction you would like + me to focus on for the final summary. Thanks to the `@opik.track` decorator and Opik's integration with OpenAI, we can now track the entire chain and all the LLM calls in the Opik UI: @@ -343,6 +330,68 @@ Opik includes a [library of evaluation metrics](https://www.comet.com/docs/opik/ from opik.evaluation.metrics import base_metric, score_result import json +# We will define the response format so the output has the correct schema. You can also use structured outputs with Pydantic models for this. +json_schema = { + "type": "json_schema", + "json_schema": { + "name": "summary_evaluation_schema", + "schema": { + "type": "object", + "properties": { + "relevance": { + "type": "object", + "properties": { + "score": { + "type": "integer", + "minimum": 1, + "maximum": 5, + "description": "Score between 1-5 for how well the summary addresses the instruction" + }, + "explanation": { + "type": "string", + "description": "Brief explanation of the relevance score" + } + }, + "required": ["score", "explanation"] + }, + "conciseness": { + "type": "object", + "properties": { + "score": { + "type": "integer", + "minimum": 1, + "maximum": 5, + "description": "Score between 1-5 for how concise the summary is while retaining key information" + }, + "explanation": { + "type": "string", + "description": "Brief explanation of the conciseness score" + } + }, + "required": ["score", "explanation"] + }, + "technical_accuracy": { + "type": "object", + "properties": { + "score": { + "type": "integer", + "minimum": 1, + "maximum": 5, + "description": "Score between 1-5 for how accurately the summary conveys technical details" + }, + "explanation": { + "type": "string", + "description": "Brief explanation of the technical accuracy score" + } + }, + "required": ["score", "explanation"] + } + }, + "required": ["relevance", "conciseness", "technical_accuracy"], + "additionalProperties": False + } + } +} # Custom Metric: One template/prompt to extract 4 scores/results class EvaluateSummary(base_metric.BaseMetric): @@ -382,7 +431,7 @@ class EvaluateSummary(base_metric.BaseMetric): """ response = openai_client.chat.completions.create( - model=model, max_tokens=1000, messages=[{"role": "user", "content": prompt}] + model=model, max_tokens=1000, messages=[{"role": "user", "content": prompt}], response_format=json_schema ) eval_dict = json.loads(response.choices[0].message.content) @@ -456,7 +505,7 @@ def evaluation_task(x: Dict): density_iterations=density_iterations, ) - return {"summary": result, "instruction": instruction} + return {"summary": result} ``` ### Run the automated evaluation @@ -488,88 +537,19 @@ res = evaluate( ) ``` - Evaluation: 11%|█ | 2/18 [00:09<01:00, 3.77s/it]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed. - Traceback (most recent call last): - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py", line 29, in _score_test_case - result = metric.score(**score_kwargs) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py", line 46, in score - eval_dict = json.loads(response.choices[0].message.content) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py", line 346, in loads - return _default_decoder.decode(s) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 337, in decode - obj, end = self.raw_decode(s, idx=_w(s, 0).end()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 355, in raw_decode - raise JSONDecodeError("Expecting value", s, err.value) from None - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) - Evaluation: 22%|██▏ | 4/18 [00:09<00:21, 1.50s/it]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed. - Traceback (most recent call last): - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py", line 29, in _score_test_case - result = metric.score(**score_kwargs) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py", line 46, in score - eval_dict = json.loads(response.choices[0].message.content) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py", line 346, in loads - return _default_decoder.decode(s) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 337, in decode - obj, end = self.raw_decode(s, idx=_w(s, 0).end()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 355, in raw_decode - raise JSONDecodeError("Expecting value", s, err.value) from None - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) - Evaluation: 61%|██████ | 11/18 [00:12<00:03, 1.76it/s]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed. - Traceback (most recent call last): - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py", line 29, in _score_test_case - result = metric.score(**score_kwargs) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py", line 46, in score - eval_dict = json.loads(response.choices[0].message.content) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py", line 346, in loads - return _default_decoder.decode(s) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 337, in decode - obj, end = self.raw_decode(s, idx=_w(s, 0).end()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 355, in raw_decode - raise JSONDecodeError("Expecting value", s, err.value) from None - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) - Evaluation: 78%|███████▊ | 14/18 [00:13<00:01, 2.06it/s]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed. - Traceback (most recent call last): - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py", line 29, in _score_test_case - result = metric.score(**score_kwargs) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py", line 46, in score - eval_dict = json.loads(response.choices[0].message.content) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py", line 346, in loads - return _default_decoder.decode(s) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 337, in decode - obj, end = self.raw_decode(s, idx=_w(s, 0).end()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 355, in raw_decode - raise JSONDecodeError("Expecting value", s, err.value) from None - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) - Evaluation: 100%|██████████| 18/18 [00:31<00:00, 1.73s/it] + Evaluation: 100%|██████████| 18/18 [00:25<00:00, 1.44s/it]╭─ arXiv Papers (18 samples) ──────────────╮ │ │ -│ Total time: 00:00:31 │ +│ Total time: 00:00:26 │ │ Number of samples: 18 │ │ │ -│ summary_relevance: 2.2857 (avg) │ -│ summary_conciseness: 3.8571 (avg) │ -│ summary_technical_accuracy: 1.7143 (avg) │ -│ summary_average_score: 2.6179 (avg) │ -│ summary-metrics: None (avg) - 4 failed │ +│ summary_relevance: 1.1111 (avg) │ +│ summary_conciseness: 3.0000 (avg) │ +│ summary_technical_accuracy: 1.0000 (avg) │ +│ summary_average_score: 1.7028 (avg) │ │ │ ╰──────────────────────────────────────────╯@@ -583,7 +563,7 @@ res = evaluate( -View the results in your Opik dashboard. +View the results in your Opik dashboard.@@ -644,139 +624,19 @@ res = evaluate( ) ``` - Evaluation: 11%|█ | 2/18 [00:05<00:41, 2.62s/it]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed. - Traceback (most recent call last): - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py", line 29, in _score_test_case - result = metric.score(**score_kwargs) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py", line 46, in score - eval_dict = json.loads(response.choices[0].message.content) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py", line 346, in loads - return _default_decoder.decode(s) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 337, in decode - obj, end = self.raw_decode(s, idx=_w(s, 0).end()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 355, in raw_decode - raise JSONDecodeError("Expecting value", s, err.value) from None - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) - Evaluation: 17%|█▋ | 3/18 [00:06<00:27, 1.81s/it]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed. - Traceback (most recent call last): - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py", line 29, in _score_test_case - result = metric.score(**score_kwargs) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py", line 46, in score - eval_dict = json.loads(response.choices[0].message.content) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py", line 346, in loads - return _default_decoder.decode(s) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 337, in decode - obj, end = self.raw_decode(s, idx=_w(s, 0).end()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 355, in raw_decode - raise JSONDecodeError("Expecting value", s, err.value) from None - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) - Evaluation: 22%|██▏ | 4/18 [00:07<00:17, 1.28s/it]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed. - Traceback (most recent call last): - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py", line 29, in _score_test_case - result = metric.score(**score_kwargs) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py", line 46, in score - eval_dict = json.loads(response.choices[0].message.content) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py", line 346, in loads - return _default_decoder.decode(s) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 337, in decode - obj, end = self.raw_decode(s, idx=_w(s, 0).end()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 355, in raw_decode - raise JSONDecodeError("Expecting value", s, err.value) from None - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) - Evaluation: 39%|███▉ | 7/18 [00:07<00:05, 1.94it/s]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed. - Traceback (most recent call last): - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py", line 29, in _score_test_case - result = metric.score(**score_kwargs) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py", line 46, in score - eval_dict = json.loads(response.choices[0].message.content) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py", line 346, in loads - return _default_decoder.decode(s) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 337, in decode - obj, end = self.raw_decode(s, idx=_w(s, 0).end()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 355, in raw_decode - raise JSONDecodeError("Expecting value", s, err.value) from None - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) - Evaluation: 56%|█████▌ | 10/18 [00:10<00:06, 1.22it/s]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed. - Traceback (most recent call last): - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py", line 29, in _score_test_case - result = metric.score(**score_kwargs) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py", line 46, in score - eval_dict = json.loads(response.choices[0].message.content) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py", line 346, in loads - return _default_decoder.decode(s) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 337, in decode - obj, end = self.raw_decode(s, idx=_w(s, 0).end()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 355, in raw_decode - raise JSONDecodeError("Expecting value", s, err.value) from None - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) - Evaluation: 78%|███████▊ | 14/18 [00:11<00:01, 2.58it/s]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed. - Traceback (most recent call last): - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py", line 29, in _score_test_case - result = metric.score(**score_kwargs) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py", line 46, in score - eval_dict = json.loads(response.choices[0].message.content) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py", line 346, in loads - return _default_decoder.decode(s) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 337, in decode - obj, end = self.raw_decode(s, idx=_w(s, 0).end()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 355, in raw_decode - raise JSONDecodeError("Expecting value", s, err.value) from None - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) - Evaluation: 83%|████████▎ | 15/18 [00:11<00:01, 2.45it/s]OPIK: Failed to compute metric summary-metrics. Score result will be marked as failed. - Traceback (most recent call last): - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/site-packages/opik/evaluation/tasks_scorer.py", line 29, in _score_test_case - result = metric.score(**score_kwargs) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/var/folders/rr/674mwvt12_v0k3qz2z47m8bh0000gn/T/ipykernel_67274/2409766834.py", line 46, in score - eval_dict = json.loads(response.choices[0].message.content) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/__init__.py", line 346, in loads - return _default_decoder.decode(s) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 337, in decode - obj, end = self.raw_decode(s, idx=_w(s, 0).end()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/opt/homebrew/Caskroom/miniconda/base/envs/py312_llm_eval/lib/python3.12/json/decoder.py", line 355, in raw_decode - raise JSONDecodeError("Expecting value", s, err.value) from None - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) - Evaluation: 100%|██████████| 18/18 [00:23<00:00, 1.33s/it] + Evaluation: 100%|██████████| 18/18 [00:24<00:00, 1.37s/it]╭─ arXiv Papers (18 samples) ──────────────╮ │ │ -│ Total time: 00:00:24 │ +│ Total time: 00:00:25 │ │ Number of samples: 18 │ │ │ -│ summary_relevance: 1.5455 (avg) │ -│ summary_conciseness: 4.5455 (avg) │ -│ summary_technical_accuracy: 1.4545 (avg) │ -│ summary_average_score: 2.5136 (avg) │ -│ summary-metrics: None (avg) - 7 failed │ +│ summary_relevance: 1.0000 (avg) │ +│ summary_conciseness: 2.8333 (avg) │ +│ summary_technical_accuracy: 1.0000 (avg) │ +│ summary_average_score: 1.6094 (avg) │ │ │ ╰──────────────────────────────────────────╯@@ -790,7 +650,7 @@ res = evaluate( -View the results in your Opik dashboard. +View the results in your Opik dashboard.diff --git a/apps/opik-documentation/documentation/docs/evaluation/evaluate_your_llm.md b/apps/opik-documentation/documentation/docs/evaluation/evaluate_your_llm.md index 4466adad91..5cb3d5e858 100644 --- a/apps/opik-documentation/documentation/docs/evaluation/evaluate_your_llm.md +++ b/apps/opik-documentation/documentation/docs/evaluation/evaluate_your_llm.md @@ -35,10 +35,6 @@ def your_llm_application(input: str) -> str: ) return response.choices[0].message.content - -@track -def your_context_retriever(input: str) -> str: - return ["..."] ``` :::tip @@ -52,9 +48,7 @@ Once you have added instrumentation to your LLM application, we can define the e ```python def evaluation_task(x): return { - "input": x['user_question'], - "output": your_llm_application(x['user_question']), - "context": your_context_retriever(x['user_question']) + "output": your_llm_application(x['user_question']) } ``` @@ -66,26 +60,26 @@ If the dictionary returned does not match with the parameters expected by the me In order to create an evaluation experiment, you will need to have a Dataset that includes all your test cases. -If you have already created a Dataset, you can use the `Opik.get_dataset` function to fetch it: +If you have already created a Dataset, you can use the [`Opik.get_or_create_dataset`](https://www.comet.com/docs/opik/python-sdk-reference/Opik.html#opik.Opik.get_or_create_dataset) function to fetch it: ```python from opik import Opik client = Opik() -dataset = client.get_dataset(name="your-dataset-name") +dataset = client.get_or_create_dataset(name="Example dataset") ``` -If you don't have a Dataset yet, you can create one using the `Opik.create_dataset` function: +If you don't have a Dataset yet, you can insert dataset items using the [`Dataset.insert`](https://www.comet.com/docs/opik/python-sdk-reference/evaluation/Dataset.html#opik.Dataset.insert) method. You can call this method multiple times as Opik performs data deplication before ingestion: ```python from opik import Opik client = Opik() -dataset = client.create_dataset(name="your-dataset-name") +dataset = client.get_or_create_dataset(name="Example dataset") dataset.insert([ - {"user_question": "Hello, world!", "expected_output": "Hello, world!"}, - {"user_question": "What is the capital of France?", "expected_output": "Paris"}, + {"input": "Hello, world!", "expected_output": "Hello, world!"}, + {"input": "What is the capital of France?", "expected_output": "Paris"}, ]) ``` @@ -99,9 +93,8 @@ Opik provides a set of built-in evaluation metrics that you can choose from. The In the same evaluation experiment, you can use multiple metrics to evaluate your application: ```python -from opik.evaluation.metrics import Equals, Hallucination +from opik.evaluation.metrics import Hallucination -equals_metric = Equals() hallucination_metric = Hallucination() ``` @@ -131,37 +124,25 @@ def your_llm_application(input: str) -> str: model=MODEL, messages=[{"role": "user", "content": input}], ) - return response.choices[0].message.content # Define the evaluation task def evaluation_task(x): return { - "input": x['user_question'], - "output": your_llm_application(x['user_question']), - "context": your_context_retriever(x['user_question']) + "output": your_llm_application(x['user_question']) } -@track -def your_context_retriever(input: str) -> str: - return ["..."] - - # Create a simple dataset client = Opik() -try: - dataset = client.create_dataset(name="your-dataset-name") - dataset.insert([ - {"input": {"user_question": "What is the capital of France?"}}, - {"input": {"user_question": "What is the capital of Germany?"}}, - ]) -except: - dataset = client.get_dataset(name="your-dataset-name") +dataset = client.get_or_create_dataset(name="Example dataset") +dataset.insert([ + {"input": "What is the capital of France?"}, + {"input": "What is the capital of Germany?"}, +]) # Define the metrics hallucination_metric = Hallucination() - evaluation = evaluate( experiment_name="My experiment", dataset=dataset, @@ -179,9 +160,24 @@ You can use the `experiment_config` parameter to store information about your ev ## Advanced usage +### Missing arguments for scoring methods + +When you face the `opik.exceptions.ScoreMethodMissingArguments` exception, it means that the dataset item and task output dictionaries do not contain all the arguments expected by the scoring method. The way the evaluate function works is by merging the dataset item and task output dictionaries and then passing the result to the scoring method. For example, if the dataset item contains the keys `user_question` and `context` while the evaluation task returns a dictionary with the key `output`, the scoring method will be called as `scoring_method.score(user_question='...', context= '...', output= '...')`. This can be an issue if the scoring method expects a different set of arguments. + +You can solve this by either updating the dataset item or evaluation task to return the missing arguments or by using the `scoring_key_mapping` parameter of the `evaluate` function. In the example above, if the scoring method expects `input` as an argument, you can map the `user_question` key to the `input` key as follows: + +```python +evaluation = evaluate( + dataset=dataset, + task=evaluation_task, + scoring_metrics=[hallucination_metric], + scoring_key_mapping={"input": "user_question"}, +) +``` + ### Linking prompts to experiments -The [Opik prompt library](/library/prompt_management.md) can be used to version your prompt templates. +The [Opik prompt library](/library/prompt_management.mdx) can be used to version your prompt templates. When creating an Experiment, you can link the Experiment to a specific prompt version: diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/add-span-feedback-score.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/add-span-feedback-score.api.mdx index 1cf27c7f78..d82d314986 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/add-span-feedback-score.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/add-span-feedback-score.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,84 +47,26 @@ Add span feedback score > -+ + + +- -
- Path Parameters -
----
-- - -+ + - - ----
- Body -
-- -- -
--+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/add-trace-feedback-score.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/add-trace-feedback-score.api.mdx index ec6aec06a2..9b003ec85d 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/add-trace-feedback-score.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/add-trace-feedback-score.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- -- - - No Content - - -- --@@ -51,84 +47,26 @@ Add trace feedback score > -+ + + +- -
- Path Parameters -
----
-- - -+ + - - ----
- Body -
-- -- -
--+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/create-dataset.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/create-dataset.api.mdx index a4160ad9f5..c90e7aac11 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/create-dataset.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/create-dataset.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- -- - - No Content - - -- --@@ -51,120 +47,26 @@ Create dataset > -+ + + + - - ----
- Body -
-- --
-- - - - - - --+ + + +--- -- -- - - Created - - --- - Response Headers - -
-
-- -
-- - Location - - string - -
- --- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/create-experiment-items.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/create-experiment-items.api.mdx index 6f35956546..1b8f029645 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/create-experiment-items.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/create-experiment-items.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,172 +47,26 @@ Create experiment items > -+ + + + - - ----
- Body -
-- --
-- ---- - - experiment_items - - object[] - - - - required - - -
--- - - **Possible values:** `>= 1`, `<= 1000` - - -- -
- Array [ --- - - - - - - - - - - - - -
-- ] ---+ + + +--- -- -- - - No content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/create-experiment.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/create-experiment.api.mdx index 06fd558206..a1bbebd19d 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/create-experiment.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/create-experiment.api.mdx @@ -5,25 +5,20 @@ description: "Create experiment" sidebar_label: "Create experiment" hide_title: true hide_table_of_contents: true -api: eJx1Vm1v2zYQ/is3Yp8C2c5Lk2zCMCBNgy5r0AZJimKIg/oknizWFKmSlB3V8H8fjpIdOy/+IMnk8fjcw4d3txQBp16k9+LisSanKjLBi4dESPK5U3VQ1ohUnDvCQEAbG5EIW5NDnr+UIhV5tLjYNnD0syEf3lvZinQpcmsCT6RLgXWtVR4Xj3543mEpfF5ShfzF65QjyagkBvQUvhusiGGFtiaRCpv9oJz3qB3DCIo8r1SSn72ND06ZqUhEYV2FQaSiaZQUq2TX6YsFq0S8OVFRQF69NbmBElTQPPCvt+azlfT9m1OBxGr1NPVEz2aSpx352hrfxXC4f8Cv1/iXIhEloSQXLa9sR+EuZ8E1lAg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custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,129 +47,26 @@ Create experiment > -+ + + + - - ----
- Body -
-- --
-- - - - - - - - --+ + + +--- -- -- - - Created - - --- - Response Headers - -
-
-- -
-- - Location - - string - -
- --- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/create-feedback-definition.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/create-feedback-definition.api.mdx index eba4f2f168..281b9abb0c 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/create-feedback-definition.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/create-feedback-definition.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,281 +47,26 @@ Get feedback definition > -+ + + + - - ----
- Body -
-- --
-- - - - --- - - type - - string - - required - --- - - **Possible values:** [`numerical`, `categorical`] - - -- -- - ---- - - details - - object - - -
--- - - - -- -- ---- - - details - - object - - -
--- ---- - - categories - - object - - - - required - - -
--- - --+ + + +--- -- -- - - Created - - --- - Response Headers - -
-
-- -
-- - Location - - string - -
- --- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/create-or-update-dataset-items.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/create-or-update-dataset-items.api.mdx index 8fa50612f7..6147195da3 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/create-or-update-dataset-items.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/create-or-update-dataset-items.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,208 +47,26 @@ Create/update dataset items based on dataset item id > -+ + + + - - ----
- Body -
-- --
-- - - - - ---- - - items - - object[] - - - - required - - -
--- - - **Possible values:** `>= 1`, `<= 1000` - - -- -
- Array [ --- - - - - - - - - - - - - - - - - -
-- ] ---+ + + +--- -- -- - - No content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/create-project.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/create-project.api.mdx index 370b401bf3..43f9e11bed 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/create-project.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/create-project.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,293 +47,26 @@ Create project > -+ + + + - - ----
- Body -
-- --
-- - - - --+ + + +--- -- - - - Created - - --- - Response Headers - -
-
-- -
-- - Location - - string - -
- --- --- - - - Bad Request - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -- -- - - Unprocessable Content - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/create-prompt-version.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/create-prompt-version.api.mdx index d418ea133c..f3db240155 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/create-prompt-version.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/create-prompt-version.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,521 +47,26 @@ Create prompt version > -+ + + + - - ----
- Body -
-- --
-- - - ---- - - version - - object - - - - required - - -
--- - - - - - --+ + + +--- -- - - - OK - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - -- -- - -- - - - Bad Request - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -- - - - Conflict - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -- -- - - Unprocessable Content - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/create-prompt.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/create-prompt.api.mdx index a2a9336624..00a15e8f6a 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/create-prompt.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/create-prompt.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,402 +47,26 @@ Create prompt > -+ + + + - - ----
- Body -
-- --
-- - - - - - - - --+ + + +--- -- - - - Created - - --- - Response Headers - -
-
-- -
-- - Location - - string - -
- --- --- - - - Bad Request - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -- - - - Conflict - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -- -- - - Unprocessable Content - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/create-span.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/create-span.api.mdx index e4bc8d1104..26108c1d66 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/create-span.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/create-span.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,241 +47,26 @@ Create span > -+ + + + - - ----
- Body -
-- --
-- - - - - - - - - - - - - - - - - - - - - - - - - ---- - - usage - - object - - -
--- - --+ + + +--- -- -- - - Created - - --- - Response Headers - -
-
-- -
-- - Location - - string - -
- --- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/create-spans.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/create-spans.api.mdx index 9be89c8d1e..fc0715cfce 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/create-spans.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/create-spans.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,266 +47,26 @@ Create spans > -+ + + + - - ----
- Body -
-- --
-- ---- - - spans - - object[] - - - - required - - -
--- - - **Possible values:** `>= 1`, `<= 1000` - - -- -
- Array [ --- - - - - - - - - - - - - - - - - - - - - - - - - --- - - usage - - object - - -
--- - -- -
-- ] ---+ + + +--- -- -- - - No Content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/create-trace.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/create-trace.api.mdx index fb8cae1b78..8aa25032c0 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/create-trace.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/create-trace.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,174 +47,26 @@ Get trace > -+ + + + - - ----
- Body -
-- --
-- - - - - - - - - - - - - - - - - - --+ + + +--- -- -- - - Created - - --- - Response Headers - -
-
-- -
-- - Location - - string - -
- --- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/create-traces.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/create-traces.api.mdx index c604ca39f7..c78eb95990 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/create-traces.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/create-traces.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,199 +47,26 @@ Create traces > -+ + + + - - ----
- Body -
-- --
-- ---- - - traces - - object[] - - - - required - - -
--- - - **Possible values:** `>= 1`, `<= 1000` - - -- -
- Array [ --- - - - - - - - - - - - - - - - - - - -
-- ] ---+ + + +--- -- -- - - No Content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-dataset-by-name.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-dataset-by-name.api.mdx index 054d8e2a3d..b27fee56be 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-dataset-by-name.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-dataset-by-name.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,69 +47,26 @@ Delete dataset by name > -+ + + + - - ----
- Body -
-- --
-- - --+ + + +--- -- -- - - No content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-dataset-items.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-dataset-items.api.mdx index 688318a37f..be9e1496f2 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-dataset-items.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-dataset-items.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,69 +47,26 @@ Delete dataset items > -+ + + + - - ----
- Body -
-- --
-= 1`, `<= 1000`"} - schema={{"maxItems":1000,"minItems":1,"type":"array","items":{"type":"string","format":"uuid"}}} - > - - --+ + + +--- -- -- - - No content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-dataset.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-dataset.api.mdx index 34c7a5b489..d29bd3fad1 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-dataset.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-dataset.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,51 +47,26 @@ Delete dataset by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- -- - - No content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-experiment-items.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-experiment-items.api.mdx index 6729ed60e9..571a092e4a 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-experiment-items.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-experiment-items.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,69 +47,26 @@ Delete experiment items > -+ + + + - - ----
- Body -
-- --
-= 1`, `<= 1000`"} - schema={{"maxItems":1000,"minItems":1,"uniqueItems":true,"type":"array","items":{"type":"string","format":"uuid"}}} - > - - --+ + + +--- -- -- - - No content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-experiments-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-experiments-by-id.api.mdx index 9aff9871f4..72ee068cf8 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-experiments-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-experiments-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,69 +47,26 @@ Delete experiments by id > -+ + + + - - ----
- Body -
-- --
-= 1`, `<= 1000`"} - schema={{"maxItems":1000,"minItems":1,"uniqueItems":true,"type":"array","items":{"type":"string","format":"uuid"}}} - > - - --+ + + +--- -- -- - - No content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-feedback-definition-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-feedback-definition-by-id.api.mdx index 4922071fdb..39c4786b07 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-feedback-definition-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-feedback-definition-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,51 +47,26 @@ Delete feedback definition by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- -- - - No Content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-project-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-project-by-id.api.mdx index a5e98770a5..775dd22800 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-project-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-project-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,142 +47,26 @@ Delete project by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- - - - No Content - - -- --- -- - - Conflict - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-prompt.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-prompt.api.mdx index b64a19d113..d012287f67 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-prompt.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-prompt.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,51 +47,26 @@ Delete prompt > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- -- - - No content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-span-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-span-by-id.api.mdx index f7c0dfd38b..179137d608 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-span-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-span-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,64 +47,26 @@ Delete span by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- - - - No Content - - -- --- -- - - Not implemented - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-span-feedback-score.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-span-feedback-score.api.mdx index 450fb30a36..b74d2057c1 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-span-feedback-score.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-span-feedback-score.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,93 +47,26 @@ Delete span feedback score > -+ + + +- -
- Path Parameters -
----
-- - -+ + - - ----
- Body -
-- --
-- - --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-trace-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-trace-by-id.api.mdx index 13ff912ebd..84e91a80aa 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-trace-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-trace-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- -- - - No Content - - -- --@@ -51,51 +47,26 @@ Delete trace by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- -- - - No Content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-trace-feedback-score.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-trace-feedback-score.api.mdx index 4dfc0bf6ba..7177436e09 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-trace-feedback-score.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-trace-feedback-score.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,93 +47,26 @@ Delete trace feedback score > -+ + + +- -
- Path Parameters -
----
-- - -+ + - - ----
- Body -
-- --
-- - --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-traces.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-traces.api.mdx index 957848d798..921e5ba421 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/delete-traces.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/delete-traces.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- -- - - No Content - - -- --@@ -51,69 +47,26 @@ Delete traces > -+ + + + - - ----
- Body -
-- --
-= 1`, `<= 1000`"} - schema={{"maxItems":1000,"minItems":1,"uniqueItems":true,"type":"array","items":{"type":"string","format":"uuid"}}} - > - - --+ + + +--- -- -- - - No Content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/find-dataset-items-with-experiment-items.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/find-dataset-items-with-experiment-items.api.mdx index 9254bccd1f..2a3b073c42 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/find-dataset-items-with-experiment-items.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/find-dataset-items-with-experiment-items.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,633 +47,26 @@ Find dataset items with experiment items > -+ + + +- -
- Path Parameters -
----
-- - -+ +- -
- Query Parameters -
----
-- - - - - - - - --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/find-datasets.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/find-datasets.api.mdx index c48fa4b60e..13aeee2d9f 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/find-datasets.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/find-datasets.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- -- - - Dataset item resource - - ---- -- -- -- --- - Schema - -
- --
-- --- - - content - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - - - - - --- - - experiment_items - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - --- - - feedback_scores - - object[] - - -
--- -
- Array [ --- - - - = -1000000000` and `<= 1000000000`"} - schema={{"maximum":1000000000,"exclusiveMaximum":false,"minimum":-1000000000,"exclusiveMinimum":false,"type":"number"}} - > - - - - - - - - - - - - - - - -
-- ] --- - - - - - - - - -
-- ] --- - - - - - - - - -
-- ] --- - - - - - - ---- - - columns - - object[] - - -
--- -
- Array [ --- - - - - -
-- ] --- -- - -@@ -51,285 +47,26 @@ Find datasets > -+ + + +- -
- Query Parameters -
----
-- - - - - - - - --+ + + +--- -- -- - - Dataset resource - - ---- -- -- -- --- - Schema - -
- --
-- --- - - content - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - - - - - - - - - - - -
-- ] --- - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/find-experiments.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/find-experiments.api.mdx index 1957de629b..462ea471b8 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/find-experiments.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/find-experiments.api.mdx @@ -5,25 +5,20 @@ description: "Find experiments" sidebar_label: "Find experiments" hide_title: true hide_table_of_contents: true -api: eJy1V21vGzcM/iucPhZnO2n3AhyGAVmXddmKtkhSDEMdJPSJ9qnWSVeJsusa/u8DdefYbuItwLAvvkQiH5IPSVFaK8ZZVOUHdf65pWAachzVTaE0xSqYlo13qlS/GqeB9iQK5VsKKNsXWpVqapw+P9hvMWBDTEHQ18phQ6pULc5IFcoI6KdEYaUKFauaGlTlWjXGmSY1qjwtFK9aUTCOaUZBFWrqQ4PcLb14rsTFKSbLqjzdbIp7C9F8+R8snOyb0MgYiS/0cTs9duRg3GwfOiWj1T5Y/jwRZ7O5KVSg2HoXKcr+85MT+Rxmay8RECj6FCoxUXnH5FjksW2tqXL6Rh+jKK0fGvWTj1SxpDJIstl0JnMKd1JH6dsUXS6eJsqe0f6r7PffiuxeIL00hoBCnGFqspOBPiUTSEtl9+m6zUzfFP8SntFPyF9xCPowUTuBp+BJUlG/dXalSg6JNoU6itsQo2A/lig2bGXh9+jdG6/p9l2aWFOJ2pRIT7Ca38bKhy7Sr7g7dOEIl321LtCmJ3B5NIhOf7fjUjOhIH3xwI1tTL/2AVyJ/2cLCjjbxScFFLCi28qng8I4WkaPUF4FQiZ9i/yPGdPINGCTeXiAYTHybWr1fwbaOjNZ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FO6/z6VsRWq1muiI74Ndr2W5e0HKJWko6omVWW6qbcRCPeFy+wDvB3CVr8Mjov1L+hTR3RfxKfJ7zwgRvZd/AomsKj/crwvVFUd2pTtzUVXY8s6pF49YQXmeK95e3qn1+iezMtEx sidebar_class_name: "get api-method" info_path: reference/rest_api/opik-rest-api custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,336 +47,26 @@ Find experiments > -+ + + +- -
- Query Parameters -
----
-- - - - - - - - --+ + + +--- -- -- - - Experiments resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - ---- - - content - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - --- - - feedback_scores - - object[] - - -
--- -
- Array [ --- - - - - -
-- ] --- - - - - - - - - - - -
-- ] --- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/find-feedback-definitions.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/find-feedback-definitions.api.mdx index abf35ce622..2785b447dd 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/find-feedback-definitions.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/find-feedback-definitions.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,917 +47,26 @@ Find Feedback definitions > -+ + + +- -
- Query Parameters -
----
-- - - - - - - - --+ + + +--- -- -- - - Feedback definitions resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - ---- - - content - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - - -- - - type - - string - - required - --- - - **Possible values:** [`numerical`, `categorical`] - - -- -- - - - - - --- - - details - - object - - - - required - - -
--- - - - -- - - - - - - - -- - - type - - string - - required - --- - - **Possible values:** [`numerical`, `categorical`] - - -- -- - - - circular(NumericalFeedbackDefinition_Public) - - --- -- --- - - details - - object - - -
--- ---- - - categories - - object - - - - required - - -
--- - -- - - - - - - - -- - - - - - - - -- -- - - - - --- - - details - - object - - - - required - - -
--- ---- - - categories - - object - - - - required - - -
--- - -- - - - - - - - -- - - type - - string - - required - --- - - **Possible values:** [`numerical`, `categorical`] - - -- -- - --- - - details - - object - - -
--- - - - -- - - - - - - - -- -- - - circular(CategoricalFeedbackDefinition_Public) - - --- - - - - - - - -- -
-- ] --- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/find-projects.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/find-projects.api.mdx index 641901b4f9..ac0bc733c2 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/find-projects.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/find-projects.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,267 +47,26 @@ Find projects > -+ + + +- -
- Query Parameters -
----
-- - - - - - - - --+ + + +--- -- -- - - Project resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - --- - - content - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - - - - - -
-- ] --- - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-by-id.api.mdx index 2f95ce91a1..9d503dec26 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,201 +47,26 @@ Get dataset by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- -- - - Dataset resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - - - - - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-by-identifier.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-by-identifier.api.mdx index 7aaa470c7e..8c7fd8131a 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-by-identifier.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-by-identifier.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,219 +47,26 @@ Get dataset by name > -+ + + + - - ----
- Body -
-- --
-- - --+ + + +--- -- -- - - Dataset resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - - - - - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-item-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-item-by-id.api.mdx index 2610f7e50b..e324c7ae52 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-item-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-item-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,324 +47,26 @@ Get dataset item by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- -- - - Dataset item resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - - - - --- - - experiment_items - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - - - - - -
-- ] --- - - - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-items.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-items.api.mdx index 7d62c97225..dcaf54dc89 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-items.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-dataset-items.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,482 +47,26 @@ Get dataset items > -+ + + +- -
- Path Parameters -
----
-- - -+ +- -
- Query Parameters -
----
-- - - - --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-experiment-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-experiment-by-id.api.mdx index a1ee944eaa..d1305f2ebd 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-experiment-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-experiment-by-id.api.mdx @@ -5,25 +5,20 @@ description: "Get experiment by id" sidebar_label: "Get experiment by id" hide_title: true hide_table_of_contents: true -api: eJylV21v2zYQ/is3ftoK2U5ftgHCMCBtsy5r1hZJimGIg4QmzxZrilTJo13V8H8fjpLfmqTrsC+WIN49fO7hvdArQXIWRXklTj41GEyNjqK4LoTGqIJpyHgnSvEKCXBrAJMWjBaF8A0GySanWpRihrQDed6eskUjg6yRMPAeK+FkjaIU2dkwcCOpEoUI+DGZgFqUFBIWIqoKaynKlaC2YY9IwbiZKMTUh1qSKEVKRov1+pqdY+NdxMj2T46O+HFIf0cLAkafgkJRCOUdoS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3Gf/5zgPJBXJSMbOAfbSZ5xHalnVe7kB77PNwyJ8sf/ctyoAB7qANODMfx3DlIa4MqZp9mCJn9M6D2dlbZx2VZpHLQMnMT1mjFpzHLIbaEFSJyDvQJrZWdqhhVaOD2i+R+zrwc6DDNfH+4s3dgewAFDiBoc4dzGjcRmZIiGGISUX7PVe8zs0HLrD10ZAPvFUft+bH2hOPIWsUuogHeKetVDXCi/HJEdDQ4mU+HfswnwyqcfLm/NXZ28uz0YvxybimxuZde7vfiefjk/FJ3qV8pEa6Q+oPfy0eNf31fm4/Jj/MT8KPNGmtNI5vy8zXw1y8FsvneZDnySgKcTAbRSFKo3nh5CJm2fW6khHfB7vZ8OsPCUMnyusb/oIIRlY8qa7XQpvI/7UoZ9JG/AzvP1wMK+4f4TG6288i1+0+dEohCrHArv8O3txsCtHner69PzhVCls6ULm32fCU3e0Kr8+uxGbzH/PRed0= sidebar_class_name: "get api-method" info_path: reference/rest_api/opik-rest-api custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- -- - - Dataset items resource - - ---- -- -- -- --- - Schema - -
- --
-- --- - - content - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - - - - - --- - - experiment_items - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - - - - - -
-- ] --- - - - - - - - - -
-- ] --- - - - - - - ---- - - columns - - object[] - - -
--- -
- Array [ --- - - - - -
-- ] --- -- - -@@ -51,343 +47,26 @@ Get experiment by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- - - - Experiment resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - --- - - feedback_scores - - object[] - - -
--- -
- Array [ --- - - - - -
-- ] --- - - - - - - - - - -- -- - -- -- - - Not found - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-experiment-item-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-experiment-item-by-id.api.mdx index 34590a3c37..06a263f37c 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-experiment-item-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-experiment-item-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,265 +47,26 @@ Get experiment item by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- - - - Experiment item resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - - - -- -- - -- -- - - Not found - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-feedback-definition-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-feedback-definition-by-id.api.mdx index 81a26f02d3..a7dae4f373 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-feedback-definition-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-feedback-definition-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,407 +47,26 @@ Get feedback definition by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- -- - - Feedback definition resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - --- - - type - - string - - required - --- - - **Possible values:** [`numerical`, `categorical`] - - -- -- - --- - - details - - object - - -
--- - - - -- - - - - - - - -- -- --- - - details - - object - - -
--- ---- - - categories - - object - - - - required - - -
--- - -- - - - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-project-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-project-by-id.api.mdx index 8da464bc53..b14a443e8b 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-project-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-project-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,174 +47,26 @@ Get project by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- -- - - Project resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompt-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompt-by-id.api.mdx index 3907420281..9914fd03d6 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompt-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompt-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,358 +47,26 @@ Get prompt by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- - - - Prompt resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - - - - ---- - - latest_version - - object - - -
--- - - - - - - - - - - - - - -- -- - -- -- - - Not Found - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompt-version-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompt-version-by-id.api.mdx index 8acf9e5177..e8bae5fef6 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompt-version-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompt-version-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,256 +47,26 @@ Get prompt version by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- - - - Prompt version resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - -- -- - -- -- - - Not Found - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompt-versions.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompt-versions.api.mdx index 384d81b33b..e8af54af67 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompt-versions.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompt-versions.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,254 +47,26 @@ Get prompt versions > -+ + + +- -
- Path Parameters -
----
-- - -+ +- -
- Query Parameters -
----
-- - - - --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompts.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompts.api.mdx index 4e52bcdb87..03981fa74e 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompts.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-prompts.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- -- - - OK - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - ---- - - content - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - -
-- ] --- -- - -@@ -51,253 +47,26 @@ Get prompts > -+ + + +- -
- Query Parameters -
----
-- - - - - - --+ + + +--- -- -- - - OK - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - ---- - - content - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - - - - - -
-- ] --- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-span-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-span-by-id.api.mdx index 72976ca4ec..56840ba810 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-span-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-span-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,780 +47,26 @@ Get span by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- - - - Span resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - - - - - - - - - - - - --- - - usage - - object - - -
--- - -- - - - - - - - - ---- - - feedback_scores - - object[] - - -
--- -
- Array [ --- - - - = -1000000000` and `<= 1000000000`"} - schema={{"maximum":1000000000,"exclusiveMaximum":false,"minimum":-1000000000,"exclusiveMinimum":false,"type":"number"}} - > - - - - - - - - - - - - - - - -
-- ] --- -- - -- -- - - Not found - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - - - - - - - - - - - - --- - - usage - - object - - -
--- - -- - - - - - - - - ---- - - feedback_scores - - object[] - - -
--- -
- Array [ --- - - - = -1000000000` and `<= 1000000000`"} - schema={{"maximum":1000000000,"exclusiveMaximum":false,"minimum":-1000000000,"exclusiveMinimum":false,"type":"number"}} - > - - - - - - - - - - - - - - - -
-- ] --- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-spans-by-project.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-spans-by-project.api.mdx index fb0f80f98c..b7a5ae7ec2 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-spans-by-project.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-spans-by-project.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,508 +47,26 @@ Get spans by project_name or project_id and optionally by trace_id and/or type > -+ + + +- -
- Query Parameters -
----
-- - - - - - - - - - - - - - --+ + + +--- -- -- - - Spans resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - ---- - - content - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - - - - - - - - - - - - - --- - - usage - - object - - -
--- - -- - - - - - - - - --- - - feedback_scores - - object[] - - -
--- -
- Array [ --- - - - = -1000000000` and `<= 1000000000`"} - schema={{"maximum":1000000000,"exclusiveMaximum":false,"minimum":-1000000000,"exclusiveMinimum":false,"type":"number"}} - > - - - - - - - - - - - - - - - -
-- ] --- -
-- ] --- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-trace-by-id.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-trace-by-id.api.mdx index b3d958d9f2..14055b6bf4 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-trace-by-id.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-trace-by-id.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,382 +47,26 @@ Get trace by id > -+ + + +- -
- Path Parameters -
----
-- - --+ + + +--- -- -- - - Trace resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - - - - - - --- - - usage - - object - - -
--- - -- - - - - - - - - ---- - - feedback_scores - - object[] - - -
--- -
- Array [ --- - - - = -1000000000` and `<= 1000000000`"} - schema={{"maximum":1000000000,"exclusiveMaximum":false,"minimum":-1000000000,"exclusiveMinimum":false,"type":"number"}} - > - - - - - - - - - - - - - - - -
-- ] --- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-traces-by-project.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-traces-by-project.api.mdx index f8db2c683a..15b774199d 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-traces-by-project.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-traces-by-project.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,471 +47,26 @@ Get traces by project_name or project_id > -+ + + +- -
- Query Parameters -
----
-- - - - - - - - - - --+ + + +--- -- -- - - Trace resource - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - ---- - - content - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - - - - - - - --- - - usage - - object - - -
--- - -- - - - - - - - - --- - - feedback_scores - - object[] - - -
--- -
- Array [ --- - - - = -1000000000` and `<= 1000000000`"} - schema={{"maximum":1000000000,"exclusiveMaximum":false,"minimum":-1000000000,"exclusiveMinimum":false,"type":"number"}} - > - - - - - - - - - - - - - - - -
-- ] --- -
-- ] --- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/get-traces-count-for-workspaces.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/get-traces-count-for-workspaces.api.mdx index dd66b77918..1863a9f09b 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/get-traces-count-for-workspaces.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/get-traces-count-for-workspaces.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -43,138 +39,26 @@ import TabItem from "@theme/TabItem"; Get traces count on previous day for all available workspaces - -+--- -- -- - - TraceCountResponse resource - - ---- -- -- -- --- - Schema - -
- --
-- ---- - - workspaces_traces_count - - object[] - - -
--- -
- Array [ --- - - - - -
-- ] --- -- - -+ + + ++ + + ++ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/is-alive.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/is-alive.api.mdx index c5446b6eef..7e48df074c 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/is-alive.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/is-alive.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -43,68 +39,26 @@ import TabItem from "@theme/TabItem"; isAlive - -+--- -- -- - - default response - - ---- -- -- -- ---- - Schema - -
- -- any -
-+ + + ++ + + ++ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/opik-rest-api.info.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/opik-rest-api.info.mdx index 678569b940..573553f6f8 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/opik-rest-api.info.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/opik-rest-api.info.mdx @@ -61,7 +61,7 @@ Opik includes two main deployment options that results in slightly different API Github Repository: - URL: [https://github.com/comet-ml/opik](mailto:https://github.com/comet-ml/opik) + URL: [https://github.com/comet-ml/opik](https://github.com/comet-ml/opik)@@ -51,465 +47,26 @@ Retrieve prompt version > -+ + + + - - ----
- Body -
-- --
-- - - - --+ + + +--- -- - - - OK - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - - - - - - - - - -- -- - -- - - - Bad Request - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -- - - - Not Found - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -- -- - - Unprocessable Content - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/score-batch-of-spans.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/score-batch-of-spans.api.mdx index f6085aedf8..394466fb19 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/score-batch-of-spans.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/score-batch-of-spans.api.mdx @@ -5,25 +5,20 @@ description: "Batch feedback scoring for spans" sidebar_label: "Batch feedback scoring for spans" hide_title: true hide_table_of_contents: true -api: eJyNV1lv20YQ/ivTRR8SgzrsxE5LFC2co6mRNAksG0VhuvGIHIpbLXeZPSQzqv57MUtKlmKnDR947M61M98cXAmPMyfSKzFpUDtxnYiCXG5l46XRIhXP0ecVlETFFPM5uNxYqWdQGgsuciTCNGSRyc8KkQqmoMj1vpz0FJY+BXL+uSlaka5EbrQn7fkVm0bJPHKP/nascSVcXlGN/MZ80lLB9kW50UDfNiRSYaZ/U+5FIhrLFnhJruOOdOlK1Hh75ql2Ij0cj8eJqKXefG+FoLXYikTIbmNfJWkvfftRFkzAN401iUQ4E2zOLwtUgf7fJFnwvadxnh0oElEaW6MXqQhBFmKd7Kj7Fur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IPEUzB3gfrqDSzVAYlJftKrcql4FjIuFIB5jEEa6BSvtO04QrWDRto7IrTuib/gzlSE++v3t49oh0EOQEwNKmDqYr3mRkAIW3XmkBl2tuGxvtDaj5wxZ31Klgnq9TxZPlce5KBrVXJxvMjeRcdlQ3D2Xh6JGiYUJRux9YtJgOrn7y9fP3m59mb0dl4Om5Cq9Nqws73Tft0PB1P055lfWjJPFL1NxbbowHwaG39O7zDChL4Pkw6TcqIFcmj7TDzb3B1mmZemvoyoAbWjyf/bYZS4sKx3c7J83undzs5/j2y22B+cyuTzymayxy7kdnWAzMN4CVvMMdhBRldi12HQfl0/5a5flhR3r2/xgznw9re2kpYHK1lpac15pi2/9QP0+4sZ1vUZBaRFkLbi5TfXziFQpk= sidebar_class_name: "put api-method" info_path: reference/rest_api/opik-rest-api custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,190 +47,26 @@ Batch feedback scoring for spans > -+ + + + - - ----
- Body -
-- --
-- ---- - - scores - - object[] - - - - required - - -
--- - - **Possible values:** `>= 1`, `<= 1000` - - -- -
- Array [ --- - - - - - - - - - = -1000000000` and `<= 1000000000`"} - schema={{"maximum":1000000000,"exclusiveMaximum":false,"minimum":-1000000000,"exclusiveMinimum":false,"type":"number"}} - > - - - - - - - -
-- ] ---+ + + +--- -- -- - - No Content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/score-batch-of-traces.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/score-batch-of-traces.api.mdx index d174571417..4063621c90 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/score-batch-of-traces.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/score-batch-of-traces.api.mdx @@ -5,25 +5,20 @@ description: "Batch feedback scoring for traces" sidebar_label: "Batch feedback scoring for traces" hide_title: true hide_table_of_contents: true -api: eJyNV+tv3DYS/1fmiH5oDe3DTuLcCYcrnDRtjaZtYDs4HCxfPEuNVuxSpMrHrtXt/u/FUNJ6N07uog96kPPizG8e2oqASy/yW3HjUJIXd5koyUun2qCsEbl4hUHWUBGVC5Qr8NI6ZZZQWQehZ8mEbckh01+WIhdMQont1+pmJHH0eyQfXtmyE/lWSGsCmcCv2LZaycQ++82zzq3wsqYG+Y35lKOSTUyCk4mha0nkwi5+IxlEJlrHJgRFvudOdPlWNPhwGajxIj+dz+eZaJQZv/dC0DnsRCZUv3GskkxQofugSibgm8GGRCa8jU7yyxp1pP9vkir5PtD4wC4UmaisazCIXMSoSrHLDtR9CXXrLCv7kGzKt6LFEMhx0L7+1n/z36LwJ18XxfX0pCiu/yyK62945SuRPZF8HPHLCkzUOoNQE5RUYdQBBl2gPERPSf2o9ljaLhMSAy2t6z58lqL3Wh8g1cSmj09/ZYIepI5erenncbdC7SmFr/+efJp83B7IB7UmNgtyrNYRDgB7YtEQ0E+4nQyLvBVRcdzLlbjb7TIRVNBM9v2QGNd70DPAxO5/0/B+sse31vgeImfz5/w4jsUvFl4PqcIMDYXaco61MWEMQy1yMVufzlqn1hho1ufkbMzXyZALmfDk1uQ41bciOi1yUYfQ5rOZthJ1bX3IX5y+fDbDVj1BxFsmgV6C2GWHAnw+m202m6m0DQW+z2yrVp+U8murVvBa21iK3V0mONevHqvCmwdsWk2H+Xvb5414VuHfX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fcFFhc2hpS0Z2/OfQatJvQEjlDWwEfWwPcq/BAXOYyhW6pQx0WKW4rgpNEpgNPCFOZMa7BVktgDz4NWPlDJ9oZaeSitjA2ZkGowoKNUHGDRAalQk0u8l9/+yHby8u05X0uZQA5lgI0KddpPrunxNYUzDwiOfNQhK8xD7ckBCyIDtg2qUX9R2beTmnxSPZHoybN5jTLl3nFsmLZ2NbYfHCRCqDGVNGPDeDVc2DXtnScdYaDCcGCU95Hunch3cqg8AcKbi0/YYekaykgdS/IQNhYaVAZKarXt2E/Jbo5bUtzfMZnrtVrWjIRSVRUxKhJIoscl5Sx6AkdHl6SrCWcqlTCo8gGNpPzoCH6zETZKa/CqaXUHhqhkZ/uWpKq63v0XrwE93H4082dfkSlbq0x4x7Xl61u+pFeN0uimcMUhV/6gL/QXGqPAgPDT3tr7dD8w70N2JVK+74/UpRxIG79at/ItSurhRlATlpTsIOib4QjP/gR8baMuYdG7DOD29pZfW34AFOJlgvhebiFyKERno5tsxr0JF4VCZCMLxlBbp/5KCH/AgK2arKgrBBPu9sp48a2FgCtiULFljvpos50H0karU9mB0lKPwwE/if72BaEjB7fQOqrU3RSuLPiN4sEqWIieEb33YHL26KyD1MxSGkhM9kmt5IpxzGRUqgCLGII1UCrfauyohE1NBmq7pjSx8Xswh3Pi7cXr2we0gyDHAIY6VTBV0hiZARBcdq0JKNPgNhTe71PxgQtqrVfBOp6lDjvLx8oTd2ytJBlPD+SdtShrgpPp/EDQ0KEwnU6tW84GVj97ff7y1c+XryYn0/m0Do1Oswk53xft4+l8Ok+DlvWhQfNA1f+ZbQ86wIPB9X8xD1NIoLswazUqw3akO22Htn8t1sep66XGzywj7/vN/yYTnOXMst0u0NNbp3c73v4zkutEfn3Dzc8pXHAru+b21mMz9eAVdSIXwxgyuWLD9r3y8QzOrX0/prx5eyUysRhG98aWzOJww2M9bkQu0l+AVBLT/Mx7W6HRLCMumbYXyb9/ABLrRSQ= sidebar_class_name: "put api-method" info_path: reference/rest_api/opik-rest-api custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,190 +47,26 @@ Batch feedback scoring for traces > -+ + + + - - ----
- Body -
-- --
-- ---- - - scores - - object[] - - - - required - - -
--- - - **Possible values:** `>= 1`, `<= 1000` - - -- -
- Array [ --- - - - - - - - - - = -1000000000` and `<= 1000000000`"} - schema={{"maximum":1000000000,"exclusiveMaximum":false,"minimum":-1000000000,"exclusiveMinimum":false,"type":"number"}} - > - - - - - - - -
-- ] ---+ + + +--- -- -- - - No Content - - -- --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/stream-dataset-items.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/stream-dataset-items.api.mdx index 970f8e8092..038aa3a2d1 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/stream-dataset-items.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/stream-dataset-items.api.mdx @@ -5,25 +5,20 @@ description: "Stream dataset items" sidebar_label: "Stream dataset items" hide_title: true hide_table_of_contents: true -api: eJx1Vm1v20YM/ivcfSzklyRtugnDgLQNuqDdWiQphiEOEvpEWVef7rQ7yq5q+L8PPMmJ3Sb+YAsyyXv48OGRG8W4iCq/Ue+QMRJHdZupgqIOpmHjncrVFQfCGoreAAxTHVWm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nhJujluauF1jghuMnhWsBKWnU2JVJJHUvH1zdj2AN2+uyEwHvNFIQTdViGgl5W/ewL9cDUttDARdVqYBS6SY7FCR1NOmpf/yI2CAhxc37ug7sqpy2sZ7zgx/e+BFBl1qg34I1xxyHZIrRVOsTb+gPgosiDBs0T7t1h14+3AlU17vj9SkPZAe/OL8PFQoqZUbQUGoKOEgaFNmL8/2DYTC1UbBpKUM4OHhgb9W/AFwK94niW/83oocbkXjaj9Y9s8GnDNuRdYPwToWzuvfk8K3BmClB3NqbgUbrjeT8Y8PDiLOiUXFyDy10WacO9561KlLBOWo1WGnn2T/8D2hJw8PUHma6schXDsISx1lwRzWgRW9YTCR3ZO1szWztA0kJnzSaDlnHbMZKR1hUsfoLCgdKoMNKVgWZKFwC0pna/7u4PCe+HL58WHLtnPkWcBQpAymFfWR6QTRnctRxqeWWvyQkg9cUuWCjs5zJ79bGF5KT+kiQ0uygbb8nVUoC4Lj4XjHUVdgML0dOj8bdUPD6OPF+/Ofr84Hx8PxsIilSU07+dAm7aPheDjmR1wsS7RbU71wJbST9Lfue16y7+p3pMc4qgxqy7Ml5KuuNN+IxVFqJFJxFpuDXNjcTGTd1ROfZHgz85jVaoKBvnizXvPj32ryjchv7vhI4jVOuGLdcIPfSjDV9Dk1IhfvW8iDa0a2OcE8v67iIt6OOJOSqviC7c6tCxftTQPy+dPVtcjEpLsaK1NvJDwuueHCpchFumJL6TKd5PjZShi0szp1RqLFwX//BiuQ1CA= sidebar_class_name: "post api-method" info_path: reference/rest_api/opik-rest-api custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,559 +47,26 @@ Stream dataset items > -+ + + + - - ----
- Body -
-- --
-- - - - - - --+ + + +--- -- -- - - Dataset items stream or error during process - - ---- -- -- -- --- - Schema - -
- --
-- -
- Array [ --- - anyOf -- -- - - - - - - - - - - - - - - - - - --- - - experiment_items - - object[] - - -
--- -
- Array [ --- - - - - - - - - - - - - --- - - feedback_scores - - object[] - - -
--- -
- Array [ --- - - - = -1000000000` and `<= 1000000000`"} - schema={{"maximum":1000000000,"exclusiveMaximum":false,"minimum":-1000000000,"exclusiveMinimum":false,"type":"number"}} - > - - - - - - - - - - - - - - - -
-- ] --- - - - - - - - - -
-- ] --- - - - - - - - -- -- - - - - - -- -
-- ] --- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/stream-experiment-items.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/stream-experiment-items.api.mdx index 41a55374f1..29e42ce6c0 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/stream-experiment-items.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/stream-experiment-items.api.mdx @@ -5,25 +5,20 @@ description: "Stream experiment items" sidebar_label: "Stream experiment items" hide_title: true hide_table_of_contents: true -api: eJx9Vm1v2zYQ/is3fgxky0madBOGAWkadEG7tUhSDEMcxGfqZLGmSJWk7KiG//twlPyWJssHS6Hujs8997oSAWdeZPfi6qkmpyoywYuHROTkpVN1UNaITNwGR1gBbWVABaq8SIStySFLXeciEz7K7Uxd91KOvjfkwzubtyJbCWlNIBP4FetaKxktpN88X7YSXpZUIb+xnnKUM8Dd5Y8GK2KQoa1JZMJOv5EMIhG1YzhBkWfl5wrZaqPgg1NmJtaJ0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B9KDf1u39A0W1IUbQUUoKeEg6ErmEJ7dG/CVjVrCvKMM4P7+ni+P/AUwE+9TiG/tzkQOM9Ha6Ebr4dmIq8VMZIMKxlBZp/5IEb6jgI0aLamdCRbcbBfjmx8sBFwSBxUjc9R5m3HuWRtQp+EIpKUuDvv4SfL33xM6cnAPjaNSPYzh2oJfq1BUzGH0HNFbBhPZA1l7qZmlNCgw4Su0KpYcxyxGUgWYxxCsAal8o7ElCeuKDFR2RemAwdceDufE58sP9zuyvSHHAQxVqmBK0uCZPiD6wwkW4WmSFD+l4gOX1FivgnU8wO53hZfKU3eaK8h42rF31mBRERyPp3uG+u6C6e3YusWkV/WTDxfvz3+9Oh8dj6fjKtQ6zarkfFe0j8bT8ZQfcbOs0ews9fIZea/u75x+v6LSd/FAD2HSaFSG10z4H/sGfSNWR2mcSC1672Dlt+e0rD+R8yTPWc1qj49z9PTZ6c2GH/8eybUiv7nlkdwpnHPruuEBt4vF1NmX1IpcvO+Aj64Z3HaCf36E51beaZwVBTXhBdm9Myi37u0k8unj1bXIxLz/u6BOQ5JwuObhC9ciF+mfh1Q300mGnz0KjWYR04gkOhz8+S9nutp9 sidebar_class_name: "post api-method" info_path: reference/rest_api/opik-rest-api custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,409 +47,26 @@ Stream experiment items > -+ + + + - - ----
- Body -
-- --
-- - - - - - --+ + + +--- -- -- - - Experiment items stream or error during process - - ---- -- -- -- --- - Schema - -
- --
-- -
- Array [ --- - anyOf -- -- - - - - - - - - - - - - - --- - - feedback_scores - - object[] - - -
--- -
- Array [ --- - - - = -1000000000` and `<= 1000000000`"} - schema={{"maximum":1000000000,"exclusiveMaximum":false,"minimum":-1000000000,"exclusiveMinimum":false,"type":"number"}} - > - - - - - - - - - - - - - - - -
-- ] --- - - - - - - - -- -- - - - - - -- -
-- ] --- -- - -+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/update-dataset.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/update-dataset.api.mdx index 4c8a619121..18a6fdc4f3 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/update-dataset.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/update-dataset.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";@@ -51,102 +47,26 @@ Update dataset by id > -+ + + +- -
- Path Parameters -
----
-- - -+ + - - ----
- Body -
-- --
-- - - - --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/update-feedback-definition.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/update-feedback-definition.api.mdx index f8513bbf34..2f873f6337 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/update-feedback-definition.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/update-feedback-definition.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- -- - - No content - - -- --@@ -51,272 +47,26 @@ Update feedback definition by id > -+ + + +- -
- Path Parameters -
----
-- - -+ + - - ----
- Body -
-- --
-- - - - --- - - type - - string - - required - --- - - **Possible values:** [`numerical`, `categorical`] - - -- -- - ---- - - details - - object - - -
--- - - - -- -- ---- - - details - - object - - -
--- ---- - - categories - - object - - - - required - - -
--- - --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/update-project.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/update-project.api.mdx index 6e058349cb..3edd881b84 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/update-project.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/update-project.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- -- - - No Content - - -- --@@ -51,284 +47,26 @@ Update project by id > -+ + + +- -
- Path Parameters -
----
-- - -+ + - - ----
- Body -
-- --
-- - - - --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/update-prompt.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/update-prompt.api.mdx index 8df37b830f..fdbd859678 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/update-prompt.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/update-prompt.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- - - - No Content - - -- --- - - - Bad Request - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -- -- - - Unprocessable Content - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -@@ -51,466 +47,26 @@ Update prompt > -+ + + +- -
- Path Parameters -
----
-- - -+ + - - ----
- Body -
-- --
-- - - - --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/update-span.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/update-span.api.mdx index b65ee2f209..308cfd49c0 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/update-span.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/update-span.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- - - - No content - - -- --- - - - Bad Request - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -- - - - Not Found - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -- - - - Conflict - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -- -- - - Unprocessable Content - - ---- -- -- -- --- - Schema - -
- --
-- - - - - - -- -- - -@@ -51,218 +47,26 @@ Update span by id > -+ + + +- -
- Path Parameters -
----
-- - -+ + - - ----
- Body -
-- --
-- - - - - - - - - - - - - - - - - - - ---- - - usage - - object - - -
--- - --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/update-trace.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/update-trace.api.mdx index 70681fee23..5c2b4e7f00 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/update-trace.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/update-trace.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- - - - No Content - - -- --- -- - - Not found - - -- --@@ -51,147 +47,26 @@ Update trace by id > -+ + + +- -
- Path Parameters -
----
-- - -+ + - - ----
- Body -
-- --
-- - - - - - - - - - - - - - --+ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/docs/reference/rest_api/version.api.mdx b/apps/opik-documentation/documentation/docs/reference/rest_api/version.api.mdx index d5db7589e0..2005cc976b 100644 --- a/apps/opik-documentation/documentation/docs/reference/rest_api/version.api.mdx +++ b/apps/opik-documentation/documentation/docs/reference/rest_api/version.api.mdx @@ -12,18 +12,13 @@ custom_edit_url: null hide_send_button: true --- -import ApiTabs from "@theme/ApiTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import Heading from "@theme/Heading"; +import ParamsDetails from "@theme/ParamsDetails"; +import RequestSchema from "@theme/RequestSchema"; +import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; +import Heading from "@theme/Heading";--- -- -- - - No Content - - -- --@@ -43,68 +39,26 @@ import TabItem from "@theme/TabItem"; version - -+--- -- -- - - default response - - ---- -- -- -- ---- - Schema - -
- -- any -
-+ + + ++ + + ++ + + + \ No newline at end of file diff --git a/apps/opik-documentation/documentation/rest_api/opik.yaml b/apps/opik-documentation/documentation/rest_api/opik.yaml index 25835c6924..def028a786 100644 --- a/apps/opik-documentation/documentation/rest_api/opik.yaml +++ b/apps/opik-documentation/documentation/rest_api/opik.yaml @@ -2294,6 +2294,8 @@ components: last_updated_by: type: string readOnly: true + prompt_version: + $ref: "#/components/schemas/PromptVersion" FeedbackScoreAverage: required: - name @@ -2305,6 +2307,41 @@ components: value: type: number readOnly: true + PromptVersion: + required: + - template + type: object + properties: + id: + type: string + description: "version unique identifier, generated if absent" + format: uuid + prompt_id: + type: string + format: uuid + readOnly: true + commit: + pattern: "^[a-zA-Z0-9]{8}$" + type: string + description: "version short unique identifier, generated if absent. it must\ + \ be 8 characters long" + template: + type: string + variables: + uniqueItems: true + type: array + readOnly: true + items: + type: string + readOnly: true + created_at: + type: string + format: date-time + readOnly: true + created_by: + type: string + readOnly: true + readOnly: true Experiment_Write: required: - dataset_name @@ -2319,6 +2356,16 @@ components: type: string metadata: $ref: "#/components/schemas/JsonNode_Write" + prompt_version: + $ref: "#/components/schemas/PromptVersion_Write" + PromptVersion_Write: + required: + - id + type: object + properties: + id: + type: string + format: uuid ExperimentItemsBatch: required: - experiment_items @@ -2414,6 +2461,8 @@ components: last_updated_by: type: string readOnly: true + prompt_version: + $ref: "#/components/schemas/PromptVersion_Public" FeedbackScoreAverage_Public: required: - name @@ -2425,6 +2474,33 @@ components: value: type: number readOnly: true + PromptVersion_Public: + required: + - template + type: object + properties: + id: + type: string + description: "version unique identifier, generated if absent" + format: uuid + prompt_id: + type: string + format: uuid + readOnly: true + commit: + pattern: "^[a-zA-Z0-9]{8}$" + type: string + description: "version short unique identifier, generated if absent. it must\ + \ be 8 characters long" + template: + type: string + created_at: + type: string + format: date-time + readOnly: true + created_by: + type: string + readOnly: true ErrorMessage_Public: type: object properties: @@ -3002,41 +3078,6 @@ components: readOnly: true latest_version: $ref: "#/components/schemas/PromptVersion" - PromptVersion: - required: - - template - type: object - properties: - id: - type: string - description: "version unique identifier, generated if absent" - format: uuid - prompt_id: - type: string - format: uuid - readOnly: true - commit: - pattern: "^[a-zA-Z0-9]{8}$" - type: string - description: "version short unique identifier, generated if absent. it must\ - \ be 8 characters long" - template: - type: string - variables: - uniqueItems: true - type: array - readOnly: true - items: - type: string - readOnly: true - created_at: - type: string - format: date-time - readOnly: true - created_by: - type: string - readOnly: true - readOnly: true Prompt_Write: required: - name @@ -3156,33 +3197,6 @@ components: type: array items: $ref: "#/components/schemas/PromptVersion_Public" - PromptVersion_Public: - required: - - template - type: object - properties: - id: - type: string - description: "version unique identifier, generated if absent" - format: uuid - prompt_id: - type: string - format: uuid - readOnly: true - commit: - pattern: "^[a-zA-Z0-9]{8}$" - type: string - description: "version short unique identifier, generated if absent. it must\ - \ be 8 characters long" - template: - type: string - created_at: - type: string - format: date-time - readOnly: true - created_by: - type: string - readOnly: true PromptPage_Public: type: object properties: @@ -3541,7 +3555,6 @@ components: $ref: "#/components/schemas/FeedbackScoreBatchItem" FeedbackScoreBatchItem: required: - - entity_id - id - name - source @@ -3551,9 +3564,6 @@ components: id: type: string format: uuid - entity_id: - type: string - format: uuid project_name: pattern: (?s)^\s*(\S.*\S|\S)\s*$ type: string diff --git a/sdks/python/examples/evaluate_existing_experiment.py b/sdks/python/examples/evaluate_existing_experiment.py index d9f8e36058..c15b362441 100644 --- a/sdks/python/examples/evaluate_existing_experiment.py +++ b/sdks/python/examples/evaluate_existing_experiment.py @@ -15,6 +15,6 @@ def score(self, **ignored_kwargs): evaluate_experiment( - experiment_name="surprised_herb_1466", + experiment_name="round_trellis_3225", scoring_metrics=[MyCustomMetric(name="custom-metric")], ) diff --git a/sdks/python/examples/evaluation_example.py b/sdks/python/examples/evaluation_example.py index fc81c52cbb..3a67f51ab6 100644 --- a/sdks/python/examples/evaluation_example.py +++ b/sdks/python/examples/evaluation_example.py @@ -55,8 +55,6 @@ def llm_task(item: Dict[str, Any]) -> Dict[str, Any]: return { "output": response.choices[0].message.content, - "input": item["input"]["message"], - "context": item["input"]["context"], "reference": "test", } diff --git a/sdks/python/src/opik/evaluation/evaluator.py b/sdks/python/src/opik/evaluation/evaluator.py index 6cfee67e4d..52bd42c16d 100644 --- a/sdks/python/src/opik/evaluation/evaluator.py +++ b/sdks/python/src/opik/evaluation/evaluator.py @@ -1,4 +1,4 @@ -from typing import List, Dict, Any, Optional +from typing import List, Dict, Any, Optional, Union, Callable import time from .types import LLMTask @@ -21,6 +21,9 @@ def evaluate( nb_samples: Optional[int] = None, task_threads: int = 16, prompt: Optional[Prompt] = None, + scoring_key_mapping: Optional[ + Dict[str, Union[str, Callable[[Dict[str, Any]], Any]]] + ] = None, ) -> evaluation_result.EvaluationResult: """ Performs task evaluation on a given dataset. @@ -56,6 +59,11 @@ def evaluate( Use more than 1 worker if your task object is compatible with sharing across threads. prompt: Prompt object to link with experiment. + + scoring_key_mapping: A dictionary that allows you to rename keys present in either the dataset item or the task output + so that they match the keys expected by the scoring metrics. For example if you have a dataset item with the following content: + {"user_question": "What is Opik ?"} and a scoring metric that expects a key "input", you can use scoring_key_mapping + `{"input": "user_question"}` to map the "user_question" key to "input". """ client = opik_client.get_client_cached() if scoring_metrics is None: @@ -72,6 +80,7 @@ def evaluate( workers=task_threads, verbose=verbose, project_name=project_name, + scoring_key_mapping=scoring_key_mapping, ) total_time = time.time() - start_time @@ -117,6 +126,9 @@ def evaluate_experiment( scoring_metrics: List[base_metric.BaseMetric], scoring_threads: int = 16, verbose: int = 1, + scoring_key_mapping: Optional[ + Dict[str, Union[str, Callable[[Dict[str, Any]], Any]]] + ] = None, ) -> evaluation_result.EvaluationResult: """Update existing experiment with new evaluation metrics. @@ -132,6 +144,11 @@ def evaluate_experiment( scoring_threads: amount of thread workers to run scoring metrics. verbose: an integer value that controls evaluation output logs such as summary and tqdm progress bar. + + scoring_key_mapping: A dictionary that allows you to rename keys present in either the dataset item or the task output + so that they match the keys expected by the scoring metrics. For example if you have a dataset item with the following content: + {"user_question": "What is Opik ?"} and a scoring metric that expects a key "input", you can use scoring_key_mapping + `{"input": "user_question"}` to map the "user_question" key to "input". """ start_time = time.time() @@ -142,7 +159,10 @@ def evaluate_experiment( ) test_cases = utils.get_experiment_test_cases( - client=client, experiment_id=experiment.id, dataset_id=experiment.dataset_id + client=client, + experiment_id=experiment.id, + dataset_id=experiment.dataset_id, + scoring_key_mapping=scoring_key_mapping, ) test_results = tasks_scorer.score( diff --git a/sdks/python/src/opik/evaluation/metrics/arguments_helpers.py b/sdks/python/src/opik/evaluation/metrics/arguments_helpers.py index d77de865da..4cdd96ec03 100644 --- a/sdks/python/src/opik/evaluation/metrics/arguments_helpers.py +++ b/sdks/python/src/opik/evaluation/metrics/arguments_helpers.py @@ -1,7 +1,11 @@ -from typing import List, Callable, Dict, Any +from typing import List, Callable, Dict, Any, Optional, Union import inspect from opik import exceptions +import logging + +LOGGER = logging.getLogger(__name__) + def raise_if_score_arguments_are_missing( score_function: Callable, score_name: str, kwargs: Dict[str, Any] @@ -25,7 +29,34 @@ def raise_if_score_arguments_are_missing( if len(missing_required_arguments) > 0: raise exceptions.ScoreMethodMissingArguments( - f"The scoring object {score_name} is missing arguments: {missing_required_arguments}. " - f"These keys were not present in the dictionary returned by the evaluation task. " - f"Evaluation task dictionary keys found: {list(kwargs.keys())}." + f"The scoring method {score_name} is missing arguments: {missing_required_arguments}. " + f"These keys were not present in either the dataset item or the dictionary returned by the evaluation task. " + f"You can either update the dataset or evaluation task to return this key or use the `scoring_key_mapping` to map existing items to the expected arguments." + f"The available keys found in the dataset item and evaluation task output are: {list(kwargs.keys())}." ) + + +def create_scoring_inputs( + dataset_item: Dict[str, Any], + task_output: Dict[str, Any], + scoring_key_mapping: Optional[ + Dict[str, Union[str, Callable[[Dict[str, Any]], Any]]] + ], +) -> Dict[str, Any]: + mapped_inputs = {**dataset_item, **task_output} + + if scoring_key_mapping is None: + return mapped_inputs + else: + for key, value in scoring_key_mapping.items(): + if callable(value): + mapped_inputs[key] = value(dataset_item) + else: + if value not in mapped_inputs: + LOGGER.debug( + f"Scoring key mapping value {value} not found in dataset item. Available keys: {list(mapped_inputs.keys())}" + ) + else: + mapped_inputs[key] = mapped_inputs[value] + + return mapped_inputs diff --git a/sdks/python/src/opik/evaluation/tasks_scorer.py b/sdks/python/src/opik/evaluation/tasks_scorer.py index 00fb74ed1c..b3a110e6d9 100644 --- a/sdks/python/src/opik/evaluation/tasks_scorer.py +++ b/sdks/python/src/opik/evaluation/tasks_scorer.py @@ -2,7 +2,7 @@ import logging from concurrent import futures -from typing import List, Optional +from typing import List, Optional, Dict, Any, Union, Callable from .types import LLMTask from opik.api_objects.dataset import dataset, dataset_item from opik.api_objects import opik_client, trace @@ -22,7 +22,7 @@ def _score_test_case( for metric in scoring_metrics: try: - score_kwargs = test_case_.task_output + score_kwargs = test_case_.scoring_inputs arguments_helpers.raise_if_score_arguments_are_missing( score_function=metric.score, score_name=metric.name, @@ -56,12 +56,34 @@ def _score_test_case( return test_result_ +def _create_scoring_inputs( + item: Dict[str, Any], + task_output: Dict[str, Any], + scoring_key_mapping: Optional[ + Dict[str, Union[str, Callable[[Dict[str, Any]], Any]]] + ], +) -> Dict[str, Any]: + mapped_inputs = {**item, **task_output} + + if scoring_key_mapping is not None: + for k, v in scoring_key_mapping.items(): + if callable(v): + mapped_inputs[k] = v(item) + else: + mapped_inputs[k] = mapped_inputs[v] + + return mapped_inputs + + def _process_item( client: opik_client.Opik, item: dataset_item.DatasetItem, task: LLMTask, scoring_metrics: List[base_metric.BaseMetric], project_name: Optional[str], + scoring_key_mapping: Optional[ + Dict[str, Union[str, Callable[[Dict[str, Any]], Any]]] + ], ) -> test_result.TestResult: try: trace_data = trace.TraceData( @@ -74,9 +96,16 @@ def _process_item( task_output_ = task(item.get_content()) opik_context.update_current_trace(output=task_output_) + scoring_inputs = arguments_helpers.create_scoring_inputs( + dataset_item=item.get_content(), + task_output=task_output_, + scoring_key_mapping=scoring_key_mapping, + ) + test_case_ = test_case.TestCase( trace_id=trace_data.id, dataset_item_id=item.id, + scoring_inputs=scoring_inputs, task_output=task_output_, ) @@ -102,6 +131,9 @@ def run( nb_samples: Optional[int], verbose: int, project_name: Optional[str], + scoring_key_mapping: Optional[ + Dict[str, Union[str, Callable[[Dict[str, Any]], Any]]] + ], ) -> List[test_result.TestResult]: dataset_items = dataset_.__internal_api__get_items_as_dataclasses__( nb_samples=nb_samples @@ -116,6 +148,7 @@ def run( task=task, scoring_metrics=scoring_metrics, project_name=project_name, + scoring_key_mapping=scoring_key_mapping, ) for item in tqdm.tqdm( dataset_items, @@ -129,7 +162,13 @@ def run( with futures.ThreadPoolExecutor(max_workers=workers) as pool: test_case_futures = [ pool.submit( - _process_item, client, item, task, scoring_metrics, project_name + _process_item, + client=client, + item=item, + task=task, + scoring_metrics=scoring_metrics, + project_name=project_name, + scoring_key_mapping=scoring_key_mapping, ) for item in dataset_items ] diff --git a/sdks/python/src/opik/evaluation/test_case.py b/sdks/python/src/opik/evaluation/test_case.py index 98c66e3ded..13585e0970 100644 --- a/sdks/python/src/opik/evaluation/test_case.py +++ b/sdks/python/src/opik/evaluation/test_case.py @@ -6,4 +6,5 @@ class TestCase: trace_id: str dataset_item_id: str + scoring_inputs: Dict[str, Any] task_output: Dict[str, Any] diff --git a/sdks/python/src/opik/evaluation/utils.py b/sdks/python/src/opik/evaluation/utils.py index 1e0b00ca2d..64cab83400 100644 --- a/sdks/python/src/opik/evaluation/utils.py +++ b/sdks/python/src/opik/evaluation/utils.py @@ -1,9 +1,9 @@ -from typing import List +from typing import List, Optional, Dict, Union, Any, Callable -from opik.api_objects import opik_client -from opik.evaluation import test_case - -from opik.rest_api.experiments.client import ExperimentPublic +from ..api_objects import opik_client +from . import test_case +from ..rest_api.experiments.client import ExperimentPublic +from .metrics import arguments_helpers def get_experiment_by_name( @@ -31,7 +31,12 @@ def get_trace_project_name(client: opik_client.Opik, trace_id: str) -> str: def get_experiment_test_cases( - client: opik_client.Opik, experiment_id: str, dataset_id: str + client: opik_client.Opik, + experiment_id: str, + dataset_id: str, + scoring_key_mapping: Optional[ + Dict[str, Union[str, Callable[[Dict[str, Any]], Any]]] + ], ) -> List[test_case.TestCase]: test_cases = [] page = 1 @@ -47,11 +52,17 @@ def get_experiment_test_cases( for item in experiment_items_page.content: experiment_item = item.experiment_items[0] + test_cases += [ test_case.TestCase( trace_id=experiment_item.trace_id, dataset_item_id=experiment_item.dataset_item_id, task_output=experiment_item.output, + scoring_inputs=arguments_helpers.create_scoring_inputs( + dataset_item=experiment_item.input, + task_output=experiment_item.output, + scoring_key_mapping=scoring_key_mapping, + ), ) ] diff --git a/sdks/python/tests/e2e/test_experiment.py b/sdks/python/tests/e2e/test_experiment.py index 6f41b89fc2..68aed31cda 100644 --- a/sdks/python/tests/e2e/test_experiment.py +++ b/sdks/python/tests/e2e/test_experiment.py @@ -34,20 +34,11 @@ def test_experiment_creation_via_evaluate_function__happyflow( def task(item: Dict[str, Any]): if item["input"] == {"question": "What is the of capital of France?"}: - return { - "output": "Paris", - "reference": item["expected_model_output"]["output"], - } + return {"output": "Paris"} if item["input"] == {"question": "What is the of capital of Germany?"}: - return { - "output": "Berlin", - "reference": item["expected_model_output"]["output"], - } + return {"output": "Berlin"} if item["input"] == {"question": "What is the of capital of Poland?"}: - return { - "output": "Krakow", - "reference": item["expected_model_output"]["output"], - } + return {"output": "Krakow"} raise AssertionError( f"Task received dataset item with an unexpected input: {item['input']}" @@ -67,6 +58,9 @@ def task(item: Dict[str, Any]): experiment_config={ "model_name": "gpt-3.5", }, + scoring_key_mapping={ + "reference": lambda x: x["expected_model_output"]["output"], + }, prompt=prompt, ) @@ -108,7 +102,7 @@ def test_experiment_creation__experiment_config_not_set__None_metadata_sent_to_b [ { "input": {"question": "What is the of capital of France?"}, - "expected_model_output": {"output": "Paris"}, + "reference": "Paris", }, ] ) @@ -117,7 +111,6 @@ def task(item: dataset_item.DatasetItem): if item["input"] == {"question": "What is the of capital of France?"}: return { "output": "Paris", - "reference": item["expected_model_output"]["output"], } raise AssertionError( @@ -156,17 +149,14 @@ def test_experiment_creation__name_can_be_omitted( [ { "input": {"question": "What is the of capital of France?"}, - "expected_model_output": {"output": "Paris"}, + "reference": "Paris", }, ] ) def task(item: dataset_item.DatasetItem): if item["input"] == {"question": "What is the of capital of France?"}: - return { - "output": "Paris", - "reference": item["expected_model_output"]["output"], - } + return {"output": "Paris"} raise AssertionError( f"Task received dataset item with an unexpected input: {item['input']}" diff --git a/sdks/python/tests/unit/evaluation/test_create_scoring_inputs.py b/sdks/python/tests/unit/evaluation/test_create_scoring_inputs.py new file mode 100644 index 0000000000..7877cb60fb --- /dev/null +++ b/sdks/python/tests/unit/evaluation/test_create_scoring_inputs.py @@ -0,0 +1,89 @@ +from opik.evaluation.metrics.arguments_helpers import create_scoring_inputs +from ...testlib.assert_helpers import assert_dicts_equal + + +def test_create_scoring_inputs_no_mapping(): + """Test when scoring_key_mapping is None""" + dataset_item = {"input": "hello", "expected": "world"} + task_output = {"output": "hello, world"} + + result = create_scoring_inputs( + dataset_item=dataset_item, task_output=task_output, scoring_key_mapping=None + ) + + expected = {"input": "hello", "expected": "world", "output": "hello, world"} + assert result == expected + + +def test_create_scoring_inputs_string_mapping(): + """Test when scoring_key_mapping contains string mappings""" + dataset_item = {"input": "hello", "ground_truth": "world"} + task_output = {"model_output": "hello, world"} + + mapping = {"expected": "ground_truth", "output": "model_output"} + + result = create_scoring_inputs( + dataset_item=dataset_item, task_output=task_output, scoring_key_mapping=mapping + ) + + expected = { + "input": "hello", + "ground_truth": "world", + "model_output": "hello, world", + "expected": "world", + "output": "hello, world", + } + assert_dicts_equal(result, expected) + + +def test_create_scoring_inputs_callable_mapping(): + """Test when scoring_key_mapping contains callable mappings for nested dictionaries""" + dataset_item = { + "input": {"message": "hello"}, + "expected_output": {"message": "world"}, + } + task_output = {"result": "hello world"} + + mapping = {"reference": lambda x: x["expected_output"]["message"]} + + result = create_scoring_inputs( + dataset_item=dataset_item, task_output=task_output, scoring_key_mapping=mapping + ) + + expected = { + "input": {"message": "hello"}, + "expected_output": {"message": "world"}, + "result": "hello world", + "reference": "world", + } + assert_dicts_equal(result, expected) + + +def test_create_scoring_inputs_missing_mapping_key(): + """Test when a mapped key doesn't exist in the inputs""" + dataset_item = {"input": "hello"} + task_output = {"output": "world"} + + mapping = { + "expected": "ground_truth" # This key doesn't exist in inputs + } + + result = create_scoring_inputs( + dataset_item=dataset_item, task_output=task_output, scoring_key_mapping=mapping + ) + + expected = {"input": "hello", "output": "world"} + assert_dicts_equal(result, expected) + + +def test_create_scoring_inputs_empty_mapping(): + """Test when scoring_key_mapping is an empty dictionary""" + dataset_item = {"input": "hello"} + task_output = {"output": "world"} + + result = create_scoring_inputs( + dataset_item=dataset_item, task_output=task_output, scoring_key_mapping={} + ) + + expected = {"input": "hello", "output": "world"} + assert_dicts_equal(result, expected) diff --git a/sdks/python/tests/unit/evaluation/test_evaluate.py b/sdks/python/tests/unit/evaluation/test_evaluate.py index 27e40af105..961ee8184f 100644 --- a/sdks/python/tests/unit/evaluation/test_evaluate.py +++ b/sdks/python/tests/unit/evaluation/test_evaluate.py @@ -14,6 +14,114 @@ def test_evaluate_happyflow(fake_backend): + mock_dataset = mock.MagicMock(spec=["__internal_api__get_items_as_dataclasses__"]) + mock_dataset.name = "the-dataset-name" + mock_dataset.__internal_api__get_items_as_dataclasses__.return_value = [ + dataset_item.DatasetItem( + id="dataset-item-id-1", + input={"message": "say hello"}, + reference="hello", + ), + dataset_item.DatasetItem( + id="dataset-item-id-2", + input={"message": "say bye"}, + reference="bye", + ), + ] + + def say_task(dataset_item: Dict[str, Any]): + if dataset_item["input"]["message"] == "say hello": + return {"output": "hello"} + + if dataset_item["input"]["message"] == "say bye": + return {"output": "not bye"} + + raise Exception + + mock_experiment = mock.Mock() + mock_create_experiment = mock.Mock() + mock_create_experiment.return_value = mock_experiment + + mock_get_experiment_url = mock.Mock() + mock_get_experiment_url.return_value = "any_url" + + with mock.patch.object( + opik_client.Opik, "create_experiment", mock_create_experiment + ): + with mock.patch.object( + url_helpers, "get_experiment_url", mock_get_experiment_url + ): + evaluation.evaluate( + dataset=mock_dataset, + task=say_task, + experiment_name="the-experiment-name", + scoring_metrics=[metrics.Equals()], + task_threads=1, + ) + + mock_dataset.__internal_api__get_items_as_dataclasses__.assert_called_once() + + mock_create_experiment.assert_called_once_with( + dataset_name="the-dataset-name", + name="the-experiment-name", + experiment_config=None, + prompt=None, + ) + mock_experiment.insert.assert_called_once_with( + experiment_items=[mock.ANY, mock.ANY] + ) + + EXPECTED_TRACE_TREES = [ + TraceModel( + id=ANY_BUT_NONE, + name="evaluation_task", + input={ + "input": {"message": "say hello"}, + "reference": "hello", + }, + output={ + "output": "hello", + }, + start_time=ANY_BUT_NONE, + end_time=ANY_BUT_NONE, + spans=[], + feedback_scores=[ + FeedbackScoreModel( + id=ANY_BUT_NONE, + name="equals_metric", + value=1.0, + ) + ], + ), + TraceModel( + id=ANY_BUT_NONE, + name="evaluation_task", + input={ + "input": {"message": "say bye"}, + "reference": "bye", + }, + output={ + "output": "not bye", + }, + start_time=ANY_BUT_NONE, + end_time=ANY_BUT_NONE, + spans=[], + feedback_scores=[ + FeedbackScoreModel( + id=ANY_BUT_NONE, + name="equals_metric", + value=0.0, + ) + ], + ), + ] + for expected_trace, actual_trace in zip( + EXPECTED_TRACE_TREES, fake_backend.trace_trees + ): + assert_equal(expected_trace, actual_trace) + + +def test_evaluate_with_scoring_key_mapping(fake_backend): mock_dataset = mock.MagicMock(spec=["__internal_api__get_items_as_dataclasses__"]) mock_dataset.name = "the-dataset-name" mock_dataset.__internal_api__get_items_as_dataclasses__.return_value = [ @@ -31,16 +139,10 @@ def test_evaluate_happyflow(fake_backend): def say_task(dataset_item: Dict[str, Any]): if dataset_item["input"]["message"] == "say hello": - return { - "output": "hello", - "reference": dataset_item["expected_output"]["message"], - } + return {"result": "hello"} if dataset_item["input"]["message"] == "say bye": - return { - "output": "not bye", - "reference": dataset_item["expected_output"]["message"], - } + return {"result": "not bye"} raise Exception @@ -63,6 +165,10 @@ def say_task(dataset_item: Dict[str, Any]): experiment_name="the-experiment-name", scoring_metrics=[metrics.Equals()], task_threads=1, + scoring_key_mapping={ + "output": "result", + "reference": lambda x: x["expected_output"]["message"], + }, ) mock_dataset.__internal_api__get_items_as_dataclasses__.assert_called_once() @@ -86,8 +192,7 @@ def say_task(dataset_item: Dict[str, Any]): "expected_output": {"message": "hello"}, }, output={ - "output": "hello", - "reference": "hello", + "result": "hello", }, start_time=ANY_BUT_NONE, end_time=ANY_BUT_NONE, @@ -108,8 +213,7 @@ def say_task(dataset_item: Dict[str, Any]): "expected_output": {"message": "bye"}, }, output={ - "output": "not bye", - "reference": "bye", + "result": "not bye", }, start_time=ANY_BUT_NONE, end_time=ANY_BUT_NONE,