Skip to content

Commit c4fee5a

Browse files
committed
updating go doc
1 parent 75a90bb commit c4fee5a

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

articles/ai-services/openai/includes/use-your-data-go.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: travisw
55
ms.author: travisw
66
ms.service: azure-ai-openai
77
ms.topic: include
8-
ms.date: 03/07/2024
8+
ms.date: 01/17/2025
99
---
1010

1111
[!INCLUDE [Set up required variables](./use-your-data-common-variables.md)]
@@ -19,15 +19,6 @@ ms.date: 03/07/2024
1919
cd openai-go
2020
```
2121

22-
1. Install the following Go packages:
23-
24-
```cmd
25-
go get github.com/Azure/azure-sdk-for-go/sdk/ai/azopenai
26-
```
27-
1. Enable dependency tracking for your code.
28-
```cmd
29-
go mod init example/azure-openai
30-
```
3122
## Create the Go app
3223

3324
1. From the project directory, open the *sample.go* file and add the following code:
@@ -119,10 +110,17 @@ ms.date: 03/07/2024
119110
> [!IMPORTANT]
120111
> For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](/azure/key-vault/general/overview). For more information about credential security, see the Azure AI services [security](../../security-features.md) article.
121112
122-
1. Execute the following command:
113+
114+
1. Now open a command prompt and run the following:
123115

124116
```cmd
125-
go run sample.go
117+
go mod init sample.go
126118
```
127119

120+
1. Next run:
121+
```cmd
122+
go mod tidy
123+
go run sample.go
124+
```
125+
128126
The application prints the response including both answers to your query and citations from your uploaded files.

0 commit comments

Comments
 (0)