Skip to content

Commit

Permalink
Release: 0.0.84 (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Jan 29, 2024
1 parent 003ef89 commit 2c7f166
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,45 @@
# LangSmith Client SDKs

This repository contains `BaseTracer` schemas used in LangChain as well as the Python and Javascript clients for interacting with the [LangSmith platform](https://smith.langchain.com/).
This repository contains the Python and Javascript SDK's for interacting with the [LangSmith platform](https://smith.langchain.com/).

LangSmith helps you and your team debug, evaluate, and monitor your language models and intelligent agents. It works
LangSmith helps your team debug, evaluate, and monitor your language models and intelligent agents. It works
with any LLM Application, including a native integration with the [LangChain Python](https://github.com/hwchase17/langchain) and [LangChain JS](https://github.com/hwchase17/langchainjs) open source libraries.

LangSmith is developed and maintained by [LangChain](https://langchain.com/), the company behind the LangChain framework.

⚠️ The SDK and LangSmith platform is still in early beta and continuously evolving!

## Quick Start

To get started with the Python SDK, [install the package](https://pypi.org/project/langsmith/), then follow the instructions in the [Python README](python/README.md).

```bash
pip install langsmith
pip install -U langsmith
export LANGCHAIN_API_KEY=ls_...
```

Then start tracing your app:

```
import openai
from langsmith import traceable
from langsmith.wrappers import wrap_openai
client = wrap_openai(openai.Client())
client.chat.completions.create(
messages=[{"role": "user", "content": "Hello, world"}],
model="gpt-3.5-turbo"
)
```

To get started with the JavaScript / TypeScript SDK, [install the package](https://www.npmjs.com/package/langsmith), then follow the instructions in the [JS README](js/README.md).

```bash
yarn add langsmith
export LANGCHAIN_API_KEY=ls_...
```

Then start tracing your app!

## Cookbook

For tutorials on how to get more value out of LangSmith, check out the [Langsmith Cookbook](https://github.com/langchain-ai/langsmith-cookbook/tree/main) repo.
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langsmith"
version = "0.0.83"
version = "0.0.84"
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform."
authors = ["LangChain <[email protected]>"]
license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions python/tests/integration_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def test_create_run_with_masked_inputs_outputs(
if project.name == project_name:
langchain_client.delete_project(project_name=project_name)

run_id = "8bac165f-470e-4bf8-baa0-15f2de4cc706"
run_id = uuid4()
langchain_client.create_run(
id=run_id,
project_name=project_name,
Expand All @@ -359,7 +359,7 @@ def test_create_run_with_masked_inputs_outputs(
hide_outputs=True,
)

run_id2 = "8bac165f-490e-4bf8-baa0-15f2de4cc707"
run_id2 = uuid4()
langchain_client.create_run(
id=run_id2,
project_name=project_name,
Expand Down
5 changes: 1 addition & 4 deletions python/tests/integration_tests/test_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@pytest.fixture
def langchain_client() -> Generator[Client, None, None]:
original = os.environ.get("LANGCHAIN_ENDPOINT")
os.environ["LANGCHAIN_ENDPOINT"] = "http://localhost:1984"
os.environ["LANGCHAIN_ENDPOINT"] = "https://api.smith.langchain.com"
yield Client()
if original is None:
os.environ.pop("LANGCHAIN_ENDPOINT")
Expand Down Expand Up @@ -135,18 +135,15 @@ async def my_chain_run(text: str):
assert runs_dict["my_chain_run"].execution_order == 1
assert runs_dict["my_run"].parent_run_id == runs_dict["my_chain_run"].id
assert runs_dict["my_run"].run_type == "chain"
assert runs_dict["my_run"].execution_order == 2
assert runs_dict["my_llm_run"].parent_run_id == runs_dict["my_run"].id
assert runs_dict["my_llm_run"].run_type == "llm"
assert runs_dict["my_llm_run"].inputs == {"text": "foo"}
assert runs_dict["my_llm_run"].execution_order == 3
assert runs_dict["my_sync_tool"].parent_run_id == runs_dict["my_run"].id
assert runs_dict["my_sync_tool"].run_type == "tool"
assert runs_dict["my_sync_tool"].inputs == {
"text": "foo",
"my_arg": 20,
}
assert runs_dict["my_sync_tool"].execution_order == 4
langchain_client.delete_project(project_name=project_name)


Expand Down

0 comments on commit 2c7f166

Please sign in to comment.