Skip to content

Commit

Permalink
chore(simple onboarding): api key in instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
eylonmiz committed Jul 31, 2023
1 parent 628a9c2 commit 3a8e510
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from "../../lib/providers/GettingStartedWizardProvider";
import { useCurrentPrompt } from "../../lib/providers/CurrentPromptContext";
import { usePromptVersionEditorContext } from "../../lib/providers/PromptVersionEditorContext";
import { usePezzoApiKeys } from "../../graphql/hooks/queries";

const StyledPre = styled.pre`
background: #000;
Expand All @@ -24,6 +25,8 @@ const getVariablesString = (variables: string[]) => {
export const TypeScriptOpenAIIntegrationTutorial = () => {
const { variables } = usePromptVersionEditorContext();
const { prompt } = useCurrentPrompt();
const { data: pezzoApiKeysData } = usePezzoApiKeys();
const API_KEY = pezzoApiKeysData?.apiKeys[0].id;

const { project } = useCurrentProject();
const codeSetupClients = `import { Pezzo, PezzoOpenAIApi } from "@pezzo/client";
Expand All @@ -36,7 +39,7 @@ const configuration = new Configuration({
// Initialize the Pezzo client
export const pezzo = new Pezzo({
apiKey: "<YOUR_PEZZO_API_KEY>", // Can be found in your organization page
apiKey: "${API_KEY}",
projectId: "${project.id}",
environment: "Production", // Your desired environment
});
Expand Down

0 comments on commit 3a8e510

Please sign in to comment.