From 41083c74570e433632c698f6f24a6eb6ee919b02 Mon Sep 17 00:00:00 2001 From: Clement Bouvet Date: Mon, 26 Jan 2026 12:00:33 +0100 Subject: [PATCH] feat: add optional tags field to completion requests Add support for tagging requests with custom string labels for better request categorization and tracking in the AI gateway. Co-Authored-By: Claude Opus 4.5 --- edgee/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/edgee/__init__.py b/edgee/__init__.py index 5229fd3..65f5dc2 100644 --- a/edgee/__init__.py +++ b/edgee/__init__.py @@ -45,6 +45,7 @@ class InputObject: messages: list[dict] tools: list[dict] | None = None tool_choice: str | dict | None = None + tags: list[str] | None = None @dataclass @@ -188,14 +189,17 @@ def send( messages = [{"role": "user", "content": input}] tools = None tool_choice = None + tags = None elif isinstance(input, InputObject): messages = input.messages tools = input.tools tool_choice = input.tool_choice + tags = input.tags else: messages = input.get("messages", []) tools = input.get("tools") tool_choice = input.get("tool_choice") + tags = input.get("tags") body: dict = {"model": model, "messages": messages} if stream: @@ -204,6 +208,8 @@ def send( body["tools"] = tools if tool_choice: body["tool_choice"] = tool_choice + if tags: + body["tags"] = tags request = Request( f"{self.base_url}{API_ENDPOINT}",