-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from fosteramanda/main
Adding LangChain Quickstart
- Loading branch information
Showing
4 changed files
with
429 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Introduction | ||
This repository shows how to setup and use Azure OpenAI models' API with LangChain. | ||
|
||
## Installation | ||
Install all Python modules and packages listed in the requirements.txt file using the below command. | ||
|
||
```python | ||
pip install -r requirements.txt | ||
``` | ||
|
||
### Microsoft Azure Endpoints | ||
In order to use the Open AI library or REST API with Microsoft Azure endpoints, you need to set DEPLOYMENT_NAME, OPENAI_API_BASE & OPENAI_API_VERSION in _config.json_ file. | ||
|
||
```js | ||
{ | ||
"DEPLOYMENT_NAME":"<Model Deployment Name>", | ||
"OPENAI_API_BASE":"https://<Your Azure Resource Name>.openai.azure.com", | ||
"OPENAI_API_VERSION":"<OpenAI API Version>" | ||
} | ||
``` | ||
|
||
### For getting started: | ||
- Add "OPENAI_API_KEY" as variable name and \<Your API Key Value\> as variable value in the environment variables. | ||
<br> | ||
One can get the OPENAI_API_KEY value from the Azure Portal. Go to https://portal.azure.com, find your resource and then under "Resource Management" -> "Keys and Endpoints" look for one of the "Keys" values. | ||
<br> | ||
WINDOWS Users: | ||
setx OPENAI_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE" | ||
|
||
MACOS/LINUX Users: | ||
export OPENAI_API_KEY="REPLACE_WITH_YOUR_KEY_VALUE_HERE" | ||
|
||
- To find your "DEPLOYMENT_NAME" go to the deployments page of the Azure AI Studio. Create a deployment if one does not already exist. | ||
One can start with using your model name as "gpt-35-turbo-0613" or "gpt-4." | ||
|
||
- To find your "OPENAI_API_BASE" go to https://portal.azure.com, find your resource and then under "Resource Management" -> "Keys and Endpoints" look for the "Endpoint" value. | ||
|
||
- Check out versions [here](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference). | ||
|
||
|
||
## Requirements | ||
Python 3.8+ <br> | ||
Jupyter Notebook 6.5.2 | ||
|
||
<br> | ||
|
||
## Trademarks | ||
|
||
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft | ||
trademarks or logos is subject to and must follow | ||
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). | ||
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. | ||
Any use of third-party trademarks or logos are subject to those third-party's policies. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"DEPLOYMENT_NAME":"<Model Deployment Name>", | ||
"OPENAI_API_BASE":"https://<Your Azure Resource Name>.openai.azure.com", | ||
"OPENAI_API_VERSION":"<OpenAI API Version>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Packages needed to call AOAI API with the OpenAI Python API | ||
openai | ||
|
||
# Packages needed to run the notebook samples | ||
jupyter | ||
|
||
# Other packages needed to run the notebook samples | ||
langchain | ||
json |
Oops, something went wrong.