Skip to content

Commit 79eed5c

Browse files
authored
Adding Functions Demo Code (#22)
* adding functions demo * adding README File * resolving comments
1 parent d99bae2 commit 79eed5c

File tree

5 files changed

+943
-0
lines changed

5 files changed

+943
-0
lines changed

Basic_Samples/Functions/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Introduction
2+
This repository contains samples demonstrating how to use functions to extend the current capabilities of GPT Models
3+
4+
## Installation
5+
Install all Python modules and packages listed in the requirements.txt file using the below command.
6+
7+
```python
8+
pip install -r requirements.txt
9+
```
10+
11+
### Microsoft Azure Endpoints
12+
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.
13+
14+
```js
15+
{
16+
"DEPLOYMENT_ID":"<Model Deployment Name>",
17+
"OPENAI_API_BASE":"https://<Your Azure Resource Name>.openai.azure.com",
18+
"OPENAI_API_VERSION":"<OpenAI API Version>"
19+
}
20+
```
21+
22+
### For getting started:
23+
- Add "OPENAI_API_KEY" as variable name and \<Your API Key Value\> as variable value in the environment variables.
24+
<br>
25+
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.
26+
<br>
27+
28+
WINDOWS Users:
29+
setx OPENAI_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
30+
31+
MACOS/LINUX Users:
32+
export OPENAI_API_KEY="REPLACE_WITH_YOUR_KEY_VALUE_HERE"
33+
34+
- To find your "DEPLOYMENT_ID" go to the deployments page of the Azure AI Studio. Create a deployment if one does not already exist.
35+
One can start with using your model name as "gpt-35-turbo-0613" or "gpt-4."
36+
37+
- 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.
38+
- Current, function calling can only be used with the "2023-07-01-preview" API version. Check out versions [here](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference).
39+
40+
41+
## Requirements
42+
Python 3.8+ <br>
43+
Jupyter Notebook 6.5.2
44+
45+
<br>
46+
47+
## Trademarks
48+
49+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
50+
trademarks or logos is subject to and must follow
51+
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
52+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
53+
Any use of third-party trademarks or logos are subject to those third-party's policies.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"DEPLOYMENT_ID":"<Model Deployment Name>",
3+
"OPENAI_API_BASE":"https://<Your Azure Resource Name>.openai.azure.com",
4+
"OPENAI_API_VERSION":"<OpenAI API Version>"
5+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Packages needed to call AOAI API with the OpenAI Python API
2+
openai
3+
4+
# Packages needed to run the notebook samples
5+
jupyter
6+
7+
# Other packages needed to run the notebook samples
8+
json
9+
pytz
10+
pandas
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Index,Date,Open,High,Low,Close,Volume
2+
S&P 500,2023-07-12,4300.25,4350.32,4200.2,4325.74,3500000
3+
S&P 500,2023-07-13,4325.55,4350.0,4300.98,4310.33,3600000
4+
NASDAQ Composite,2023-07-12,14000.65,14200.06,13800.08,14100.44,4000000
5+
NASDAQ Composite,2023-07-13,14100.11,14250.0,14000.67,14050.81,4200000
6+
Dow Jones Industrial Average,2023-07-12,34000.87,34500.22,33000.11,34200.9,3000000
7+
Dow Jones Industrial Average,2023-07-13,34200.73,34500.73,34000.4,34100.64,3200000
8+
Financial Times Stock Exchange 100 Index,2023-07-12,7000.55,7050.61,6900.76,7025.22,2000000
9+
Financial Times Stock Exchange 100 Index,2023-07-13,7025.39,7050.9,7000.56,7010.24,2100000

0 commit comments

Comments
 (0)