From fa823d016f8482c4d86e441c8b1dbf09be137c54 Mon Sep 17 00:00:00 2001 From: J2-D2-3PO <188380414+J2-D2-3PO@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:45:04 -0700 Subject: [PATCH] Remove api_key hardcodes in code examples --- docs/docs/guides/evaluation/scorers.md | 2 +- docs/docs/guides/integrations/local_models.md | 1 - docs/docs/guides/integrations/notdiamond.md | 1 - docs/docs/quickstart.md | 2 +- docs/docs/tutorial-tracing_2.md | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/docs/guides/evaluation/scorers.md b/docs/docs/guides/evaluation/scorers.md index e313dcb5582..233d162b15c 100644 --- a/docs/docs/guides/evaluation/scorers.md +++ b/docs/docs/guides/evaluation/scorers.md @@ -455,7 +455,7 @@ In Weave, Scorers are used to evaluate AI outputs and return evaluation metrics. from weave.scorers import OpenAIModerationScorer from openai import OpenAI - oai_client = OpenAI(api_key=...) # initialize your LLM client here + oai_client = OpenAI() # initialize your LLM client here scorer = OpenAIModerationScorer( client=oai_client, diff --git a/docs/docs/guides/integrations/local_models.md b/docs/docs/guides/integrations/local_models.md index 090d22a3f76..2597ad19dd1 100644 --- a/docs/docs/guides/integrations/local_models.md +++ b/docs/docs/guides/integrations/local_models.md @@ -14,7 +14,6 @@ First and most important, is the `base_url` change during the `openai.OpenAI()` ```python client = openai.OpenAI( - api_key='fake', base_url="http://localhost:1234", ) ``` diff --git a/docs/docs/guides/integrations/notdiamond.md b/docs/docs/guides/integrations/notdiamond.md index 3106ef11f1b..e98a23d1334 100644 --- a/docs/docs/guides/integrations/notdiamond.md +++ b/docs/docs/guides/integrations/notdiamond.md @@ -68,7 +68,6 @@ preference_id = train_router( response_column="actual", language="en", maximize=True, - api_key=api_key, ) ``` diff --git a/docs/docs/quickstart.md b/docs/docs/quickstart.md index 59ac16ef236..65bc813af03 100644 --- a/docs/docs/quickstart.md +++ b/docs/docs/quickstart.md @@ -50,7 +50,7 @@ _In this example, we're using openai so you will need to add an OpenAI [API key] import weave from openai import OpenAI - client = OpenAI(api_key="...") + client = OpenAI() # Weave will track the inputs, outputs and code of this function # highlight-next-line diff --git a/docs/docs/tutorial-tracing_2.md b/docs/docs/tutorial-tracing_2.md index 719ee99e012..d6e392d9c56 100644 --- a/docs/docs/tutorial-tracing_2.md +++ b/docs/docs/tutorial-tracing_2.md @@ -24,7 +24,7 @@ Building on our [basic tracing example](/quickstart), we will now add additional import json from openai import OpenAI - client = OpenAI(api_key="...") + client = OpenAI() # highlight-next-line @weave.op()