You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-foundry/how-to/develop/sdk-overview.md
+73-78Lines changed: 73 additions & 78 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,115 +42,110 @@ The Azure AI Foundry Projects client library is a unified library that enables y
42
42
43
43
::: zone pivot="programming-language-python"
44
44
45
-
To install the project client library:
45
+
* Install the project client library
46
46
47
-
```bash
48
-
pip install azure-ai-projects azure-ai-identity
49
-
```
50
-
51
-
Create a project client in code:
52
-
53
-
```python
54
-
from azure.identity import DefaultAzureCredential
55
-
from azure.ai.projects import AIProjectClient
47
+
```bash
48
+
pip install azure-ai-projects azure-ai-identity
49
+
```
56
50
57
-
project = AIProjectClient.from_connection_string(
58
-
endpoint="your_project_endpoint", # Replace with your endpoint
59
-
credential=DefaultAzureCredential())
60
-
```
51
+
* Create a project client in code. **Copy** the the Azure AI Foundry project endpoint from the Overview page of the project and update the connections string value.
61
52
62
-
**Copy** the the Azure AI Foundry project endpoint from the Overview page of the project and update the connections string value above.
53
+
```python
54
+
from azure.identity import DefaultAzureCredential
55
+
from azure.ai.projects import AIProjectClient
56
+
57
+
project = AIProjectClient.from_connection_string(
58
+
endpoint="your_project_endpoint", # Replace with your endpoint
* Create a project client in code. **Copy** the the Azure AI Foundry project endpoint from the Overview page of the project and update the connections string value.
75
72
76
-
String endpoint ="your_project_endpoint"; // Replace with your endpoint
String endpoint ="your_project_endpoint"; // Replace with your endpoint
79
+
80
+
ProjectsClient client = new ProjectsClientBuilder()
81
+
.credential(new AzureKeyCredential(apiKey))
82
+
.endpoint(endpoint)
83
+
.buildClient();
84
+
```
77
85
78
-
ProjectsClient client = new ProjectsClientBuilder()
79
-
.credential(new AzureKeyCredential(apiKey))
80
-
.endpoint(endpoint)
81
-
.buildClient();
82
-
```
83
86
84
-
**Copy** the the Azure AI Foundry project endpoint from the Overview page of the project and update the connections string value above.
85
87
86
88
::: zone-end
87
89
88
90
::: zone pivot="programming-language-javascript"
89
91
90
-
Create a project client in code:
91
-
92
-
Install dependencies:
93
-
94
-
```bash
95
-
npm install @azure/ai-projects @azure/identity
96
-
```
92
+
* Install dependencies:
97
93
98
-
Create a project client in code:
99
-
100
-
101
-
```javascript
102
-
import { AIProjectClient } from '@azure/ai-projects';
103
-
import { DefaultAzureCredential } from '@azure/identity';
104
-
105
-
const endpoint = "your_project_endpoint"; // Replace with your actual endpoint
106
-
const project = new AIProjectClient(endpoint, new DefaultAzureCredential());
94
+
```bash
95
+
npm install @azure/ai-projects @azure/identity
96
+
```
107
97
108
-
const client = project.inference.azureOpenAI();
109
-
```
98
+
* Create a project client in code. **Copy** the the Azure AI Foundry project endpoint from the Overview page of the project and update the connections string value.
110
99
111
-
**Copy** the the Azure AI Foundry project endpoint from the Overview page of the project and update the endpoint value above.
112
100
101
+
```javascript
102
+
import { AIProjectClient } from '@azure/ai-projects';
103
+
import { DefaultAzureCredential } from '@azure/identity';
104
+
105
+
const endpoint = "your_project_endpoint"; // Replace with your actual endpoint
106
+
const project = new AIProjectClient(endpoint, new DefaultAzureCredential());
107
+
108
+
const client = project.inference.azureOpenAI();
109
+
```
113
110
114
111
::: zone-end
115
112
116
113
::: zone pivot="programming-language-csharp"
117
114
118
-
Install packages:
115
+
*Install packages:
119
116
120
-
```bash
121
-
dotnet add package Azure.Identity
122
-
dotnet add package Azure.Core
123
-
dotnet add package Azure.AI.Inference
124
-
```
117
+
```bash
118
+
dotnet add package Azure.Identity
119
+
dotnet add package Azure.Core
120
+
dotnet add package Azure.AI.Inference
121
+
```
125
122
126
-
Create the project client:
127
-
128
-
```csharp
129
-
using Azure;
130
-
using Azure.Identity;
131
-
using Azure.AI.Inference;
132
-
using Azure.Core;
133
-
using Azure.Core.Pipeline;
134
-
135
-
var endpointUrl = "your_project_endpoint"; // Replace with your actual endpoint
136
-
var credential = new DefaultAzureCredential();
137
-
138
-
AzureAIInferenceClientOptions clientOptions = new AzureAIInferenceClientOptions();
139
-
BearerTokenAuthenticationPolicy tokenPolicy = new BearerTokenAuthenticationPolicy(
140
-
credential,
141
-
new string[] { "https://cognitiveservices.azure.com/.default" }
*Create a project clientin code. **Copy** the the Azure AI Foundry project endpoint from the Overview page of the project and update the connections string value.
124
+
125
+
```csharp
126
+
using Azure;
127
+
using Azure.Identity;
128
+
using Azure.AI.Inference;
129
+
using Azure.Core;
130
+
using Azure.Core.Pipeline;
131
+
132
+
var endpointUrl = "your_project_endpoint"; // Replace with your actual endpoint
133
+
var credential = new DefaultAzureCredential();
134
+
135
+
AzureAIInferenceClientOptions clientOptions = new AzureAIInferenceClientOptions();
136
+
BearerTokenAuthenticationPolicy tokenPolicy = new BearerTokenAuthenticationPolicy(
137
+
credential,
138
+
new string[] { "https://cognitiveservices.azure.com/.default" }
0 commit comments