gateforge-sdk 0.2.7__tar.gz → 0.2.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/PKG-INFO +1 -1
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/client.py +1 -1
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/context.py +13 -8
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/pyproject.toml +1 -1
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/.env.example +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/.gitignore +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/.pypirc.example +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/INSTALL.md +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/LICENSE +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/MANIFEST.in +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/PUBLISHING.md +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/PUBLISH_NOW.md +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/README.md +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/__init__.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/ab/__init__.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/ab/engine.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/config.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/features/__init__.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/guardrails/__init__.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/guardrails/engine.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/metrics.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/options.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/pii.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/pricing.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/prompt.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/providers/__init__.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/providers/anthropic.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/providers/gemini.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/providers/openai.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/response.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/session_manager.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/tracing.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/wrappers/__init__.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/wrappers/anthropic.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/wrappers/gemini.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/gateforge/wrappers/openai.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/tests/__init__.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/tests/test_metrics.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/tests/test_phase1.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/tests/test_phase2.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/tests/test_phase3.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/tests/test_pii.py +0 -0
- {gateforge_sdk-0.2.7 → gateforge_sdk-0.2.9}/tests/test_providers.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gateforge-sdk
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.9
|
|
4
4
|
Summary: Privacy-first LLMOps SDK — Auto-init, decorators, session management, prompt system with cache
|
|
5
5
|
Project-URL: Homepage, https://gateforge.dev
|
|
6
6
|
Project-URL: Documentation, https://gateforge.dev/docs
|
|
@@ -260,7 +260,7 @@ class GatforgeClient:
|
|
|
260
260
|
finish_reason=finish_reason,
|
|
261
261
|
experiment_id=ab_assignment.experiment_id if ab_assignment else None,
|
|
262
262
|
variant=ab_assignment.variant if ab_assignment else None,
|
|
263
|
-
content_preview=rehydrated if
|
|
263
|
+
content_preview=rehydrated[:500] if rehydrated else None,
|
|
264
264
|
)
|
|
265
265
|
|
|
266
266
|
return rehydrated, cost_usd
|
|
@@ -215,39 +215,44 @@ def agent(
|
|
|
215
215
|
cid = conversation_id or f"{fn.__name__}-{int(time.time())}"
|
|
216
216
|
is_nested = False
|
|
217
217
|
|
|
218
|
-
# Emit agent start event
|
|
218
|
+
# Emit agent start event — use next_step() when nested so sequential
|
|
219
|
+
# agents get unique, increasing step numbers (fixes DB ordering)
|
|
220
|
+
start_step = active_trace.next_step() if active_trace else 0
|
|
221
|
+
# Capture first string arg as the user input preview (e.g. run_agent("hello"))
|
|
222
|
+
user_input = next((a for a in args if isinstance(a, str) and a.strip()), None)
|
|
219
223
|
emit_trace_event(
|
|
220
224
|
api_key=_get_api_key(),
|
|
221
225
|
base_url=_get_base_url(),
|
|
222
226
|
conversation_id=cid,
|
|
223
227
|
event_type="agent_start",
|
|
224
|
-
step=
|
|
228
|
+
step=start_step,
|
|
229
|
+
content_preview=user_input[:500] if user_input else None,
|
|
225
230
|
metadata={"user_id": user_id, "args": _safe_str(args)[:200], "agent_name": name or fn.__name__, "nested": is_nested},
|
|
226
231
|
)
|
|
227
|
-
|
|
232
|
+
|
|
228
233
|
# Enter trace context (only if not already in one)
|
|
229
234
|
if not is_nested:
|
|
230
235
|
ctx = trace(conversation_id=cid)
|
|
231
236
|
ctx.__enter__()
|
|
232
237
|
else:
|
|
233
238
|
ctx = None # Already in a trace context
|
|
234
|
-
|
|
239
|
+
|
|
235
240
|
try:
|
|
236
241
|
result = fn(*args, **kwargs)
|
|
237
|
-
|
|
238
|
-
|
|
242
|
+
|
|
243
|
+
result_preview = _safe_str(result)[:500] if result is not None else None
|
|
239
244
|
emit_trace_event(
|
|
240
245
|
api_key=_get_api_key(),
|
|
241
246
|
base_url=_get_base_url(),
|
|
242
247
|
conversation_id=cid,
|
|
243
248
|
event_type="agent_end",
|
|
244
249
|
step=active_trace.step if active_trace else ctx.ctx.step,
|
|
250
|
+
content_preview=result_preview,
|
|
245
251
|
metadata={"success": True},
|
|
246
252
|
)
|
|
247
|
-
|
|
253
|
+
|
|
248
254
|
return result
|
|
249
255
|
except Exception as e:
|
|
250
|
-
# Emit agent error event
|
|
251
256
|
emit_trace_event(
|
|
252
257
|
api_key=_get_api_key(),
|
|
253
258
|
base_url=_get_base_url(),
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "gateforge-sdk"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.9"
|
|
8
8
|
description = "Privacy-first LLMOps SDK — Auto-init, decorators, session management, prompt system with cache"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|