From 012c4c73f0e9841c3cbd22bf6305b488d3bb7519 Mon Sep 17 00:00:00 2001 From: William Kennedy Date: Wed, 5 Jun 2024 09:42:31 -0400 Subject: [PATCH] updating python example --- fern/docs/pages/sdks.mdx | 65 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/fern/docs/pages/sdks.mdx b/fern/docs/pages/sdks.mdx index 20cd656..784c23e 100644 --- a/fern/docs/pages/sdks.mdx +++ b/fern/docs/pages/sdks.mdx @@ -32,41 +32,42 @@ You can find the SDK docs and package information using this link. #### Python Code Example ```python -import predictionguard as pg - -# Initialize a Prediction Guard client. -client = Client(token=) - -# Create some examples illustrating the kind of predictions you -# want to make (domain/ use case specific). -examples = [ - { - "input": { - "phrase": "I'm so excited about Prediction Guard. It's gonna be awesome!" - }, - "output": { - "sentiment": "POS" - } - }, - { - "input": { - "phrase": "AI development without Prediction Guard is bad. It's really terrible." - }, - "output": { - "sentiment": "NEG" - } - } +import json +import os + +from predictionguard import PredictionGuard + +# You can set you Prediction Guard API Key as an env variable, +# or when creating the client object +os.environ["PREDICTIONGUARD_API_KEY"] + +client = PredictionGuard( + api_key="