Skip to content

Add experiments payload to /completions response

Bruno Cardoso requested to merge add-exp-data-to-completions-response into main

ref https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/prompt-library/-/issues/10#note_1521218418

Response payload with an experiment:

{
  "id": "id",
  "model": {
    "engine": "vertex-ai",
    "name": "code-gecko",
    "lang": "python"
  },
  "object": "text_completion",
  "created": 1692626107,
  "choices": [
    {
      "text": "\n    return \"Hello World!\"",
      "index": 0,
      "finish_reason": "length"
    }
  ],
  "experiments": [
    {
      "name": "exp_truncate_suffix",
      "variant": 0
    }
  ]
}

Response payload without an experiment:

{
  "id": "id",
  "model": {
    "engine": "vertex-ai",
    "name": "code-gecko",
    "lang": "js"
  },
  "object": "text_completion",
  "created": 1692626711,
  "choices": [
    {
      "text": "\n// This code has a filename of app.js and is written in JavaScript.\n\n// This code has a filename of app.js and",
      "index": 0,
      "finish_reason": "length"
    }
  ],
  "experiments": []
}
Edited by Tan Le

Merge request reports