Skip to content

Commit fc80061

Browse files
leo-ganefriiseyurtsev
authored
docs: integrations W&B update (#28059)
Issue: Here is an ambiguity about W&B integrations. There are two existing provider pages. Fix: Added the "root" W&B provider page. Added there the references to the documentation in the W&B site. Cleaned up formats in existing pages. Added one more integration reference. --------- Co-authored-by: Erick Friis <erick@langchain.dev> Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
1 parent 288f204 commit fc80061

File tree

3 files changed

+103
-8
lines changed

3 files changed

+103
-8
lines changed
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Weights & Biases
2+
3+
>[Weights & Biases](https://wandb.ai/) is provider of the AI developer platform to train and
4+
> fine-tune AI models and develop AI applications.
5+
6+
`Weights & Biase` products can be used to log metrics and artifacts during training,
7+
and to trace the execution of your code.
8+
9+
There are several main ways to use `Weights & Biases` products within LangChain:
10+
- with `wandb_tracing_enabled`
11+
- with `Weave` lightweight toolkit
12+
- with `WandbCallbackHandler` (deprecated)
13+
14+
15+
## wandb_tracing_enabled
16+
17+
See a [usage example](/docs/integrations/providers/wandb_tracing).
18+
19+
See in the [W&B documentation](https://docs.wandb.ai/guides/integrations/langchain).
20+
21+
```python
22+
from langchain_community.callbacks import wandb_tracing_enabled
23+
```
24+
25+
## Weave
26+
27+
See in the [W&B documentation](https://weave-docs.wandb.ai/guides/integrations/langchain).
28+
29+
30+
## WandbCallbackHandler
31+
32+
**Note:** the `WandbCallbackHandler` is being deprecated in favour of the `wandb_tracing_enabled`.
33+
34+
See a [usage example](/docs/integrations/providers/wandb_tracking).
35+
36+
See in the [W&B documentation](https://docs.wandb.ai/guides/integrations/langchain).
37+
38+
```python
39+
from langchain_community.callbacks import WandbCallbackHandler
40+
```
41+
42+

docs/docs/integrations/providers/wandb_tracing.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"id": "5371a9bb",
66
"metadata": {},
77
"source": [
8-
"# WandB Tracing\n",
8+
"# Weights & Biases tracing\n",
99
"\n",
1010
"There are two recommended ways to trace your LangChains:\n",
1111
"\n",
@@ -165,7 +165,7 @@
165165
"name": "python",
166166
"nbconvert_exporter": "python",
167167
"pygments_lexer": "ipython3",
168-
"version": "3.11.3"
168+
"version": "3.10.12"
169169
}
170170
},
171171
"nbformat": 4,

docs/docs/integrations/providers/wandb_tracking.ipynb

+59-6
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@
66
"id": "e43f4ea0",
77
"metadata": {},
88
"source": [
9-
"# Weights & Biases\n",
9+
"# Weights & Biases tracking\n",
1010
"\n",
11-
"This notebook goes over how to track your LangChain experiments into one centralized Weights and Biases dashboard. To learn more about prompt engineering and the callback please refer to this Report which explains both alongside the resultant dashboards you can expect to see.\n",
11+
"This notebook goes over how to track your LangChain experiments into one centralized `Weights and Biases` dashboard. \n",
1212
"\n",
13+
"To learn more about prompt engineering and the callback please refer to this notebook which explains both alongside the resultant dashboards you can expect to see:\n",
1314
"\n",
1415
"<a href=\"https://colab.research.google.com/drive/1DXH4beT4HFaRKy_Vm4PoxhXVDRf7Ym8L?usp=sharing\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
1516
"\n",
1617
"\n",
17-
"[View Report](https://wandb.ai/a-sh0ts/langchain_callback_demo/reports/Prompt-Engineering-LLMs-with-LangChain-and-W-B--VmlldzozNjk1NTUw#👋-how-to-build-a-callback-in-langchain-for-better-prompt-engineering\n",
18-
") \n",
18+
"View a detailed description and examples in the [W&B article](https://wandb.ai/a-sh0ts/langchain_callback_demo/reports/Prompt-Engineering-LLMs-with-LangChain-and-W-B--VmlldzozNjk1NTUw#👋-how-to-build-a-callback-in-langchain-for-better-prompt-engineering\n",
19+
"). \n",
1920
"\n",
2021
"\n",
21-
"**Note**: _the `WandbCallbackHandler` is being deprecated in favour of the `WandbTracer`_ . In future please use the `WandbTracer` as it is more flexible and allows for more granular logging. To know more about the `WandbTracer` refer to the [agent_with_wandb_tracing](/docs/integrations/providers/wandb_tracing) notebook or use the following [colab notebook](http://wandb.me/prompts-quickstart). To know more about Weights & Biases Prompts refer to the following [prompts documentation](https://docs.wandb.ai/guides/prompts)."
22+
"**Note**: _the `WandbCallbackHandler` is being deprecated in favour of the `WandbTracer`_ . In future please use the `WandbTracer` as it is more flexible and allows for more granular logging. \n",
23+
"\n",
24+
"To know more about the `WandbTracer` refer to the [agent_with_wandb_tracing](/docs/integrations/providers/wandb_tracing) notebook or use the following [colab notebook](http://wandb.me/prompts-quickstart). \n",
25+
"\n",
26+
"To know more about Weights & Biases Prompts refer to the following [prompts documentation](https://docs.wandb.ai/guides/prompts)."
2227
]
2328
},
2429
{
@@ -248,6 +253,38 @@
248253
"The `flush_tracker` function is used to log LangChain sessions to Weights & Biases. It takes in the LangChain module or agent, and logs at minimum the prompts and generations alongside the serialized form of the LangChain module to the specified Weights & Biases project. By default we reset the session as opposed to concluding the session outright."
249254
]
250255
},
256+
{
257+
"cell_type": "markdown",
258+
"id": "483eefd4-633e-4686-8730-944705fe8a80",
259+
"metadata": {
260+
"execution": {
261+
"iopub.execute_input": "2024-11-12T18:20:31.003316Z",
262+
"iopub.status.busy": "2024-11-12T18:20:31.003152Z",
263+
"iopub.status.idle": "2024-11-12T18:20:31.006033Z",
264+
"shell.execute_reply": "2024-11-12T18:20:31.005546Z",
265+
"shell.execute_reply.started": "2024-11-12T18:20:31.003303Z"
266+
}
267+
},
268+
"source": [
269+
"## Usage Scenarios"
270+
]
271+
},
272+
{
273+
"cell_type": "markdown",
274+
"id": "066adc04-8180-4936-8d75-5c3660b61de7",
275+
"metadata": {
276+
"execution": {
277+
"iopub.execute_input": "2024-11-12T18:20:45.826326Z",
278+
"iopub.status.busy": "2024-11-12T18:20:45.825714Z",
279+
"iopub.status.idle": "2024-11-12T18:20:45.830483Z",
280+
"shell.execute_reply": "2024-11-12T18:20:45.830037Z",
281+
"shell.execute_reply.started": "2024-11-12T18:20:45.826279Z"
282+
}
283+
},
284+
"source": [
285+
"### With LLM"
286+
]
287+
},
251288
{
252289
"cell_type": "code",
253290
"execution_count": 4,
@@ -373,6 +410,14 @@
373410
"wandb_callback.flush_tracker(llm, name=\"simple_sequential\")"
374411
]
375412
},
413+
{
414+
"cell_type": "markdown",
415+
"id": "7dcfc24b-f0b0-48ec-89ce-beeb2fb763d5",
416+
"metadata": {},
417+
"source": [
418+
"### Within Chains"
419+
]
420+
},
376421
{
377422
"cell_type": "code",
378423
"execution_count": 5,
@@ -524,6 +569,14 @@
524569
"wandb_callback.flush_tracker(synopsis_chain, name=\"agent\")"
525570
]
526571
},
572+
{
573+
"cell_type": "markdown",
574+
"id": "533cd4c9-56e2-4ad9-a83e-4653bfcf322f",
575+
"metadata": {},
576+
"source": [
577+
"### With Agents"
578+
]
579+
},
527580
{
528581
"cell_type": "code",
529582
"execution_count": 7,
@@ -646,7 +699,7 @@
646699
"name": "python",
647700
"nbconvert_exporter": "python",
648701
"pygments_lexer": "ipython3",
649-
"version": "3.9.1"
702+
"version": "3.10.12"
650703
}
651704
},
652705
"nbformat": 4,

0 commit comments

Comments
 (0)