Skip to content

Commit 195fdf0

Browse files
brandom-msftaahill
andauthored
Sync: Remaining commits from foundry-samples-pr#62 (linting, .gitignore, prefix removal) (#580)
* linting * Update .gitignore to modify ignored files Removed unnecessary entries from .gitignore and added back the developer-journey-stage-1-idea-to-prototype.md file. * removing prefix --------- Co-authored-by: Aaron Hill <aahi@microsoft.com> Co-authored-by: aahill <aahill017@live.com>
1 parent dad4c14 commit 195fdf0

13 files changed

Lines changed: 49 additions & 67 deletions

File tree

.gitignore

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,3 @@ terraform.rc
461461
samples/microsoft/nul
462462
samples/microsoft/microsoft.sln
463463
samples/microsoft/developer-journey-stage-1-idea-to-prototype.md
464-
# Doc-Kit workspace files
465-
.github/AGENTS.md
466-
.github/agents/
467-
.github/instructions/
468-
.github/prompts/
469-
.github/skills/
470-
.vscode/settings.json
471-
.dockit/
472-
.env
473-
.env.example
474-
requirements.txt

samples/csharp/quickstart/chat-with-agent/quickstart-chat-with-agent.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
#pragma warning disable OPENAI001
77

88
// Format: "https://resource_name.ai.azure.com/api/projects/project_name"
9-
var foundryProjectEndpoint = "your_project_endpoint";
10-
var foundryAgentName = "your_agent_name";
9+
var ProjectEndpoint = "your_project_endpoint";
10+
var AgentName = "your_agent_name";
1111

1212
// Create project client to call Foundry API
1313
AIProjectClient projectClient = new(
14-
endpoint: new Uri(foundryProjectEndpoint),
14+
endpoint: new Uri(ProjectEndpoint),
1515
tokenProvider: new DefaultAzureCredential());
1616

1717
// Create a conversation for multi-turn chat
1818
ProjectConversation conversation = projectClient.OpenAI.Conversations.CreateProjectConversation();
1919

2020
// Chat with the agent to answer questions
2121
ProjectResponsesClient responsesClient = projectClient.OpenAI.GetProjectResponsesClientForAgent(
22-
defaultAgent: foundryAgentName,
22+
defaultAgent: AgentName,
2323
defaultConversationId: conversation.Id);
2424
ResponseResult response = responsesClient.CreateResponse("What is the size of France in square miles?");
2525
Console.WriteLine(response.GetOutputText());

samples/csharp/quickstart/create-agent/quickstart-create-agent.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
using Azure.AI.Projects.OpenAI;
44

55
// Format: "https://resource_name.ai.azure.com/api/projects/project_name"
6-
var foundryProjectEndpoint = "your_project_endpoint";
7-
var foundryModelName = "gpt-5-mini"; // supports all Foundry direct models
8-
var foundryAgentName = "your_agent_name";
6+
var ProjectEndpoint = "your_project_endpoint";
7+
var AgentName = "your_agent_name";
98

109
// Create project client to call Foundry API
1110
AIProjectClient projectClient = new(
12-
endpoint: new Uri(foundryProjectEndpoint),
11+
endpoint: new Uri(ProjectEndpoint),
1312
tokenProvider: new DefaultAzureCredential());
1413

1514
// Create an agent with a model and instructions
16-
AgentDefinition agentDefinition = new PromptAgentDefinition(foundryModelName)
15+
AgentDefinition agentDefinition = new PromptAgentDefinition("gpt-5-mini") // supports all Foundry direct models
1716
{
1817
Instructions = "You are a helpful assistant that answers general questions",
1918
};
2019

2120
AgentVersion agent = projectClient.Agents.CreateAgentVersion(
22-
foundryAgentName,
21+
AgentName,
2322
options: new(agentDefinition));
2423
Console.WriteLine($"Agent created (id: {agent.Id}, name: {agent.Name}, version: {agent.Version})");

samples/csharp/quickstart/responses/quickstart-responses.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66
#pragma warning disable OPENAI001
77

88
// Format: "https://resource_name.ai.azure.com/api/projects/project_name"
9-
var foundryProjectEndpoint = "your_project_endpoint";
10-
var foundryModelName = "gpt-5-mini"; // supports all Foundry direct models
9+
var ProjectEndpoint = "your_project_endpoint";
1110

1211
// Create project client to call Foundry API
1312
AIProjectClient projectClient = new(
14-
endpoint: new Uri(foundryProjectEndpoint),
13+
endpoint: new Uri(ProjectEndpoint),
1514
tokenProvider: new DefaultAzureCredential());
1615

1716
// Run a responses API call
18-
ProjectResponsesClient responseClient = projectClient.OpenAI.GetProjectResponsesClientForModel(foundryModelName);
17+
ProjectResponsesClient responseClient = projectClient.OpenAI.GetProjectResponsesClientForModel("gpt-5-mini"); // supports all Foundry direct models
1918
ResponseResult response = await responseClient.CreateResponseAsync(
2019
"What is the size of France in square miles?");
2120
Console.WriteLine(response.GetOutputText());

samples/java/quickstart/chat-with-agent/src/main/java/com/azure/ai/agents/ChatWithAgent.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
public class ChatWithAgent {
2121
public static void main(String[] args) {
2222
// Format: "https://resource_name.ai.azure.com/api/projects/project_name"
23-
String foundryProjectEndpoint = "your_project_endpoint";
24-
String foundryAgentName = "your_agent_name";
23+
String ProjectEndpoint = "your_project_endpoint";
24+
String AgentName = "your_agent_name";
2525

2626
AgentsClient agentsClient = new AgentsClientBuilder()
2727
.credential(new DefaultAzureCredentialBuilder().build())
28-
.endpoint(foundryProjectEndpoint)
28+
.endpoint(ProjectEndpoint)
2929
.buildAgentsClient();
3030

31-
AgentDetails agent = agentsClient.getAgent(foundryAgentName);
31+
AgentDetails agent = agentsClient.getAgent(AgentName);
3232

3333
Conversation conversation = conversationsClient.getConversationService().create();
3434
conversationsClient.getConversationService().items().create(
@@ -49,7 +49,7 @@ public static void main(String[] args) {
4949
Response response = responsesClient.createWithAgentConversation(agentReference, conversation.id());
5050

5151
OpenAIClient client = OpenAIOkHttpClient.builder()
52-
.baseUrl(foundryProjectEndpoint.endsWith("/") ? foundryProjectEndpoint + "openai" : foundryProjectEndpoint + "/openai")
52+
.baseUrl(ProjectEndpoint.endsWith("/") ? ProjectEndpoint + "openai" : ProjectEndpoint + "/openai")
5353
.azureUrlPathMode(AzureUrlPathMode.UNIFIED)
5454
.credential(BearerTokenCredential.create(AuthenticationUtil.getBearerTokenSupplier(
5555
new DefaultAzureCredentialBuilder().build(), "https://ai.azure.com/.default")))
@@ -58,7 +58,7 @@ public static void main(String[] args) {
5858

5959
ResponseCreateParams responseRequest = new ResponseCreateParams.Builder()
6060
.input("Hello, how can you help me?")
61-
.model("gpt-5-mini")
61+
.model("gpt-5-mini") //supports all Foundry direct models
6262
.build();
6363

6464
Response result = client.responses().create(responseRequest);

samples/java/quickstart/create-agent/src/main/java/com/azure/ai/agents/CreateAgent.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
public class CreateAgent {
88
public static void main(String[] args) {
99
// Format: "https://resource_name.ai.azure.com/api/projects/project_name"
10-
String foundryProjectEndpoint = "your_project_endpoint";
11-
String foundryModelName = "gpt-5-mini"; // supports all Foundry direct models
12-
String foundryAgentName = "your_agent_name";
10+
String ProjectEndpoint = "your_project_endpoint";
11+
String AgentName = "your_agent_name";
1312

1413
// Create agents client to call Foundry API
1514
AgentsClient agentsClient = new AgentsClientBuilder()
1615
.credential(new DefaultAzureCredentialBuilder().build())
17-
.endpoint(foundryProjectEndpoint)
16+
.endpoint(ProjectEndpoint)
1817
.buildAgentsClient();
1918

2019
// Create an agent with a model and instructions
21-
PromptAgentDefinition request = new PromptAgentDefinition(foundryModelName);
22-
AgentVersionDetails agent = agentsClient.createAgentVersion(foundryAgentName, request);
20+
PromptAgentDefinition request = new PromptAgentDefinition("gpt-5-mini") // supports all Foundry direct models
21+
.setInstructions("You are a helpful assistant that answers general questions");
22+
AgentVersionDetails agent = agentsClient.createAgentVersion(AgentName, request);
2323

2424
System.out.println("Agent ID: " + agent.getId());
2525
System.out.println("Agent Name: " + agent.getName());

samples/java/quickstart/responses/src/main/java/com/azure/ai/agents/CreateResponse.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
public class CreateResponse {
88
public static void main(String[] args) {
99
// Format: "https://resource_name.ai.azure.com/api/projects/project_name"
10-
String foundryProjectEndpoint = "your_project_endpoint";
11-
String foundryModelName = "gpt-5-mini"; // supports all Foundry direct models
10+
String ProjectEndpoint = "your_project_endpoint";
1211

1312
// Create responses client to call Foundry API
1413
ResponsesClient responsesClient = new AgentsClientBuilder()
1514
.credential(new DefaultAzureCredentialBuilder().build())
16-
.endpoint(foundryProjectEndpoint)
15+
.endpoint(ProjectEndpoint)
1716
.buildResponsesClient();
1817

1918
// Run a responses API call
2019
ResponseCreateParams responseRequest = new ResponseCreateParams.Builder()
2120
.input("What is the size of France in square miles?")
22-
.model(foundryModelName)
21+
.model("gpt-5-mini") // supports all Foundry direct models
2322
.build();
2423
Response response = responsesClient.getResponseService().create(responseRequest);
2524
System.out.println(response.output());

samples/python/quickstart/chat-with-agent/quickstart-chat-with-agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from azure.ai.projects import AIProjectClient
33

44
# Format: "https://resource_name.ai.azure.com/api/projects/project_name"
5-
FOUNDRY_PROJECT_ENDPOINT = "your_project_endpoint"
6-
FOUNDRY_AGENT_NAME = "your_agent_name"
5+
PROJECT_ENDPOINT = "your_project_endpoint"
6+
AGENT_NAME = "your_agent_name"
77

88
# Create project and openai clients to call Foundry API
99
project = AIProjectClient(

samples/python/quickstart/create-agent/quickstart-create-agent.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@
33
from azure.ai.projects.models import PromptAgentDefinition
44

55
# Format: "https://resource_name.ai.azure.com/api/projects/project_name"
6-
FOUNDRY_PROJECT_ENDPOINT = "your_project_endpoint"
7-
FOUNDRY_MODEL_NAME = "gpt-5-mini" # supports all Foundry direct models
8-
FOUNDRY_AGENT_NAME = "your_agent_name"
6+
PROJECT_ENDPOINT = "your_project_endpoint"
7+
AGENT_NAME = "your_agent_name"
98

109
# Create project client to call Foundry API
1110
project = AIProjectClient(
12-
endpoint=FOUNDRY_PROJECT_ENDPOINT,
11+
endpoint=PROJECT_ENDPOINT,
1312
credential=DefaultAzureCredential(),
1413
)
1514

1615
# Create an agent with a model and instructions
1716
agent = project.agents.create_version(
18-
agent_name=FOUNDRY_AGENT_NAME,
17+
agent_name=AGENT_NAME,
1918
definition=PromptAgentDefinition(
20-
model=FOUNDRY_MODEL_NAME,
19+
model="gpt-5-mini", # supports all Foundry direct models"
2120
instructions="You are a helpful assistant that answers general questions",
2221
),
2322
)

samples/python/quickstart/responses/quickstart-responses.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
from azure.ai.projects import AIProjectClient
33

44
# Format: "https://resource_name.ai.azure.com/api/projects/project_name"
5-
FOUNDRY_PROJECT_ENDPOINT = "your_project_endpoint"
6-
FOUNDRY_MODEL_NAME = "gpt-5-mini" # supports all Foundry direct models
5+
PROJECT_ENDPOINT = "your_project_endpoint"
76

87
# Create project and openai clients to call Foundry API
98
project = AIProjectClient(
10-
endpoint=FOUNDRY_PROJECT_ENDPOINT,
9+
endpoint=PROJECT_ENDPOINT,
1110
credential=DefaultAzureCredential(),
1211
)
1312
openai = project.get_openai_client()
1413

1514
# Run a responses API call
1615
response = openai.responses.create(
17-
model=FOUNDRY_MODEL_NAME,
16+
model="gpt-5-mini", # supports all Foundry direct models
1817
input="What is the size of France in square miles?",
1918
)
2019
print(f"Response output: {response.output_text}")

0 commit comments

Comments
 (0)