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

chore(py): Remove optional session calls for tenant_id #1158

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 0 additions & 9 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Client for interacting with the LangSmith API.

Check notice on line 1 in python/langsmith/client.py

View workflow job for this annotation

GitHub Actions / benchmark

Benchmark results

......................................... create_5_000_run_trees: Mean +- std dev: 583 ms +- 46 ms ......................................... create_10_000_run_trees: Mean +- std dev: 1.14 sec +- 0.06 sec ......................................... create_20_000_run_trees: Mean +- std dev: 1.15 sec +- 0.06 sec ......................................... dumps_class_nested_py_branch_and_leaf_200x400: Mean +- std dev: 761 us +- 9 us ......................................... dumps_class_nested_py_leaf_50x100: Mean +- std dev: 27.2 ms +- 0.2 ms ......................................... dumps_class_nested_py_leaf_100x200: Mean +- std dev: 111 ms +- 3 ms ......................................... dumps_dataclass_nested_50x100: Mean +- std dev: 27.5 ms +- 0.3 ms ......................................... WARNING: the benchmark result may be unstable * the standard deviation (7.68 ms) is 12% of the mean (61.8 ms) Try to rerun the benchmark with more runs, values and/or loops. Run 'python -m pyperf system tune' command to reduce the system jitter. Use pyperf stats, pyperf dump and pyperf hist to analyze results. Use --quiet option to hide these warnings. dumps_pydantic_nested_50x100: Mean +- std dev: 61.8 ms +- 7.7 ms ......................................... WARNING: the benchmark result may be unstable * the standard deviation (33.2 ms) is 15% of the mean (221 ms) Try to rerun the benchmark with more runs, values and/or loops. Run 'python -m pyperf system tune' command to reduce the system jitter. Use pyperf stats, pyperf dump and pyperf hist to analyze results. Use --quiet option to hide these warnings. dumps_pydanticv1_nested_50x100: Mean +- std dev: 221 ms +- 33 ms

Check notice on line 1 in python/langsmith/client.py

View workflow job for this annotation

GitHub Actions / benchmark

Comparison against main

+-----------------------------------------------+---------+-----------------------+ | Benchmark | main | changes | +===============================================+=========+=======================+ | dumps_pydantic_nested_50x100 | 65.9 ms | 61.8 ms: 1.06x faster | +-----------------------------------------------+---------+-----------------------+ | dumps_class_nested_py_leaf_50x100 | 27.5 ms | 27.2 ms: 1.01x faster | +-----------------------------------------------+---------+-----------------------+ | dumps_dataclass_nested_50x100 | 27.8 ms | 27.5 ms: 1.01x faster | +-----------------------------------------------+---------+-----------------------+ | dumps_class_nested_py_branch_and_leaf_200x400 | 763 us | 761 us: 1.00x faster | +-----------------------------------------------+---------+-----------------------+ | Geometric mean | (ref) | 1.01x faster | +-----------------------------------------------+---------+-----------------------+ Benchmark hidden because not significant (5): dumps_pydanticv1_nested_50x100, create_10_000_run_trees, dumps_class_nested_py_leaf_100x200, create_20_000_run_trees, create_5_000_run_trees

Use the client to customize API keys / workspace ocnnections, SSl certs,
etc. for tracing.
Expand Down Expand Up @@ -1051,7 +1051,6 @@
return ls_schemas.Dataset(
**result,
_host_url=self._host_url,
_tenant_id=self._get_optional_tenant_id(),
)

def _run_transform(
Expand Down Expand Up @@ -2785,7 +2784,6 @@
return ls_schemas.Dataset(
**response.json(),
_host_url=self._host_url,
_tenant_id=self._get_optional_tenant_id(),
)

def has_dataset(
Expand Down Expand Up @@ -2854,12 +2852,10 @@
return ls_schemas.Dataset(
**result[0],
_host_url=self._host_url,
_tenant_id=self._get_optional_tenant_id(),
)
return ls_schemas.Dataset(
**result,
_host_url=self._host_url,
_tenant_id=self._get_optional_tenant_id(),
)

def diff_dataset_versions(
Expand Down Expand Up @@ -3004,7 +3000,6 @@
yield ls_schemas.Dataset(
**dataset,
_host_url=self._host_url,
_tenant_id=self._get_optional_tenant_id(),
)
if limit is not None and i + 1 >= limit:
break
Expand Down Expand Up @@ -3525,7 +3520,6 @@
return ls_schemas.Example(
**result,
_host_url=self._host_url,
_tenant_id=self._get_optional_tenant_id(),
)

def read_example(
Expand All @@ -3549,7 +3543,6 @@
return ls_schemas.Example(
**response.json(),
_host_url=self._host_url,
_tenant_id=self._get_optional_tenant_id(),
)

def list_examples(
Expand Down Expand Up @@ -3620,7 +3613,6 @@
yield ls_schemas.Example(
**example,
_host_url=self._host_url,
_tenant_id=self._get_optional_tenant_id(),
)
if limit is not None and i + 1 >= limit:
break
Expand Down Expand Up @@ -4013,7 +4005,6 @@
reference_example_ = ls_schemas.Example(
**example,
_host_url=self._host_url,
_tenant_id=self._get_optional_tenant_id(),
)
elif run.reference_example_id is not None:
reference_example_ = self.read_example(run.reference_example_id)
Expand Down
Loading