snowglobe 0.4.10__py3-none-any.whl → 0.4.11__py3-none-any.whl
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.
- snowglobe/client/src/app.py +13 -2
- snowglobe/client/src/utils.py +12 -3
- {snowglobe-0.4.10.dist-info → snowglobe-0.4.11.dist-info}/METADATA +1 -1
- {snowglobe-0.4.10.dist-info → snowglobe-0.4.11.dist-info}/RECORD +8 -8
- {snowglobe-0.4.10.dist-info → snowglobe-0.4.11.dist-info}/WHEEL +0 -0
- {snowglobe-0.4.10.dist-info → snowglobe-0.4.11.dist-info}/entry_points.txt +0 -0
- {snowglobe-0.4.10.dist-info → snowglobe-0.4.11.dist-info}/licenses/LICENSE +0 -0
- {snowglobe-0.4.10.dist-info → snowglobe-0.4.11.dist-info}/top_level.txt +0 -0
snowglobe/client/src/app.py
CHANGED
@@ -26,7 +26,7 @@ from snowglobe.client.src.telemetry import trace_completion_fn, trace_risk_evalu
|
|
26
26
|
|
27
27
|
from .cli_utils import info, shutdown_manager
|
28
28
|
from .config import config, get_api_key_or_raise
|
29
|
-
from .models import CompletionFunctionOutputs, CompletionRequest, RiskEvaluationRequest
|
29
|
+
from .models import CompletionFunctionOutputs, CompletionRequest, RiskEvaluationRequest, SnowglobeData, SnowglobeMessage
|
30
30
|
from .stats import initialize_stats, track_batch_completion
|
31
31
|
from .utils import fetch_experiments, fetch_messages
|
32
32
|
|
@@ -129,7 +129,14 @@ async def process_application_heartbeat(app_id):
|
|
129
129
|
}
|
130
130
|
try:
|
131
131
|
prompt = "Hello from Snowglobe!"
|
132
|
-
test_request = CompletionRequest(
|
132
|
+
test_request = CompletionRequest(
|
133
|
+
messages=[SnowglobeMessage(
|
134
|
+
role="user",
|
135
|
+
content=prompt,
|
136
|
+
snowglobe_data=SnowglobeData(
|
137
|
+
conversation_id="test", test_id="test"
|
138
|
+
),
|
139
|
+
)])
|
133
140
|
heartbeat_id = uuid.uuid4().hex
|
134
141
|
agent = apps.get(app_id, {})
|
135
142
|
agent_name = agent.get("name", "")
|
@@ -193,6 +200,10 @@ async def process_application_heartbeat(app_id):
|
|
193
200
|
connection_test_payload["error"] = f"{str(e)}\n{traceback.format_exc()}"
|
194
201
|
connection_test_payload["app_id"] = app_id
|
195
202
|
connection_test_payload["applicationId"] = app_id
|
203
|
+
LOGGER.error(
|
204
|
+
f"Error processing heartbeat for application {app_id}: {connection_test_payload['error']}"
|
205
|
+
)
|
206
|
+
LOGGER.error(traceback.format_exc())
|
196
207
|
|
197
208
|
connection_test_url = (
|
198
209
|
f"{config.CONTROL_PLANE_URL}/api/successful-code-connection-tests"
|
snowglobe/client/src/utils.py
CHANGED
@@ -16,13 +16,22 @@ async def fetch_experiments(app_id: str = None) -> list[dict]:
|
|
16
16
|
list[dict]: A list of experiments.
|
17
17
|
"""
|
18
18
|
async with httpx.AsyncClient() as client:
|
19
|
-
experiments_url = f"{config.CONTROL_PLANE_URL}/api/experiments
|
19
|
+
experiments_url = f"{config.CONTROL_PLANE_URL}/api/experiments?evaluated=false"
|
20
|
+
|
20
21
|
if app_id:
|
21
22
|
experiments_url += f"&appId={config.APPLICATION_ID}"
|
22
|
-
|
23
|
+
try:
|
24
|
+
# get elapsed time for this request
|
25
|
+
import time
|
26
|
+
start_time = time.monotonic()
|
27
|
+
experiments_response = await client.get(
|
23
28
|
experiments_url,
|
24
29
|
headers={"x-api-key": get_api_key_or_raise()},
|
25
|
-
|
30
|
+
timeout=60.0, # Set timeout to 60 seconds
|
31
|
+
)
|
32
|
+
except httpx.ConnectTimeout:
|
33
|
+
elapsed_time = time.monotonic() - start_time
|
34
|
+
raise Exception(f"Warning: Connection timed out while fetching experiments. Elapsed time: {elapsed_time:.2f} seconds. Polling will continue. If this persists please contact Snowglobe support.")
|
26
35
|
|
27
36
|
if not experiments_response.status_code == 200:
|
28
37
|
try:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
snowglobe/client/__init__.py,sha256=kzp9wPUUYBXqDSKZbfmD4vrAQvrWSW5HOvtpFlEJWfs,353
|
2
|
-
snowglobe/client/src/app.py,sha256=
|
2
|
+
snowglobe/client/src/app.py,sha256=QOqwK4134siIDnrlY2vpRJ6DiwDVKVmrJszzp5z_RE0,43117
|
3
3
|
snowglobe/client/src/cli.py,sha256=I3LVWJmyvUzOQlV0gv_AeMuEazfy8GsYdH6svo7cZOU,28544
|
4
4
|
snowglobe/client/src/cli_utils.py,sha256=6C7J5gow8xveQYF4w6ewtQJKI7VvlLTx7FS_7gl7RwI,17227
|
5
5
|
snowglobe/client/src/config.py,sha256=YRx_AQEZoHaAqk6guTxynIEGV_iJ3wNNGtMmaKsYMbc,10488
|
@@ -7,10 +7,10 @@ snowglobe/client/src/models.py,sha256=BX310WrDN9Fd8v68me3XGL_ic1ulvjCrZyIT2ND1eU
|
|
7
7
|
snowglobe/client/src/project_manager.py,sha256=Ze-qs4dQI2kIV-PmtWZ1b67hMUfsnsMHus90aT8HOow,9970
|
8
8
|
snowglobe/client/src/stats.py,sha256=IdaXroOZBmvLVa_p9pDE6hsxsc7-fBEDnLf8O6Ch0GA,1596
|
9
9
|
snowglobe/client/src/telemetry.py,sha256=CLrnKtCRnq-wGraFHdMcgUqY4-YX1JqxQpnAdWy_wok,5679
|
10
|
-
snowglobe/client/src/utils.py,sha256=
|
11
|
-
snowglobe-0.4.
|
12
|
-
snowglobe-0.4.
|
13
|
-
snowglobe-0.4.
|
14
|
-
snowglobe-0.4.
|
15
|
-
snowglobe-0.4.
|
16
|
-
snowglobe-0.4.
|
10
|
+
snowglobe/client/src/utils.py,sha256=F86gku68IyjXzUleZXc9QyzFfWV4PBa9LKukAo9gJl8,4198
|
11
|
+
snowglobe-0.4.11.dist-info/licenses/LICENSE,sha256=S90V6iFU5ZeSg44JQYS1To3pa7ZEobrHc_t483qSKSI,1070
|
12
|
+
snowglobe-0.4.11.dist-info/METADATA,sha256=wExQyglcFQS8zPMvSy81EEin2t7i37XvAb5Ln4XtZIU,5407
|
13
|
+
snowglobe-0.4.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
14
|
+
snowglobe-0.4.11.dist-info/entry_points.txt,sha256=mqx4mTwFPHttjctE2ceYTYWCCIG30Ji2C89aaCYgHcM,71
|
15
|
+
snowglobe-0.4.11.dist-info/top_level.txt,sha256=PoyYihnCBjRyjeIT19yBcE47JTe7i1OwRXvJ4d5EohM,10
|
16
|
+
snowglobe-0.4.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|