Skip to content

Commit 722b8a3

Browse files
authored
Merge pull request #60 from bbenz/main
update README with Maven
2 parents 29eb241 + c6dc317 commit 722b8a3

File tree

1 file changed

+45
-39
lines changed
  • samples/microsoft/java/mslearn-resources/quickstart

1 file changed

+45
-39
lines changed

samples/microsoft/java/mslearn-resources/quickstart/README.md

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,53 @@ AZURE_DEPLOYMENT=your_deployment_name_here
6161
```bash
6262
az login
6363
```
64-
3. Install Maven dependencies:
65-
```bash
66-
mvn clean install
67-
```
64+
3. Add Maven dependencies:
65+
66+
```xml
67+
<dependencies>
68+
<dependency>
69+
<groupId>com.azure</groupId>
70+
<artifactId>azure-ai-projects</artifactId>
71+
<version>1.0.0-alpha.20250429.2</version>
72+
</dependency>
73+
74+
<!-- OpenAI Java SDK -->
75+
<dependency>
76+
<groupId>com.openai</groupId>
77+
<artifactId>openai-java</artifactId>
78+
<version>1.4.1</version>
79+
</dependency>
80+
81+
<!-- Azure Identity for authentication -->
82+
<dependency>
83+
<groupId>com.azure</groupId>
84+
<artifactId>azure-identity</artifactId>
85+
<version>1.8.1</version>
86+
</dependency>
87+
88+
<!-- .env file support -->
89+
<dependency>
90+
<groupId>io.github.cdimascio</groupId>
91+
<artifactId>dotenv-java</artifactId>
92+
<version>2.3.2</version>
93+
</dependency>
94+
95+
<!-- Logging -->
96+
<dependency>
97+
<groupId>org.slf4j</groupId>
98+
<artifactId>slf4j-api</artifactId>
99+
<version>2.0.7</version>
100+
</dependency>
101+
<dependency>
102+
<groupId>org.slf4j</groupId>
103+
<artifactId>slf4j-simple</artifactId>
104+
<version>2.0.7</version>
105+
</dependency>
106+
</dependencies>
107+
```
68108

69109
## Create a Project and Model Deployment
70110

71-
Run the CreateProject example to create a new project and model deployment:
72-
73-
```bash
74-
mvn compile exec:java -Dexec.mainClass="com.azure.ai.foundry.samples.CreateProject"
75-
```
76-
77-
Sample code:
78111

79112
```java
80113
// Create a client using your Azure credentials
@@ -88,15 +121,7 @@ Project project = client.createProject("My Sample Project", "A project created u
88121
System.out.println("Created project: " + project.getName() + " with ID: " + project.getId());
89122
```
90123

91-
## Run a Chat Completion
92-
93-
Execute the chat completion example:
94-
95-
```bash
96-
mvn compile exec:java -Dexec.mainClass="com.azure.ai.foundry.samples.ChatCompletionSample"
97-
```
98-
99-
Sample code:
124+
## Chat Completion
100125

101126
```java
102127
// Create a Projects client
@@ -125,13 +150,6 @@ System.out.println(completion.getChoices().get(0).getMessage().getContent());
125150

126151
## Create and Run an Agent
127152

128-
Create and run an agent that can perform tasks:
129-
130-
```bash
131-
mvn compile exec:java -Dexec.mainClass="com.azure.ai.foundry.samples.AgentSample"
132-
```
133-
134-
Sample code:
135153

136154
```java
137155
// Create a Projects client
@@ -174,12 +192,6 @@ if (assistantMessage != null) {
174192

175193
Add file search capabilities to your agent:
176194

177-
```bash
178-
mvn compile exec:java -Dexec.mainClass="com.azure.ai.foundry.samples.FileSearchAgentSample"
179-
```
180-
181-
Sample code:
182-
183195
```java
184196
// Create a Projects client
185197
ProjectsClient client = new ProjectsClientBuilder()
@@ -227,12 +239,6 @@ if (assistantMessage != null) {
227239

228240
Evaluate how well the agent performed on a given task:
229241

230-
```bash
231-
mvn compile exec:java -Dexec.mainClass="com.azure.ai.foundry.samples.EvaluateAgentSample"
232-
```
233-
234-
Sample code:
235-
236242
```java
237243
// Create a Projects client
238244
ProjectsClient client = new ProjectsClientBuilder()

0 commit comments

Comments
 (0)