diff --git a/aiconfig-docs/docs/getting-started.md b/aiconfig-docs/docs/getting-started.md index 3dac3801f..dd34c7093 100644 --- a/aiconfig-docs/docs/getting-started.md +++ b/aiconfig-docs/docs/getting-started.md @@ -56,17 +56,33 @@ $ yarn add aiconfig **Note:** You need to install the python AIConfig package to create and edit your configs using the AIConfig Editor. You can still use the AIConfig Node SDK to interact with your config in your application code. -## Setup your OpenAI API Key +## Setup your API Key(s) + +You will need to specifiy API keys for the model providers (i.e. OpenAI, Google, HuggingFace) you plan to use. We recommend adding your API keys as environment variables so that they are accessible for all projects. The python library will automatically detect and use them without you having to write any code. + +For this tutorial, you will need to have an OpenAI API key that has access to GPT-4. Setup help for other API keys is available [here](https://aiconfig.lastmileai.dev/docs/editor#env-api-keys). + +
+ Setup your OpenAI API Key as a environment variable (MacOS / Linux / Windows) +
+ 1. Get your OpenAI API Key: https://platform.openai.com/account/api-keys + 2. Open Terminal + 3. Edit Bash Profile: Use the command `nano ~/.bash_profile` or `nano ~/.zshrc` (for newer MacOS versions) to open the profile file in a text editor. + 4. Add Environment Variable: In the editor, add the line below, replacing *your-api-key-here* with your actual API key: + ```bash + export OPENAI_API_KEY='your-api-key-here' + ``` + 5. *[Optional] add in environment variables for your other model providers (Google, HuggingFace, Anyscale, etc.).* + 6. Save and Exit: Press `Ctrl+O` followed by `ENTER` to write the change. Then `Ctrl+X` to close the editor. + 7. Load Your Profile: Use the command `source ~/.bash_profile` or `source ~/.zshrc` to load the updated profile. + 8. Verification: Verify the setup by typing `echo $OPENAI_API_KEY` in the terminal. It should display your API key. +
-For this tutorial, you will need to have an OpenAI key that has access to GPT-4. - -1. Get your OpenAI API Key: https://platform.openai.com/account/api-keys -2. Open Terminal -3. Add this line, replace ‘your-api-key-here’ with your API key: `export OPENAI_API_KEY='your-api-key-here'` +
## Open AIConfig Editor -AIConfig Editor allows you to visually create and edit the prompt chains and model parameters that are stored as AIConfigs. You can also chain prompts and use global and local variables in your prompts. +AIConfig Editor allows you to visually create and edit the prompt chains and model parameters that are stored as AIConfigs. You can also chain prompts and use global and local variables in your prompts. Learn more about [AIConfig Editor](https://aiconfig.lastmileai.dev/docs/editor). 1. Open your Terminal 2. Run this command: `aiconfig edit --aiconfig-path travel.aiconfig.json` diff --git a/my_aiconfig.aiconfig.json b/my_aiconfig.aiconfig.json new file mode 100644 index 000000000..d79f1800a --- /dev/null +++ b/my_aiconfig.aiconfig.json @@ -0,0 +1,21 @@ +{ + "name": "a", + "schema_version": "latest", + "metadata": { + "parameters": {}, + "models": {} + }, + "description": "", + "prompts": [ + { + "name": "prompt_1", + "input": "", + "metadata": { + "model": "gpt-4", + "parameters": {} + }, + "outputs": [] + } + ], + "$schema": "https://json.schemastore.org/aiconfig-1.0" +} \ No newline at end of file