Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sdk-js): remove trailing slash from url #2471

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libs/sdk-js/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {

Check notice on line 1 in libs/sdk-js/src/client.ts

View workflow job for this annotation

GitHub Actions / benchmark

Benchmark results

......................................... fanout_to_subgraph_10x: Mean +- std dev: 61.2 ms +- 1.3 ms ......................................... fanout_to_subgraph_10x_sync: Mean +- std dev: 51.1 ms +- 0.7 ms ......................................... fanout_to_subgraph_10x_checkpoint: Mean +- std dev: 91.1 ms +- 7.7 ms ......................................... fanout_to_subgraph_10x_checkpoint_sync: Mean +- std dev: 93.2 ms +- 1.1 ms ......................................... fanout_to_subgraph_100x: Mean +- std dev: 588 ms +- 22 ms ......................................... fanout_to_subgraph_100x_sync: Mean +- std dev: 498 ms +- 5 ms ......................................... fanout_to_subgraph_100x_checkpoint: Mean +- std dev: 915 ms +- 46 ms ......................................... fanout_to_subgraph_100x_checkpoint_sync: Mean +- std dev: 916 ms +- 16 ms ......................................... react_agent_10x: Mean +- std dev: 30.6 ms +- 0.6 ms ......................................... react_agent_10x_sync: Mean +- std dev: 22.2 ms +- 0.2 ms ......................................... react_agent_10x_checkpoint: Mean +- std dev: 46.6 ms +- 0.7 ms ......................................... react_agent_10x_checkpoint_sync: Mean +- std dev: 36.3 ms +- 0.4 ms ......................................... react_agent_100x: Mean +- std dev: 340 ms +- 6 ms ......................................... react_agent_100x_sync: Mean +- std dev: 270 ms +- 4 ms ......................................... react_agent_100x_checkpoint: Mean +- std dev: 937 ms +- 7 ms ......................................... react_agent_100x_checkpoint_sync: Mean +- std dev: 834 ms +- 7 ms ......................................... wide_state_25x300: Mean +- std dev: 23.9 ms +- 0.4 ms ......................................... wide_state_25x300_sync: Mean +- std dev: 15.3 ms +- 0.1 ms ......................................... wide_state_25x300_checkpoint: Mean +- std dev: 278 ms +- 3 ms ......................................... wide_state_25x300_checkpoint_sync: Mean +- std dev: 266 ms +- 3 ms ......................................... wide_state_15x600: Mean +- std dev: 28.0 ms +- 0.4 ms ......................................... wide_state_15x600_sync: Mean +- std dev: 17.7 ms +- 0.2 ms ......................................... wide_state_15x600_checkpoint: Mean +- std dev: 479 ms +- 4 ms ......................................... wide_state_15x600_checkpoint_sync: Mean +- std dev: 466 ms +- 7 ms ......................................... wide_state_9x1200: Mean +- std dev: 28.0 ms +- 0.5 ms ......................................... wide_state_9x1200_sync: Mean +- std dev: 17.7 ms +- 0.1 ms ......................................... wide_state_9x1200_checkpoint: Mean +- std dev: 312 ms +- 3 ms ......................................... wide_state_9x1200_checkpoint_sync: Mean +- std dev: 298 ms +- 5 ms

Check notice on line 1 in libs/sdk-js/src/client.ts

View workflow job for this annotation

GitHub Actions / benchmark

Comparison against main

+-----------------------------------------+---------+-----------------------+ | Benchmark | main | changes | +=========================================+=========+=======================+ | fanout_to_subgraph_100x_checkpoint | 946 ms | 915 ms: 1.03x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x | 606 ms | 588 ms: 1.03x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_10x_checkpoint | 47.4 ms | 46.6 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x_sync | 507 ms | 498 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_25x300 | 24.3 ms | 23.9 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_9x1200 | 28.4 ms | 28.0 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_9x1200_sync | 18.0 ms | 17.7 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_100x_checkpoint_sync | 848 ms | 834 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x_checkpoint_sync | 930 ms | 916 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_100x_checkpoint | 951 ms | 937 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_15x600 | 28.4 ms | 28.0 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_sync | 51.9 ms | 51.1 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_10x_sync | 22.6 ms | 22.2 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_25x300_sync | 15.5 ms | 15.3 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_10x_checkpoint_sync | 36.7 ms | 36.3 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_checkpoint_sync | 94.3 ms | 93.2 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_15x600_sync | 17.9 ms | 17.7 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_100x | 343 ms | 340 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_10x | 30.9 ms | 30.6 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_100x_sync | 272 ms | 270 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x | 61.6 ms | 61.2 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_15x600_checkpoint | 483 ms | 479 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | Geometric mean | (ref) | 1.01x faster | +-----------------------------------------+---------+-----------------------+ Benchmark hidden because not significant (6): fanout_to_subgraph_10x_checkpoint, wide_state_25x300_checkpoint, wide_state_25x300_checkpoint_sync, wide_state_9x1200_checkpoint, wide_state_9x1200_checkpoint_sync, wide_state_15x600_checkpoint_sync
Assistant,
AssistantGraph,
CancelAction,
Expand Down Expand Up @@ -62,7 +62,8 @@

// default limit being capped by Chrome
// https://github.com/nodejs/undici/issues/1373
this.apiUrl = config?.apiUrl || "http://localhost:8123";
// Regex to remove trailing slash, if present
this.apiUrl = config?.apiUrl?.replace(/\/$/, "") || "http://localhost:8123";
this.defaultHeaders = config?.defaultHeaders || {};
if (config?.apiKey != null) {
this.defaultHeaders["X-Api-Key"] = config.apiKey;
Expand Down
Loading