@langwatch/server 3.1.0-beta.14 → 3.1.0-beta.16
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
import os
|
|
2
3
|
import time
|
|
3
4
|
from typing import Optional, cast
|
|
4
5
|
import dspy
|
|
@@ -67,7 +68,10 @@ async def execute_evaluation(
|
|
|
67
68
|
module = Module(run_evaluations=True)
|
|
68
69
|
module.prevent_crashes()
|
|
69
70
|
|
|
70
|
-
langwatch.setup(
|
|
71
|
+
langwatch.setup(
|
|
72
|
+
api_key=workflow.api_key,
|
|
73
|
+
endpoint_url=os.environ.get("LANGWATCH_ENDPOINT"),
|
|
74
|
+
)
|
|
71
75
|
|
|
72
76
|
origin = event.origin or "evaluation"
|
|
73
77
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from typing import AsyncGenerator
|
|
2
3
|
|
|
3
4
|
|
|
@@ -46,7 +47,10 @@ async def execute_event(
|
|
|
46
47
|
case "is_alive":
|
|
47
48
|
yield IsAliveResponse()
|
|
48
49
|
case "execute_component":
|
|
49
|
-
langwatch.setup(
|
|
50
|
+
langwatch.setup(
|
|
51
|
+
api_key=event.payload.workflow.api_key,
|
|
52
|
+
endpoint_url=os.environ.get("LANGWATCH_ENDPOINT"),
|
|
53
|
+
)
|
|
50
54
|
try:
|
|
51
55
|
async for event_ in execute_component(event.payload):
|
|
52
56
|
yield event_
|
|
@@ -60,7 +64,10 @@ async def execute_event(
|
|
|
60
64
|
error=_error_repr(e),
|
|
61
65
|
)
|
|
62
66
|
case "execute_flow":
|
|
63
|
-
langwatch.setup(
|
|
67
|
+
langwatch.setup(
|
|
68
|
+
api_key=event.payload.workflow.api_key,
|
|
69
|
+
endpoint_url=os.environ.get("LANGWATCH_ENDPOINT"),
|
|
70
|
+
)
|
|
64
71
|
try:
|
|
65
72
|
async for event_ in execute_flow(event.payload, queue):
|
|
66
73
|
yield event_
|
|
@@ -70,7 +77,10 @@ async def execute_event(
|
|
|
70
77
|
traceback.print_exc()
|
|
71
78
|
yield Error(payload=ErrorPayload(message=_error_repr(e)))
|
|
72
79
|
case "execute_evaluation":
|
|
73
|
-
client = langwatch.setup(
|
|
80
|
+
client = langwatch.setup(
|
|
81
|
+
api_key=event.payload.workflow.api_key,
|
|
82
|
+
endpoint_url=os.environ.get("LANGWATCH_ENDPOINT"),
|
|
83
|
+
)
|
|
74
84
|
client.disable_sending = True
|
|
75
85
|
try:
|
|
76
86
|
async for event_ in execute_evaluation(event.payload, queue):
|
|
@@ -78,7 +88,10 @@ async def execute_event(
|
|
|
78
88
|
except Exception as e:
|
|
79
89
|
yield Error(payload=ErrorPayload(message=_error_repr(e)))
|
|
80
90
|
case "execute_optimization":
|
|
81
|
-
client = langwatch.setup(
|
|
91
|
+
client = langwatch.setup(
|
|
92
|
+
api_key=event.payload.workflow.api_key,
|
|
93
|
+
endpoint_url=os.environ.get("LANGWATCH_ENDPOINT"),
|
|
94
|
+
)
|
|
82
95
|
client.disable_sending = True
|
|
83
96
|
try:
|
|
84
97
|
async for event_ in execute_optimization(event.payload, queue):
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langwatch/server",
|
|
3
|
-
"version": "3.1.0-beta.
|
|
3
|
+
"version": "3.1.0-beta.16",
|
|
4
4
|
"description": "Run LangWatch locally with one command — `npx @langwatch/server`. Bundles the Next.js control plane, Python NLP service, evaluators, and the Go AI gateway with embedded postgres, redis, and clickhouse.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://langwatch.ai",
|
|
@@ -22182,6 +22182,7 @@ function buildEnv({ ports, baseHost, overrides = {} }) {
|
|
|
22182
22182
|
sectionBreak("LANGWATCH INTERNAL SERVICES");
|
|
22183
22183
|
set("LANGWATCH_NLP_SERVICE", `http://localhost:${ports.nlp}`);
|
|
22184
22184
|
set("LANGEVALS_ENDPOINT", `http://localhost:${ports.langevals}`);
|
|
22185
|
+
set("LANGWATCH_ENDPOINT", host);
|
|
22185
22186
|
set("DISABLE_PII_REDACTION", "true");
|
|
22186
22187
|
sectionBreak("AI GATEWAY");
|
|
22187
22188
|
set("LW_VIRTUAL_KEY_PEPPER", hex(32));
|
|
@@ -26908,7 +26909,7 @@ var placeholderRuntime = {
|
|
|
26908
26909
|
};
|
|
26909
26910
|
|
|
26910
26911
|
// src/cli.ts
|
|
26911
|
-
var VERSION = true ? "3.1.0-beta.
|
|
26912
|
+
var VERSION = true ? "3.1.0-beta.16" : "0.0.0-dev";
|
|
26912
26913
|
async function loadRuntime() {
|
|
26913
26914
|
try {
|
|
26914
26915
|
const real = await Promise.resolve().then(() => (init_runtime(), runtime_exports));
|
|
@@ -212,10 +212,21 @@ class Client(LangWatchClientProtocol):
|
|
|
212
212
|
|
|
213
213
|
if endpoint_url is not None:
|
|
214
214
|
Client._endpoint_url = endpoint_url
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
)
|
|
215
|
+
else:
|
|
216
|
+
# Always re-read LANGWATCH_ENDPOINT from env on every setup()
|
|
217
|
+
# call. The previous "pin once on first init" behavior caused
|
|
218
|
+
# Client._endpoint_url to stick at the default (https://app.langwatch.ai)
|
|
219
|
+
# whenever some code path called setup() before the host env had
|
|
220
|
+
# LANGWATCH_ENDPOINT set — most commonly dspy's ProcessPool
|
|
221
|
+
# worker init order, which made every self-host evaluator
|
|
222
|
+
# callback 401 against the cloud API. Re-reading per-call costs
|
|
223
|
+
# one os.getenv lookup; the explicit endpoint_url path above
|
|
224
|
+
# still wins.
|
|
225
|
+
env_endpoint = os.getenv("LANGWATCH_ENDPOINT")
|
|
226
|
+
if env_endpoint:
|
|
227
|
+
Client._endpoint_url = env_endpoint
|
|
228
|
+
elif not Client._endpoint_url:
|
|
229
|
+
Client._endpoint_url = "https://app.langwatch.ai"
|
|
219
230
|
|
|
220
231
|
if debug is not None:
|
|
221
232
|
Client._debug = debug
|